Skip to content

Commit 6f917c7

Browse files
ahunter6acmel
authored andcommitted
perf session: Add ability to 'skip' a non-piped event stream
A piped event stream may contain arbitary sized tracepoint information following a PERF_RECORD_HEADER_TRACING_DATA event. The position in the stream has to be 'skipped' to match the start of the next event. Provide the same ability to a non-piped event stream to allow for Instruction Trace data that may also be in a non-piped event stream. Signed-off-by: Adrian Hunter <[email protected]> Cc: David Ahern <[email protected]> Cc: Frederic Weisbecker <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Stephane Eranian <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent 2a03068 commit 6f917c7

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

tools/perf/util/session.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1284,6 +1284,7 @@ int __perf_session__process_events(struct perf_session *session,
12841284
union perf_event *event;
12851285
uint32_t size;
12861286
struct ui_progress prog;
1287+
int skip;
12871288

12881289
perf_tool__fill_defaults(tool);
12891290

@@ -1344,14 +1345,18 @@ int __perf_session__process_events(struct perf_session *session,
13441345
size = event->header.size;
13451346

13461347
if (size < sizeof(struct perf_event_header) ||
1347-
perf_session__process_event(session, event, tool, file_pos) < 0) {
1348+
(skip = perf_session__process_event(session, event, tool, file_pos))
1349+
< 0) {
13481350
pr_err("%#" PRIx64 " [%#x]: failed to process type: %d\n",
13491351
file_offset + head, event->header.size,
13501352
event->header.type);
13511353
err = -EINVAL;
13521354
goto out_err;
13531355
}
13541356

1357+
if (skip)
1358+
size += skip;
1359+
13551360
head += size;
13561361
file_pos += size;
13571362

0 commit comments

Comments
 (0)