1

我在内核 3.11.0-generic 的 ubuntu 13.10 上运行 systemtap 2.2.1。

以下脚本

probe begin {
  printf("Started...\n")
}

probe kernel.function("netif_receive_skb") {
  printf("%s\n",$skb$$);
  exit();
}

打印以下结果

root@u1310:~# stap net.stp

开始...

{.next=0x0, .prev=0x0, .tstamp={.tv64=0}, .sk=0x0, .dev=0xffff880134c94000, .cb="", ._skb_refdst=0, .sp=0x0, .len= 46, .data_len=0, .mac_len=14, .hdr_len=0, ={.csum=0, ={.csum_start=0, .csum_offset=0}}, .priority=0, .local_df=0, .cloned =0, .ip_summed=1, .nohdr=0, .nfctinfo=0, .pkt_type=0, .fclone=0, .ipvs_property=0, .peeked=0, .nf_trace=0, .protocol=8, .destructor =0x0, .nfct=0x0, .nfct_reasm=0x0, .nf_bridge=0x0, .skb_iif=0, ... } <-- 如何打印所有字段而不仅仅是省略号?

根@u1310:~#

如何打印结构中的所有字段而不是“省略号”...

任何帮助、指针和/或参考将不胜感激,我的 google-fu 只带我到目前为止......

4

1 回答 1

5

来自 systemtap 的 tapsets.cxx:

2909 void
2910 dwarf_pretty_print::recurse_struct_members (Dwarf_Die* type, target_symbol* e,
2911                                             print_format* pf, int& count)

2965             // NB: limit to 32 args; see PR10750 and c_unparser::visit_print_format.
2966             if (pf->args.size() >= 32)
2967               {
2968                 pf->raw_components.append("...");
2969                 break;
2970               }

这是与安全约束相关的实现限制(不想冒着被太多可变参数炸毁内核堆栈的风险)。将来应该可以修复。

于 2013-11-19T21:40:03.157 回答