• Arnaldo Carvalho de Melo's avatar
    perf evsel: Provide a new constructor for tracepoints · efd2b924
    Arnaldo Carvalho de Melo authored
    The existing constructor receives a perf_event_attr filled with the
    event type and the config.
    
    To reduce the boilerplate for tracepoints, provide a new constructor,
    perf_evsel__newtp() that receives the tracepoint name and will open
    the debugfs file, call into libtraceevent new pevent_parse_format file
    to fill its ->tp_format member, so that users can then just call
    perf_evsel__field() to access its fields.
    
    Cc: David Ahern <dsahern@gmail.com>
    Cc: Frederic Weisbecker <fweisbec@gmail.com>
    Cc: Jiri Olsa <jolsa@redhat.com>
    Cc: Mike Galbraith <efault@gmx.de>
    Cc: Namhyung Kim <namhyung@gmail.com>
    Cc: Paul Mackerras <paulus@samba.org>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Stephane Eranian <eranian@google.com>
    Cc: Steven Rostedt <rostedt@goodmis.org>
    Link: http://lkml.kernel.org/n/tip-6du8dl1hz0y5l4cybodye7hn@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
    efd2b924
evsel.c 24.5 KB