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]

Using kernel global variables


It is my understanding if we want to access a kernel global variable in a tap script we must be in a context that is using the variable.
for example the following script will compile:


probe kernel.function("jiffies_to_timeval")
{
       printf("%x\n", $jiffies);
}

This works because, jiffies_to_timeval() uses jiffies in the function, thus in the scope of the probes there exists a DWARF location information block for the variable jiffies.

If I change the probe point to do_fork() the probe will not build, I get the error:
"probe do_fork@kernel/fork.c:1369 kernel section=.text pc=0x127b00
semantic error: failed to retrieve location attribute for local 'jiffies' (dieoffset: 0x18309f): identifier '$jiffies' at global.stp:5:17"
This is because do_fork is not using jiffies.


Is this correct?

Dave....


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