On Fri, Jun 27, 2014 at 04:16:03PM -0700, Andi Kleen wrote:
> From: Andi Kleen <[email protected]>
> 
> 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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to