lkml.org 
[lkml]   [2009]   [Sep]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] 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>
---
tools/perf/util/parse-events.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
index c9ef944..2156269 100644
--- a/tools/perf/util/parse-events.c
+++ b/tools/perf/util/parse-events.c
@@ -425,8 +425,11 @@ parse_single_tracepoint_event(char *sys_name,
int fd;

if (flags) {
- if (!strncmp(flags, "record", strlen(flags)))
+ if (!strncmp(flags, "record", strlen(flags))) {
attr->sample_type |= PERF_SAMPLE_RAW;
+ attr->sample_type |= PERF_SAMPLE_TIME;
+ attr->sample_type |= PERF_SAMPLE_CPU;
+ }
}

snprintf(evt_path, MAXPATHLEN, "%s/%s/%s/id", debugfs_path,
--
1.6.3


\
 
 \ /
  Last update: 2009-09-17 10:53    [W:2.057 / U:3.260 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site