This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug translator/1133] support .callees probe pattern extension


https://sourceware.org/bugzilla/show_bug.cgi?id=1133

--- Comment #7 from Jonathan Lebon <jlebon at redhat dot com> ---
(In reply to Jonathan Lebon from comment #6)
> Also, I haven't implemented a possible .callee(N) yet, which would
> recursively probe callees of callees.

Added .callees(N), which does this. I also added .callees, which is equivalent
to .callees(1) (also equivalent to .callee("*")):

$ cd temp
$ cat nested.c
// gcc -o nested nested.c -g -O

__attribute__((noinline))
int level3(int a, int b) {
   return a + b;
}

__attribute__((noinline))
int level2(int a, int b) {
   return level3(a-b, a+b);
}

__attribute__((noinline))
int level1(int a, int b) {
   return level2(a/b, a%b);
}

int main(void) {
   int a = 1;
   a = level1(a, a);
   return a;
}

$ gcc -o nested nested.c -g -O
$ stap -L 'process("nested").function("main").callees'
process("/home/yyz/jlebon/codebase/systemtap/systemtap/temp/nested").function("level1@/home/yyz/jlebon/codebase/systemtap/systemtap/temp/nested.c:14")
$a:int $b:int
$ stap -L 'process("nested").function("main").callees(1)'
process("/home/yyz/jlebon/codebase/systemtap/systemtap/temp/nested").function("level1@/home/yyz/jlebon/codebase/systemtap/systemtap/temp/nested.c:14")
$a:int $b:int
$ stap -L 'process("nested").function("main").callees(2)'
process("/home/yyz/jlebon/codebase/systemtap/systemtap/temp/nested").function("level1@/home/yyz/jlebon/codebase/systemtap/systemtap/temp/nested.c:14")
$a:int $b:int
process("/home/yyz/jlebon/codebase/systemtap/systemtap/temp/nested").function("level2@/home/yyz/jlebon/codebase/systemtap/systemtap/temp/nested.c:9")
$a:int $b:int
$ stap -L 'process("nested").function("main").callees(3)'
process("/home/yyz/jlebon/codebase/systemtap/systemtap/temp/nested").function("level1@/home/yyz/jlebon/codebase/systemtap/systemtap/temp/nested.c:14")
$a:int $b:int
process("/home/yyz/jlebon/codebase/systemtap/systemtap/temp/nested").function("level2@/home/yyz/jlebon/codebase/systemtap/systemtap/temp/nested.c:9")
$a:int $b:int
process("/home/yyz/jlebon/codebase/systemtap/systemtap/temp/nested").function("level3@/home/yyz/jlebon/codebase/systemtap/systemtap/temp/nested.c:4")
$a:int $b:int
$

-- 
You are receiving this mail because:
You are the assignee for the bug.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]