[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1250149914.10001.65.camel@twins>
Date: Thu, 13 Aug 2009 09:51:53 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Ingo Molnar <mingo@...e.hu>
Cc: Paul Mackerras <paulus@...ba.org>,
stephane eranian <eranian@...glemail.com>,
Corey J Ashford <cjashfor@...ibm.com>,
LKML <linux-kernel@...r.kernel.org>
Subject: [PATCH 3/2] perf tools: Fixup read ABI breakage
Subject: perf tools: Fixup read ABI breakage
From: Peter Zijlstra <a.p.zijlstra@...llo.nl>
Date: Thu Aug 13 09:03:33 CEST 2009
Update the perf tool to the new read output format.
Signed-off-by: Peter Zijlstra <a.p.zijlstra@...llo.nl>
---
tools/perf/builtin-record.c | 2 +-
tools/perf/builtin-stat.c | 8 +++++---
tools/perf/util/event.h | 10 ++++++++--
3 files changed, 14 insertions(+), 6 deletions(-)
Index: linux-2.6/tools/perf/builtin-record.c
===================================================================
--- linux-2.6.orig/tools/perf/builtin-record.c
+++ linux-2.6/tools/perf/builtin-record.c
@@ -370,9 +370,9 @@ static void create_counter(int counter,
struct perf_header_attr *h_attr;
int track = !counter; /* only the first counter needs these */
struct {
- u64 count;
u64 time_enabled;
u64 time_running;
+ u64 count;
u64 id;
} read_data;
Index: linux-2.6/tools/perf/builtin-stat.c
===================================================================
--- linux-2.6.orig/tools/perf/builtin-stat.c
+++ linux-2.6/tools/perf/builtin-stat.c
@@ -168,10 +168,12 @@ static void read_counter(int counter)
close(fd[cpu][counter]);
fd[cpu][counter] = -1;
- count[0] += single_count[0];
if (scale) {
- count[1] += single_count[1];
- count[2] += single_count[2];
+ count[0] += single_count[2]; /* value */
+ count[1] += single_count[0]; /* enabled */
+ count[2] += single_count[1]; /* running */
+ } else {
+ count[0] += single_count[0]; /* value */
}
}
Index: linux-2.6/tools/perf/util/event.h
===================================================================
--- linux-2.6.orig/tools/perf/util/event.h
+++ linux-2.6/tools/perf/util/event.h
@@ -4,6 +4,9 @@
#include "util.h"
#include <linux/list.h>
+/*
+ * PERF_SAMPLE_IP | PERF_SAMPLE_TID | *
+ */
struct ip_event {
struct perf_event_header header;
u64 ip;
@@ -38,12 +41,15 @@ struct lost_event {
u64 lost;
};
-struct read_event {
+/*
+ * PERF_FORMAT_ENABLED | PERF_FORMAT_RUNNING | PERF_FORMAT_ID
+ */
+struct read_event {
struct perf_event_header header;
u32 pid,tid;
- u64 value;
u64 time_enabled;
u64 time_running;
+ u64 value;
u64 id;
};
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists