* [PATCH 1/2] perf top: update event name when falling back to cpu-clock
@ 2012-05-08 16:49 David Ahern
2012-05-11 6:47 ` [tip:perf/core] perf top: Update " tip-bot for David Ahern
0 siblings, 1 reply; 2+ messages in thread
From: David Ahern @ 2012-05-08 16:49 UTC (permalink / raw)
To: acme, linux-kernel; +Cc: David Ahern
perf-top falls back to cpu-clock if the H/W cycles event is not
supported, but the event name is not updated leading to a
misleading header:
PerfTop: 8 irqs/sec kernel:75.0% exact: 0.0% [1000Hz cycles], ...
Update the event name when the event type is changed so that the
header displays correctly:
PerfTop: 794 irqs/sec kernel:100.0% exact: 0.0% [1000Hz cpu-clock], ...
Signed-off-by: David Ahern <dsahern@gmail.com>
---
tools/perf/builtin-top.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
index c53cdab..79481c1 100644
--- a/tools/perf/builtin-top.c
+++ b/tools/perf/builtin-top.c
@@ -948,6 +948,11 @@ try_again:
attr->type = PERF_TYPE_SOFTWARE;
attr->config = PERF_COUNT_SW_CPU_CLOCK;
+ if (counter->name) {
+ free(counter->name);
+ counter->name = NULL;
+ counter->name = strdup(event_name(counter));
+ }
goto try_again;
}
--
1.7.5.4
^ permalink raw reply [flat|nested] 2+ messages in thread
* [tip:perf/core] perf top: Update event name when falling back to cpu-clock
2012-05-08 16:49 [PATCH 1/2] perf top: update event name when falling back to cpu-clock David Ahern
@ 2012-05-11 6:47 ` tip-bot for David Ahern
0 siblings, 0 replies; 2+ messages in thread
From: tip-bot for David Ahern @ 2012-05-11 6:47 UTC (permalink / raw)
To: linux-tip-commits; +Cc: acme, linux-kernel, hpa, mingo, dsahern, tglx
Commit-ID: 40491eaa46a693e8c6ef94102350a747c63e584d
Gitweb: http://git.kernel.org/tip/40491eaa46a693e8c6ef94102350a747c63e584d
Author: David Ahern <dsahern@gmail.com>
AuthorDate: Tue, 8 May 2012 10:49:49 -0600
Committer: Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Wed, 9 May 2012 12:01:57 -0300
perf top: Update event name when falling back to cpu-clock
The 'perf top' command falls back to cpu-clock if the H/W cycles event
is not supported, but the event name is not updated leading to a
misleading header:
PerfTop: 8 irqs/sec kernel:75.0% exact: 0.0% [1000Hz cycles], ...
Update the event name when the event type is changed so that the
header displays correctly:
PerfTop: 794 irqs/sec kernel:100.0% exact: 0.0% [1000Hz cpu-clock], ...
Signed-off-by: David Ahern <dsahern@gmail.com>
Link: http://lkml.kernel.org/r/1336495789-58420-1-git-send-email-dsahern@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/builtin-top.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
index c53cdab..4eb6171 100644
--- a/tools/perf/builtin-top.c
+++ b/tools/perf/builtin-top.c
@@ -948,6 +948,10 @@ try_again:
attr->type = PERF_TYPE_SOFTWARE;
attr->config = PERF_COUNT_SW_CPU_CLOCK;
+ if (counter->name) {
+ free(counter->name);
+ counter->name = strdup(event_name(counter));
+ }
goto try_again;
}
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-05-11 6:48 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-08 16:49 [PATCH 1/2] perf top: update event name when falling back to cpu-clock David Ahern
2012-05-11 6:47 ` [tip:perf/core] perf top: Update " tip-bot for David Ahern
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome