mirror of
https://github.com/S3NEO/android_kernel_samsung_msm8226.git
synced 2024-11-07 03:47:13 +00:00
Perf: Add event name to output
If PMU's are accessed by names, this patch will make 'perf stat' also output the name of the event along with the PMU name. Change-Id: If62b5eaf8340c94c797644389cfd5d937b7a5a25 Signed-off-by: Ashwin Chaugule <ashwinc@codeaurora.org>
This commit is contained in:
parent
e7183bb6e2
commit
3d0945d3f4
1 changed files with 5 additions and 2 deletions
|
@ -308,7 +308,7 @@ const char *__event_name(int type, u64 config, char *pmu_name)
|
||||||
{
|
{
|
||||||
static char buf[32];
|
static char buf[32];
|
||||||
|
|
||||||
if (type == PERF_TYPE_RAW) {
|
if (!pmu_name && type == PERF_TYPE_RAW) {
|
||||||
sprintf(buf, "raw 0x%" PRIx64, config);
|
sprintf(buf, "raw 0x%" PRIx64, config);
|
||||||
return buf;
|
return buf;
|
||||||
}
|
}
|
||||||
|
@ -684,6 +684,7 @@ int parse_events_add_pmu(struct list_head *list, int *idx,
|
||||||
{
|
{
|
||||||
struct perf_event_attr attr;
|
struct perf_event_attr attr;
|
||||||
struct perf_pmu *pmu;
|
struct perf_pmu *pmu;
|
||||||
|
char *ev_name;
|
||||||
|
|
||||||
pmu = perf_pmu__find(name);
|
pmu = perf_pmu__find(name);
|
||||||
if (!pmu)
|
if (!pmu)
|
||||||
|
@ -700,7 +701,9 @@ int parse_events_add_pmu(struct list_head *list, int *idx,
|
||||||
if (perf_pmu__config(pmu, &attr, head_config))
|
if (perf_pmu__config(pmu, &attr, head_config))
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
return add_event(list, idx, &attr, pmu->name);
|
ev_name = (char *) __event_name(attr.type, attr.config, pmu->name);
|
||||||
|
|
||||||
|
return add_event(list, idx, &attr, ev_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
void parse_events_update_lists(struct list_head *list_event,
|
void parse_events_update_lists(struct list_head *list_event,
|
||||||
|
|
Loading…
Reference in a new issue