Messages in this thread | | | Date | Thu, 10 Jul 2014 00:20:38 +0200 | From | Jiri Olsa <> | Subject | Re: [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
| |