• Arnaldo Carvalho de Melo's avatar
    perf trace: Support tracepoint dynamic char arrays · c5e006cd
    Arnaldo Carvalho de Melo authored
    Things like:
    
      # grep __data_loc /sys/kernel/debug/tracing/events/sched/sched_process_exec/format
    	field:__data_loc char[] filename;	offset:8;	size:4;	signed:1;
      #
    
    That, at that offset (8) and with that size(8) have an integer that
    contains the real length and offset for the contents of that array.
    
    Now this works:
    
      # perf trace --max-events 1 -e sched:*exec -a
         0.000 sed/19441 sched:sched_process_exec(filename: "/usr/bin/sync", pid: 19441 (sync), old_pid: 19441 (sync))
      #
    
    As when using the libtraceevent based beautifier:
    
      # perf trace --libtraceevent --max-events 1 -e sched:*exec -a
         0.000 sync/19463 sched:sched_process_exec(filename=/usr/bin/sync pid=19463 old_pid=19463)
      #
    
    I.e. that 'filename' is implemented as a dynamic char array.
    
    Cc: Adrian Hunter <adrian.hunter@intel.com>
    Cc: Andi Kleen <ak@linux.intel.com>
    Cc: David Ahern <dsahern@gmail.com>
    Cc: Jiri Olsa <jolsa@kernel.org>
    Cc: Luis Cláudio Gonçalves <lclaudio@redhat.com>
    Cc: Namhyung Kim <namhyung@kernel.org>
    Link: https://lkml.kernel.org/n/tip-950p0m842fe6n7sxsdwqj5i2@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
    c5e006cd
builtin-trace.c 140 KB