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]

accessing kernel global variables?


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

For example, kernel/pid.c:38 in my tree defines pid_max as,

int pid_max = PID_MAX_DEFAULT;

When I try printing this value using the below scriptlet I get errors.

$ sudo stap -g -u -vv -e 'probe begin { printf("pid_max = %d\n", $pid_max) ; exit() }'
SystemTap translator/driver (version 0.6.2/0.127 built 2008-03-27)
Copyright (C) 2005-2008 Red Hat, Inc. and others
This is free software; see the source for copying conditions.
Created temporary directory "/tmp/stappkNTb2"
Searched '/usr/share/system tap/tapset/x86_64/*.stp', found 1
Searched '/usr/share/system tap/tapset/*.stp', found 37
Pass 1: parsed user script and 38 library script(s) in 120usr/10sys/163real ms.
semantic error: unresolved target-symbol expression: identifier '$pid_max' at <input>:1:40
Pass 2: analyzed script: 1 probe(s), 5 function(s), 0 embed(s), 0 global(s) in 0usr/0sys/2real ms.
Pass 2: analysis failed. Try again with more '-v' (verbose) options.
Running rm -rf /tmp/stappkNTb2


Is it expected? Or am I doing something wrong?

Thanks,
Om.


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