Topic
1 reply Latest Post - ‏2012-05-16T12:09:42Z by flodstrom
freelines
freelines
1 Post
ACCEPTED ANSWER

Pinned topic Probevue not working with user function probe

‏2012-05-11T14:27:41Z |
Hi everybody,

I have two AIX 6.1 LPARs, same configuration, same probevue command available (version/date).
I have two different applications, app A (c code) compiled with cc_r and app B (c++ code) compiled with xlC.
A is running on the first node, B on the second. The symbols table is present in both (dump -tv), executables are not stripped and are statically linked apart for some kernel shared libraries.

I defined a probevue script (script.e) to trace a library function present in the symbol table of both A and B.
The corresponding symbol name has "Scn" = ".text" and "Sclass"="extern", then the function is traceable according to:
http://www.ibm.com/developerworks/aix/library/au-probevuec/index.html?ca=drs-.

This is the script:

int count;
@@BEGIN
{ printf("Start probing\n");}

@@uft:$1:*:function_name:entry
{printf("Function called");}


where function_name is the same name of the corresponding symbol in the symbol table, but without dot (.).

I can successfully attach to application B and trace all calls to the function, but I get ERR19 (invalid probe) when trying to attach to process A. The script is the same andaccess rights on the two nodes allow execution of probevue and access to the processes.
In fact, if I try to trace system calls in process A, that works fine. It seems that probevue cannot probe any user function with @@uft probes in application B, only system calls with @@syscall.

So I guessed the problem might be caused by:
  • partial support for C code or C code not fully compliant to ANSI (cc_r allows pre-ANSI code).
  • impact of different flags implied by cc_r and xlC respectively.

Any other reasons?
Any feedback would be very much appreciated.
Updated on 2012-05-16T12:09:42Z at 2012-05-16T12:09:42Z by flodstrom
  • flodstrom
    flodstrom
    56 Posts
    ACCEPTED ANSWER

    Re: Probevue not working with user function probe

    ‏2012-05-16T12:09:42Z  in response to freelines
    Are you attaching to an already running process or are you starting it with probevue?

    In case you are starting your application with probevue you should probably use $__CPID, or $__CTID for a thread, instead of $1 like:

    
    @@uft:$__CPID:*:your_function:entry
    


    Is the "A" application multithreaded (noticed that you use the thread safe version/option)?

    If I recall correctly the ERR19 code indicate that there are problems connecting to the process (correct PID?)?

    Although I think probevue is initially aimed mostly for C++, it should work for C code as well. However something I have noticed is that you may have to define your (user) function in the probevue script if you are using C only.