[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140709222038.GL20938@krava.redhat.com>
Date: Thu, 10 Jul 2014 00:20:38 +0200
From: Jiri Olsa <jolsa@...hat.com>
To: Andi Kleen <andi@...stfloor.org>
Cc: linux-kernel@...r.kernel.org, namhyung@...nel.org,
acme@...radead.org, Andi Kleen <ak@...ux.intel.com>
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@...ux.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists