public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
From: mathieu lacage <Mathieu.Lacage@sophia.inria.fr>
To: mathieu lacage <Mathieu.Lacage@sophia.inria.fr>
Cc: systemtap@sources.redhat.com
Subject: Re: Hitachi djprobe mechanism
Date: Mon, 07 Nov 2005 10:04:00 -0000	[thread overview]
Message-ID: <436F26B8.9060204@sophia.inria.fr> (raw)
In-Reply-To: <43621B0D.70204@sophia.inria.fr>

hi,

I was interested enough that I hacked together the attached patch (I 
used gcc svn HEAD and binutils cvs HEAD). It seems to work nicely with 
-O0 but it seems to break on the simple testcase below with -O2/-O3 on 
x86. i.e., it reports a bb boundary at 0x11 and I cannot see why there 
would be a bb boundary there.

Also, I noticed that if you want to use this code for djprobe insertion 
location verification, you will need to parse the resulting binary 
anyway to detect the call sites which are not really bb boundaries and 
are thus not reported by the patch as bb boundaries but which are 
forbidden boundary locations for djprobe insertion.

I will do a lot more testing in a few days but I thought it might be 
useful to send an early report.

regards,
Mathieu

#include <stdio.h>
static int foo (void)
{
        if (3) {
                int i = 0;
                while (i < 100) {
                        printf ("test\n");
                        i++;
                }
        }
        return 8;
}

int main (int argc, char *argv[])
{
        foo ();
        return 0;
}

Here, I get the following list of basic blocks with the debugging 
information:
ad: 0x0
ad: 0x11
ad: 0x20
ad: 0x32
while the assembly output does not seem to contain any jump to 0x11:
00000000 <main>:
   0:   8d 4c 24 04             lea    0x4(%esp),%ecx
   4:   83 e4 f0                and    $0xfffffff0,%esp
   7:   ff 71 fc                pushl  0xfffffffc(%ecx)
   a:   55                      push   %ebp
   b:   89 e5                   mov    %esp,%ebp
   d:   53                      push   %ebx
   e:   31 db                   xor    %ebx,%ebx
  10:   51                      push   %ecx
  11:   83 ec 10                sub    $0x10,%esp
  14:   8d b6 00 00 00 00       lea    0x0(%esi),%esi
  1a:   8d bf 00 00 00 00       lea    0x0(%edi),%edi
  20:   c7 04 24 00 00 00 00    movl   $0x0,(%esp)
  27:   43                      inc    %ebx
  28:   e8 fc ff ff ff          call   29 <main+0x29>
  2d:   83 fb 64                cmp    $0x64,%ebx
  30:   75 ee                   jne    20 <main+0x20>
  32:   83 c4 10                add    $0x10,%esp
  35:   31 c0                   xor    %eax,%eax
  37:   59                      pop    %ecx
  38:   5b                      pop    %ebx
  39:   5d                      pop    %ebp
  3a:   8d 61 fc                lea    0xfffffffc(%ecx),%esp
  3d:   c3                      ret



>> Richard Henderson has done some work in both gcc and the assembler to 
>> emit
>> DWARF basic block markers.  The compiler knows what the jump targets 
>> are in
>> code it generates.  For inline assembly, the assembler supports 
>> emitting a
>>   
>

  parent reply	other threads:[~2005-11-07 10:04 UTC|newest]

Thread overview: 83+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-27 21:05 Keshavamurthy, Anil S
2005-07-28  1:51 ` Karim Yaghmour
2005-07-28  2:10   ` Karim Yaghmour
2005-07-28 16:23     ` Masami Hiramatsu
2005-07-28 16:28       ` Karim Yaghmour
2005-07-28 17:36         ` Mathieu Desnoyers
     [not found]           ` <20050728110717.A30199@unix-os.sc.intel.com>
2005-07-28 18:33             ` Mathieu Desnoyers
     [not found]               ` <20050728133456.A32210@unix-os.sc.intel.com>
