Skip to content

Commit 1281a49

Browse files
Li ZefanIngo Molnar
authored andcommitted
perf trace: Sample timestamp and cpu when using record flag
Sample timestamp and cpu just like the -R option. Before: init-0 [-01] 1266874889.17179869184709551615: irq_handler_entry: irq=18 handler=eth0 init-0 [-01] 1266874889.17179869184709551615: irq_handler_entry: irq=18 handler=eth0 init-0 [-01] 1266874889.17179869184709551615: irq_handler_entry: irq=1 handler=i8042 init-0 [-01] 1266874889.17179869184709551615: irq_handler_entry: irq=18 handler=eth0 init-0 [-01] 1266874889.17179869184709551615: irq_handler_entry: irq=1 handler=i8042 After: init-0 [001] 7364.568965353: irq_handler_entry: irq=18 handler=eth0 init-0 [001] 7365.530226877: irq_handler_entry: irq=1 handler=i8042 init-0 [001] 7365.542831563: irq_handler_entry: irq=18 handler=eth0 init-0 [001] 7365.644156299: irq_handler_entry: irq=18 handler=eth0 init-0 [001] 7365.694556201: irq_handler_entry: irq=18 handler=eth0 Signed-off-by: Li Zefan <lizf@cn.fujitsu.com> Acked-by: Frederic Weisbecker <fweisbec@gmail.com> Cc: Peter Zijlstra <peterz@infradead.org> LKML-Reference: <4AB1F827.8040905@cn.fujitsu.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
1 parent 270bbbe commit 1281a49

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tools/perf/util/parse-events.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,8 +425,11 @@ parse_single_tracepoint_event(char *sys_name,
425425
int fd;
426426

427427
if (flags) {
428-
if (!strncmp(flags, "record", strlen(flags)))
428+
if (!strncmp(flags, "record", strlen(flags))) {
429429
attr->sample_type |= PERF_SAMPLE_RAW;
430+
attr->sample_type |= PERF_SAMPLE_TIME;
431+
attr->sample_type |= PERF_SAMPLE_CPU;
432+
}
430433
}
431434

432435
snprintf(evt_path, MAXPATHLEN, "%s/%s/%s/id", debugfs_path,

0 commit comments

Comments
 (0)