[1/2] perf test: Use generic event for expand_libpfm_events()
diff mbox series

Message ID 20201024025918.453431-1-namhyung@kernel.org
State New, archived
Headers show
Series
  • [1/2] perf test: Use generic event for expand_libpfm_events()
Related show

Commit Message

Namhyung Kim Oct. 24, 2020, 2:59 a.m. UTC
I found that the UNHALTED_CORE_CYCLES event is only available in the
Intel machines and it makes other vendors/archs fail on the test.  As
libpfm4 can parse the generic events like cycles, let's use them.

Fixes: 40b74c30ffb9 ("perf test: Add expand cgroup event test")
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
 tools/perf/tests/expand-cgroup.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Andi Kleen Oct. 25, 2020, 5:30 a.m. UTC | #1
On Sat, Oct 24, 2020 at 11:59:17AM +0900, Namhyung Kim wrote:
> I found that the UNHALTED_CORE_CYCLES event is only available in the
> Intel machines and it makes other vendors/archs fail on the test.  As
> libpfm4 can parse the generic events like cycles, let's use them.
> 
> Fixes: 40b74c30ffb9 ("perf test: Add expand cgroup event test")
> Signed-off-by: Namhyung Kim <namhyung@kernel.org>

So would the test still fail when libpfm is not compiled in?

-Andi
Ian Rogers Oct. 26, 2020, 3:40 p.m. UTC | #2
On Fri, Oct 23, 2020 at 7:59 PM Namhyung Kim <namhyung@kernel.org> wrote:
>
> I found that the UNHALTED_CORE_CYCLES event is only available in the
> Intel machines and it makes other vendors/archs fail on the test.  As
> libpfm4 can parse the generic events like cycles, let's use them.
>
> Fixes: 40b74c30ffb9 ("perf test: Add expand cgroup event test")
> Signed-off-by: Namhyung Kim <namhyung@kernel.org>

Acked-by: Ian Rogers <irogers@google.com>

Thanks,
Ian

> ---
>  tools/perf/tests/expand-cgroup.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/perf/tests/expand-cgroup.c b/tools/perf/tests/expand-cgroup.c
> index d5771e4d094f..4c59f3ae438f 100644
> --- a/tools/perf/tests/expand-cgroup.c
> +++ b/tools/perf/tests/expand-cgroup.c
> @@ -145,7 +145,7 @@ static int expand_libpfm_events(void)
>         int ret;
>         struct evlist *evlist;
>         struct rblist metric_events;
> -       const char event_str[] = "UNHALTED_CORE_CYCLES";
> +       const char event_str[] = "CYCLES";
>         struct option opt = {
>                 .value = &evlist,
>         };
> --
> 2.29.0.rc1.297.gfa9743e501-goog
>

Patch
diff mbox series

diff --git a/tools/perf/tests/expand-cgroup.c b/tools/perf/tests/expand-cgroup.c
index d5771e4d094f..4c59f3ae438f 100644
--- a/tools/perf/tests/expand-cgroup.c
+++ b/tools/perf/tests/expand-cgroup.c
@@ -145,7 +145,7 @@  static int expand_libpfm_events(void)
 	int ret;
 	struct evlist *evlist;
 	struct rblist metric_events;
-	const char event_str[] = "UNHALTED_CORE_CYCLES";
+	const char event_str[] = "CYCLES";
 	struct option opt = {
 		.value = &evlist,
 	};