All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] perf trace: Sample timestamp and cpu when using record flag
@ 2009-09-17  8:49 Li Zefan
  2009-09-17  8:56 ` Frederic Weisbecker
  2009-09-17 22:35 ` [tip:perfcounters/core] " tip-bot for Li Zefan
  0 siblings, 2 replies; 3+ messages in thread
From: Li Zefan @ 2009-09-17  8:49 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: Frederic Weisbecker, Peter Zijlstra, LKML

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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] perf trace: Sample timestamp and cpu when using record flag
  2009-09-17  8:49 [PATCH] perf trace: Sample timestamp and cpu when using record flag Li Zefan
@ 2009-09-17  8:56 ` Frederic Weisbecker
  2009-09-17 22:35 ` [tip:perfcounters/core] " tip-bot for Li Zefan
  1 sibling, 0 replies; 3+ messages in thread
From: Frederic Weisbecker @ 2009-09-17  8:56 UTC (permalink / raw)
  To: Li Zefan; +Cc: Ingo Molnar, Peter Zijlstra, LKML

On Thu, Sep 17, 2009 at 04:49:43PM +0800, Li Zefan wrote:
> 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>


> ---
>  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
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [tip:perfcounters/core] perf trace: Sample timestamp and cpu when using record flag
  2009-09-17  8:49 [PATCH] perf trace: Sample timestamp and cpu when using record flag Li Zefan
  2009-09-17  8:56 ` Frederic Weisbecker
@ 2009-09-17 22:35 ` tip-bot for Li Zefan
  1 sibling, 0 replies; 3+ messages in thread
From: tip-bot for Li Zefan @ 2009-09-17 22:35 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, hpa, mingo, fweisbec, lizf, peterz, tglx, mingo

Commit-ID:  1281a49b7aa865a1f0d60e2b28410e6234fc686b
Gitweb:     http://git.kernel.org/tip/1281a49b7aa865a1f0d60e2b28410e6234fc686b
Author:     Li Zefan <lizf@cn.fujitsu.com>
AuthorDate: Thu, 17 Sep 2009 16:49:43 +0800
Committer:  Ingo Molnar <mingo@elte.hu>
CommitDate: Fri, 18 Sep 2009 00:30:25 +0200

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>


---
 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 910283c..a9bdcab 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,

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-09-17 22:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-17  8:49 [PATCH] perf trace: Sample timestamp and cpu when using record flag Li Zefan
2009-09-17  8:56 ` Frederic Weisbecker
2009-09-17 22:35 ` [tip:perfcounters/core] " tip-bot for Li Zefan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.