perf: add perf-inject builtin
Currently, perf 'live mode' writes build-ids at the end of the session, which isn't actually useful for processing live mode events. What would be better would be to have the build-ids sent before any of the samples that reference them, which can be done by processing the event stream and retrieving the build-ids on the first hit. Doing that in perf-record itself, however, is off-limits. This patch introduces perf-inject, which does the same job while leaving perf-record untouched. Normal mode perf still records the build-ids at the end of the session as it should, but for live mode, perf-inject can be injected in between the record and report steps e.g.: perf record -o - ./hackbench 10 | perf inject -v -b | perf report -v -i - perf-inject reads a perf-record event stream and repipes it to stdout. At any point the processing code can inject other events into the event stream - in this case build-ids (-b option) are read and injected as needed into the event stream. Build-ids are just the first user of perf-inject - potentially anything that needs userspace processing to augment the trace stream with additional information could make use of this facility. Cc: Ingo Molnar <mingo@elte.hu> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: Frédéric Weisbecker <fweisbec@gmail.com> LKML-Reference: <1272696080-16435-3-git-send-email-tzanussi@gmail.com> Signed-off-by:Tom Zanussi <tzanussi@gmail.com> Signed-off-by:
Arnaldo Carvalho de Melo <acme@redhat.com>
Showing
- tools/perf/Makefile 1 addition, 0 deletionstools/perf/Makefile
- tools/perf/builtin-annotate.c 1 addition, 1 deletiontools/perf/builtin-annotate.c
- tools/perf/builtin-buildid-list.c 1 addition, 1 deletiontools/perf/builtin-buildid-list.c
- tools/perf/builtin-diff.c 2 additions, 2 deletionstools/perf/builtin-diff.c
- tools/perf/builtin-inject.c 228 additions, 0 deletionstools/perf/builtin-inject.c
- tools/perf/builtin-kmem.c 1 addition, 1 deletiontools/perf/builtin-kmem.c
- tools/perf/builtin-lock.c 1 addition, 1 deletiontools/perf/builtin-lock.c
- tools/perf/builtin-record.c 1 addition, 1 deletiontools/perf/builtin-record.c
- tools/perf/builtin-report.c 1 addition, 1 deletiontools/perf/builtin-report.c
- tools/perf/builtin-sched.c 1 addition, 1 deletiontools/perf/builtin-sched.c
- tools/perf/builtin-timechart.c 1 addition, 1 deletiontools/perf/builtin-timechart.c
- tools/perf/builtin-top.c 1 addition, 1 deletiontools/perf/builtin-top.c
- tools/perf/builtin-trace.c 1 addition, 1 deletiontools/perf/builtin-trace.c
- tools/perf/builtin.h 1 addition, 0 deletionstools/perf/builtin.h
- tools/perf/perf.c 1 addition, 0 deletionstools/perf/perf.c
- tools/perf/util/header.c 27 additions, 8 deletionstools/perf/util/header.c
- tools/perf/util/session.c 2 additions, 1 deletiontools/perf/util/session.c
- tools/perf/util/session.h 2 additions, 1 deletiontools/perf/util/session.h
- tools/perf/util/trace-event-read.c 18 additions, 1 deletiontools/perf/util/trace-event-read.c
- tools/perf/util/trace-event.h 1 addition, 1 deletiontools/perf/util/trace-event.h
Loading
Please register or sign in to comment