lkml.org 
[lkml]   [2014]   [Jul]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 8/9] perf, tools, test: Add test case for alias and JSON parsing v2
On Fri, Jun 27, 2014 at 04:16:03PM -0700, Andi Kleen wrote:
> From: Andi Kleen <ak@linux.intel.com>
>
> Add a simple test case to perf test that runs perf download and parses
> all the available events, including json events.
>
> This needs adding an all event iterator to pmu.c
>

SNIP

> +
> +int pmu_iterate_events(int (*func)(const char *name))
> +{
> + int ret = 0;
> + struct perf_pmu *pmu;
> + struct perf_pmu_alias *alias;
> +
> + perf_pmu__find("cpu"); /* Load PMUs */
> + pmu = NULL;
> + while ((pmu = perf_pmu__scan(pmu)) != NULL) {
> + list_for_each_entry(alias, &pmu->aliases, list) {
> + ret = func(alias->name);
> + if (ret != 0)
> + break;
> + }
> + }
> + return ret;
> +}
> diff --git a/tools/perf/util/pmu.h b/tools/perf/util/pmu.h
> index 583d21e..a8ed283 100644
> --- a/tools/perf/util/pmu.h
> +++ b/tools/perf/util/pmu.h
> @@ -47,5 +47,7 @@ bool pmu_have_event(const char *pname, const char *name);
>
> int perf_pmu__test(void);
>
> +int pmu_iterate_events(int (*func)(const char *name));
> +

this new pmu interface needs to go to separated patchset

jirka


\
 
 \ /
  Last update: 2014-07-10 09:41    [W:0.317 / U:0.048 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site