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 uprobes/14774] New: process.statement("*@file:*") probes don't match all functions


http://sourceware.org/bugzilla/show_bug.cgi?id=14774

             Bug #: 14774
           Summary: process.statement("*@file:*") probes don't match all
                    functions
           Product: systemtap
           Version: unspecified
            Status: NEW
          Severity: minor
          Priority: P2
         Component: uprobes
        AssignedTo: systemtap@sourceware.org
        ReportedBy: tschan+sourceware@devzone.ch
    Classification: Unclassified


Description of problem:
process.statement("*@file:*") probes only match a "random" subset of the
functions in the given file.

Version-Release number of selected component (if applicable):
1.7-5 on RHEL 6.

How reproducible:
Always

Steps to Reproduce:
1. Create staptest.c

#include <stdio.h>

void a()
{
  printf("a\n");
}

void b()
{
  printf("b\n");
}

void c()
{
  printf("c\n");
}

int main()
{
  a();
  b();
  c();
  return 0;
}

2. compile staptest: gcc -g staptest.c -o staptest
3. run systemtap: stap -e 'probe process.statement("*@staptest.c:*") {
log(pp()) }' -c ./staptest

Actual results:
Only functions main and c are matched:

a
b
c
process("/home/tschan/stap/staptest").statement("main@/home/tschan/stap/staptest.c:19")
process("/home/tschan/stap/staptest").statement("main@/home/tschan/stap/staptest.c:20")
process("/home/tschan/stap/staptest").statement("main@/home/tschan/stap/staptest.c:21")
process("/home/tschan/stap/staptest").statement("main@/home/tschan/stap/staptest.c:22")
process("/home/tschan/stap/staptest").statement("c@/home/tschan/stap/staptest.c:14")
process("/home/tschan/stap/staptest").statement("c@/home/tschan/stap/staptest.c:15")
process("/home/tschan/stap/staptest").statement("c@/home/tschan/stap/staptest.c:16")
process("/home/tschan/stap/staptest").statement("main@/home/tschan/stap/staptest.c:23")
process("/home/tschan/stap/staptest").statement("main@/home/tschan/stap/staptest.c:24")


Expected results:
All functions are matched:

a
b
c
process("/home/tschan/stap/staptest").statement("main@/home/tschan/stap/staptest.c:19")
process("/home/tschan/stap/staptest").statement("main@/home/tschan/stap/staptest.c:20")
process("/home/tschan/stap/staptest").statement("a@/home/tschan/stap/staptest.c:4")
process("/home/tschan/stap/staptest").statement("a@/home/tschan/stap/staptest.c:5")
process("/home/tschan/stap/staptest").statement("a@/home/tschan/stap/staptest.c:6")
process("/home/tschan/stap/staptest").statement("main@/home/tschan/stap/staptest.c:21")
process("/home/tschan/stap/staptest").statement("b@/home/tschan/stap/staptest.c:9")
process("/home/tschan/stap/staptest").statement("b@/home/tschan/stap/staptest.c:10")
process("/home/tschan/stap/staptest").statement("b@/home/tschan/stap/staptest.c:11")
process("/home/tschan/stap/staptest").statement("main@/home/tschan/stap/staptest.c:22")
process("/home/tschan/stap/staptest").statement("c@/home/tschan/stap/staptest.c:14")
process("/home/tschan/stap/staptest").statement("c@/home/tschan/stap/staptest.c:15")
process("/home/tschan/stap/staptest").statement("c@/home/tschan/stap/staptest.c:16")
process("/home/tschan/stap/staptest").statement("main@/home/tschan/stap/staptest.c:23")
process("/home/tschan/stap/staptest").statement("main@/home/tschan/stap/staptest.c:24")


Additional info:
Changing the order of the definitions of a, b, c in staptest.c changes how many
and which functions are matched.
The probe 'process.statement("*@file:1-99999")' correctly matches all functions
and can be used as a workaround.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- 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]