This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: accessing kernel global variables?
- From: fche at redhat dot com (Frank Ch. Eigler)
- To: Om Narasimhan <om dot turyx at gmail dot com>
- Cc: systemtap at sourceware dot org
- Date: Mon, 08 Sep 2008 08:07:42 -0400
- Subject: Re: accessing kernel global variables?
- References: <48C492BE.4020205@gmail.com>
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