accessing kernel global variables?
Frank Ch. Eigler
fche@redhat.com
Mon Sep 8 12:09:00 GMT 2008
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
More information about the Systemtap
mailing list