fche changed the topic of #systemtap to: http://sourceware.org/systemtap; email systemtap@sourceware.org if answers here not timely, conversations may be logged
derek0883 has joined #systemtap
<derek0883>
anyone knows how to access kernel global variables?
<fche>
@var("foo") or $foo from a probe context where $foo is in scope
<derek0883>
cool, thanks @fche
<derek0883>
@fche, printf("command = %p\n", @var("boot_command_line")); works. however. printf("command = %s\n", kernel_string(@var("boot_command_line"))); got runtime error. do you know why?
<fche>
hm I wonder if it's some kernel pointer checking paranoia at work
<fche>
what's your kernel version?
<derek0883>
4.15.18
<derek0883>
ERROR: kernel string copy fault at 0x00000000f6e778ec [man error::fault] near identifier 'kernel_string' at /usr/local/share/systemtap/tapset/linux/conversions.stp:18:10
<fche>
can you paste your stap script more completely?
derek0883 has quit [Remote host closed the connection]
derek0883 has joined #systemtap
derek0883 has quit [Remote host closed the connection]
orivej has quit [Ping timeout: 276 seconds]
derek0883 has joined #systemtap
derek0883 has quit [Remote host closed the connection]
derek0883 has joined #systemtap
derek0883 has quit [Ping timeout: 264 seconds]
_whitelogger has joined #systemtap
ggherdov_ has quit [Changing host]
ggherdov_ has joined #systemtap
ggherdov_ has joined #systemtap
ggherdov_ has quit [Changing host]
ggherdov_ is now known as ggherdov
orivej has joined #systemtap
derek0883 has joined #systemtap
derek0883 has quit [Ping timeout: 264 seconds]
eichiro has quit [*.net *.split]
eichiro has joined #systemtap
fdalleau_away is now known as fdalleau
derek0883 has joined #systemtap
derek0883 has quit [Remote host closed the connection]
derek0883 has joined #systemtap
<derek0883>
Hi @fche I can get address by @var("nmi_desc"), nmi_desc is a array name, do you know how can I access like an array? currently I can only access nmi_desc[0]. is there any better way that I don't have to manually calculate offset? thanks.
derek0883 has quit [Remote host closed the connection]
derek0883 has joined #systemtap
derek0883 has quit [Remote host closed the connection]
derek0883 has joined #systemtap
fdalleau is now known as fdalleau_away
orivej has quit [Ping timeout: 245 seconds]
orivej has joined #systemtap
derek0883 has quit [Remote host closed the connection]
derek0883 has joined #systemtap
derek0883 has quit [Remote host closed the connection]
orivej has quit [Ping timeout: 246 seconds]
derek0883 has joined #systemtap
derek0883 has quit [Remote host closed the connection]
derek0883 has joined #systemtap
<fche>
if the type is not forward-declared or something incomplete, you should be able to say @var("nmi_desc")[1] and so on
khaled has quit [Quit: Konversation terminated!]
khaled has joined #systemtap
derek0883 has quit [Remote host closed the connection]