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]

Re: accessing kernel global variables?


Om Narasimhan <om.turyx@gmail.com> writes:

> Can a system tap script access kernel global variables (which are
> independent of the context it runs in?)

Not at this time.  You'd need to place a probe into the context where
the global is visible, save it in some systemtap global variable, and
use that global elsewhere.

> For example, kernel/pid.c:38 in my tree defines pid_max as,
> int pid_max = PID_MAX_DEFAULT;
> $ sudo stap -g -u -vv  -e 'probe begin { printf("pid_max = %d\n",
> $pid_max) ; exit() }'
> [...]

Once we try to support this, syntax will need to be made available to
let users name the context.  Remember, it could be a kernel- or
user-space value, and the data of each is fragmented into dynamically
loaded parts (modules / shared libraries).

- FChE


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