Are the variables defined by probe aliases target variables? (accessible
by $var?). I am getting different results in my machine.
$ uname -a
Linux testserv.home 2.6.23.17-88.fc7 #1 SMP Thu May 15 00:02:29 EDT 2008
x86_64 x86_64 x86_64 GNU/Linux
$ stap -V
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.
$ sudo stap -e 'probe vm.pagefault { printf("%#x->%d\n", $address,
$write_access)}'
0x2aaaaf2d1000->1
0x2aaaaf2d1000->1
0x2aaaaf2d1000->1
0x3683adcfd0->0
0x40414d->0
^C
The corresponding function in tapset is,
$ grep vm.pagefault -A 5 /usr/share/systemtap/tapset/memory.stp
probe vm.pagefault = kernel.function("__handle_mm_fault@mm/memory.c") ?,
kernel.function("handle_mm_fault@mm/memory.c") ?
{
write_access = $write_access
address = $address
}
Now I do the same operation using process.stp function `process_create`
$ sudo stap -e 'probe process.create { printf("%d\n", $new_pid) }'
semantic error: unable to find local 'new_pid' near pc
0xffffffff81034327 (alternatives: clone_flags stack_start regs
stack_size parent_tidptr child_tidptr pid retval p): identifier
'$new_pid' at <input>:1:39
Pass 2: analysis failed. Try again with more '-v' (verbose) options.
Corresponding code from process.stp is,
probe process.create = kernel.function("copy_process").return {
task = $return
new_pid = task_pid(task)
if (_IS_ERR(task)) next
}
Despite new_pid is used(hence defined), I can't access it as a target
variable. But if I omit $, it works fine.
Eg,
$ sudo stap -e 'probe process.create { printf("%d\n", new_pid) }'
10953
10953
(Though I don't understand how can it print same pid more than once)
So, my question is how to differentiate normal variables with target
variables?
I would like to add that in the first example, address is accessible
without $variable too.
Thanks,
Om.
--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