• Masami Hiramatsu (Google)'s avatar
    tracing/probes: Support BTF based data structure field access · c440adfb
    Masami Hiramatsu (Google) authored
    Using BTF to access the fields of a data structure. You can use this
    for accessing the field with '->' or '.' operation with BTF argument.
    
     # echo 't sched_switch next=next->pid vruntime=next->se.vruntime' \
       > dynamic_events
     # echo 1 > events/tracepoints/sched_switch/enable
     # head -n 40 trace | tail
              <idle>-0       [000] d..3.   272.565382: sched_switch: (__probestub_sched_switch+0x4/0x10) next=26 vruntime=956533179
          kcompactd0-26      [000] d..3.   272.565406: sched_switch: (__probestub_sched_switch+0x4/0x10) next=0 vruntime=0
              <idle>-0       [000] d..3.   273.069441: sched_switch: (__probestub_sched_switch+0x4/0x10) next=9 vruntime=956533179
         kworker/0:1-9       [000] d..3.   273.069464: sched_switch: (__probestub_sched_switch+0x4/0x10) next=26 vruntime=956579181
          kcompactd0-26      [000] d..3.   273.069480: sched_switch: (__probestub_sched_switch+0x4/0x10) next=0 vruntime=0
              <idle>-0       [000] d..3.   273.141434: sched_switch: (__probestub_sched_switch+0x4/0x10) next=22 vruntime=956533179
        kworker/u2:1-22      [000] d..3.   273.141461: sched_switch: (__probestub_sched_switch+0x4/0x10) next=0 vruntime=0
              <idle>-0       [000] d..3.   273.480872: sched_switch: (__probestub_sched_switch+0x4/0x10) next=22 vruntime=956585857
        kworker/u2:1-22      [000] d..3.   273.480905: sched_switch: (__probestub_sched_switch+0x4/0x10) next=70 vruntime=959533179
                  sh-70      [000] d..3.   273.481102: sched_switch: (__probestub_sched_switch+0x4/0x10) next=0 vruntime=0
    
    Link: https://lore.kernel.org/all/169272157251.160970.9318175874130965571.stgit@devnote2/Signed-off-by: default avatarMasami Hiramatsu (Google) <mhiramat@kernel.org>
    Reviewed-by: default avatarAlan Maguire <alan.maguire@oracle.com>
    Acked-by: default avatarSteven Rostedt (Google) <rostedt@goodmis.org>
    c440adfb
trace_probe.h 18.1 KB