[PATCH] perf, utils: Print the original modifiers in event_name

From: Andi Kleen
Date: Thu May 10 2012 - 20:17:58 EST

From: Andi Kleen <ak@xxxxxxxxxxxxxxx>

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@xxxxxxxxxxxxxxx>
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)
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)

+ /* 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);

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/