public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] perf, utils: Print the original modifiers in event_name
@ 2012-05-11  0:17 Andi Kleen
  2012-05-11 10:25 ` [PATCH] perf, tool: Add modifiers to be part of the event name Jiri Olsa
  0 siblings, 1 reply; 6+ messages in thread
From: Andi Kleen @ 2012-05-11  0:17 UTC (permalink / raw)
  To: acme; +Cc: jolsa, linux-kernel, Andi Kleen

From: Andi Kleen <ak@linux.intel.com>

We need to save the original string for perf stat output,
otherwise :t and :c are invisible.

This used to work, but broke with the parser refactoring.

Not sure if this is the best fix.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
 tools/perf/util/parse-events.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
index 14fa682..cc561c2 100644
--- a/tools/perf/util/parse-events.c
+++ b/tools/perf/util/parse-events.c
@@ -810,6 +810,7 @@ int parse_events(struct perf_evlist *evlist, const char *str, int unset __used)
 	LIST_HEAD(list_tmp);
 	YY_BUFFER_STATE buffer;
 	int ret, idx = evlist->nr_entries;
+	struct perf_evsel *evsel;
 
 	buffer = parse_events__scan_string(str);
 
@@ -818,6 +819,10 @@ int parse_events(struct perf_evlist *evlist, const char *str, int unset __used)
 	parse_events__flush_buffer(buffer);
 	parse_events__delete_buffer(buffer);
 
+	/* XXX right thing for multiple events? Do all callers free? */
+	list_for_each_entry(evsel, &list, node)
+		evsel->name = strdup(str);
+
 	if (!ret) {
 		int entries = idx - evlist->nr_entries;
 		perf_evlist__splice_list_tail(evlist, &list, entries);
-- 
1.7.7.6


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

end of thread, other threads:[~2012-05-26  3:16 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-11  0:17 [PATCH] perf, utils: Print the original modifiers in event_name Andi Kleen
2012-05-11 10:25 ` [PATCH] perf, tool: Add modifiers to be part of the event name Jiri Olsa
2012-05-14 23:55   ` Andi Kleen
2012-05-15 11:54     ` Jiri Olsa
2012-05-25 22:35   ` Andi Kleen
2012-05-26  3:15     ` Arnaldo Carvalho de Melo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox