Sometimes you believe a variable is available with -L, but then it turns out the location list for that variable doesn't actually cover the address that we will place the probe on. For example: $ stap -L 'kernel.function("tc_fill_tclass")' kernel.function("tc_fill_tclass@net/sched/sch_api.c:990") $skb:struct sk_buff* $q:struct Qdisc* $cl:long unsigned int $pid:u32 $seq:u32 $flags:u16 $event:int $tcm:struct tcmsg* $nlh:struct nlmsghdr* $b:unsigned char* $d:struct gnet_dump $cl_ops:struct Qdisc_class_ops* But then when we try to actually query $tcm we get: semantic error: not accessible at this address (0xffffffff80239505): identifier '$tcm' at <input>:1:96 source: probe kernel.function("tc_fill_tclass").return { printf("pid=%d, cl=%d, tcm=%p.\n", $pid, $cl, $tcm-) } Which is indeed correct, the location list for tcm says: 0048393a ffffffff802395a2 ffffffff80239643 (DW_OP_reg6) 0048393a ffffffff802396aa ffffffff80239719 (DW_OP_reg6) So it isn't available at the (function entry) probe address.
Created attachment 4332 [details] patch and example With this patch, $ stap -L 'kernel.function("tc_fill_tclass")' kernel.function("tc_fill_tclass@net/sched/sch_api.c:1435") $skb:struct sk_buff* $q:struct Qdisc* $cl:long unsigned int $pid:u32 $seq:u32 $flags:u16 $event:int $nlh:struct nlmsghdr* $b:unsigned char* $cl_ops:struct Qdisc_class_ops const* We can see $tcm and $d are eliminated. And to access the listed variables, $ stap -p4 -e 'probe kernel.function("tc_fill_tclass"){print($skb+$q+$cl+$pid+$seq+$flags+$event+$nlh+$b+$cl_ops)}' stap_16232.ko
Looks good to me, please commit, unless jistone has objections.
Looks fine to me too, thanks!
commit f10534c6a2a958609b7bc76390d50c17a36250d3
thanks!