2005-07-28 23:53                 ` Richard J Moore
2005-07-29  5:59                 ` Mathieu Desnoyers
2005-07-29  7:55                   ` Andi Kleen
2005-07-29  8:44                     ` Richard J Moore
2005-07-29  8:46                       ` Andi Kleen
2005-07-29 15:51                     ` Mathieu Desnoyers
2005-07-30 15:55                       ` Andi Kleen
2005-07-30 16:54                         ` Mathieu Desnoyers
2005-07-31 22:03                           ` Andi Kleen
2005-07-31 23:11                             ` Mathieu Desnoyers
2005-08-01 15:37                               ` Andi Kleen
2005-08-01  8:44                             ` Richard J Moore
2005-08-01 13:21                               ` Mathieu Desnoyers
2005-08-01 19:57                               ` Satoshi Oshima
2005-08-01 20:21                                 ` Karim Yaghmour
2005-08-01 22:12                                   ` Satoshi Oshima
2005-08-01 22:54                                     ` Karim Yaghmour
2005-08-02 18:42                                       ` Satoshi Oshima
2005-08-03 14:50                                         ` Karim Yaghmour
2005-08-04  1:19                                         ` Mathieu Desnoyers
2005-08-04  3:31                                           ` Mathieu Desnoyers
2005-08-02  9:42                                   ` Mathieu Lacage
2005-08-02 15:09                                     ` Karim Yaghmour
2005-10-07 15:35                                     ` Richard J Moore
2005-10-08 18:33                                       ` mathieu lacage
2005-10-08 21:59                                         ` Richard J Moore
2005-10-08 23:24                                           ` Roland McGrath
2005-10-22 11:49                                             ` mathieu lacage
2005-10-22 22:09                                               ` Roland McGrath
2005-10-24  6:33                                                 ` Mathieu Lacage
2005-10-24 19:48                                                   ` Roland McGrath
     [not found]                                             ` <43621B0D.70204@sophia.inria.fr>
2005-11-07 10:04                                               ` mathieu lacage [this message]
2005-11-07 10:06                                                 ` mathieu lacage
2005-11-08  9:49                                             ` Richard J Moore
2005-10-09 16:47                                           ` mathieu lacage
2005-08-02 15:33                                   ` Mathieu Lacage
2005-08-02 15:36                                     ` Mathieu Lacage
2005-08-02 16:12                                     ` Karim Yaghmour
2005-08-02 16:30                                       ` Mathieu Lacage
2005-08-02 16:46                                         ` Karim Yaghmour
2005-08-04 17:09                                         ` Mathieu Lacage
2005-08-03 14:46                                 ` Andi Kleen
2005-07-29 16:06                   ` Frank Ch. Eigler
2005-07-29 18:24                     ` sugita
2005-07-28 18:13       ` Richard J Moore
  -- strict thread matches above, loose matches on Subject: below --
2005-08-01 22:49 Keshavamurthy, Anil S
2005-08-01 23:05 ` Karim Yaghmour
2005-08-01 23:18   ` Karim Yaghmour
2005-08-01 22:41 Keshavamurthy, Anil S
2005-08-02  3:21 ` Roland McGrath
2005-08-02  3:35   ` Karim Yaghmour
2005-08-01 20:46 Keshavamurthy, Anil S
2005-08-01 21:08 ` Karim Yaghmour
2005-08-01 16:14 Keshavamurthy, Anil S
2005-08-01 20:31 ` Roland McGrath
2005-08-04  0:28   ` Mathieu Desnoyers
2005-08-04 10:01     ` Andi Kleen
2005-08-05 16:25       ` Mathieu Desnoyers
2005-08-05 16:39         ` Andi Kleen
2005-08-01 15:50 Keshavamurthy, Anil S
2005-08-01 16:03 ` Mathieu Desnoyers
2005-07-29  0:18 Keshavamurthy, Anil S
2005-07-29  1:48 ` Karim Yaghmour
2005-07-29  3:41   ` Mathieu Desnoyers
2005-07-29  3:47     ` Karim Yaghmour
2005-07-29  1:53 ` Frank Ch. Eigler
2005-08-01  9:02   ` Mathieu Lacage
2005-08-01 13:18     ` Mathieu Desnoyers
2005-08-02  7:07       ` Mathieu Lacage
2005-07-22 18:09 Frank Ch. Eigler
2005-07-21 22:32 Richard J Moore
2005-07-21 22:52 ` Roland McGrath
2005-07-22  2:52   ` Richard J Moore
2005-07-26  7:14   ` Masami Hiramatsu
2005-07-26  7:53     ` Roland McGrath
2005-07-27 13:02       ` Masami Hiramatsu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=436F26B8.9060204@sophia.inria.fr \
    --to=mathieu.lacage@sophia.inria.fr \
    --cc=systemtap@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).