Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6880bbf9 authored by Arnaldo Carvalho de Melo's avatar Arnaldo Carvalho de Melo
Browse files

perf tests: Use perf_evlist__strerror_open() to provide hints about max_freq

Before:

  # perf test -v "code reading" 2>&1 | tail -4
  perf_evlist__open failed
  test child finished with -1
  ---- end ----
  Test object code reading: FAILED!
  #

After:

  # perf test -v "code reading" 2>&1 | tail -7
  perf_evlist__open() failed!
  Error: Invalid argument.
  Hint:  Check /proc/sys/kernel/perf_event_max_sample_rate.
  Hint:  The current value is 1000 and 4000 is being requested.
  test child finished with -1
  ---- end ----
  Test object code reading: FAILED!
  #

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Steven Noonan <steven@uplinklabs.net>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-ifbx7vmrc38loe6317owz2jx@git.kernel.org


Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent d9aade7f
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -559,7 +559,13 @@ static int do_test_code_reading(bool try_kcore)
				evlist = NULL;
				continue;
			}
			pr_debug("perf_evlist__open failed\n");

			if (verbose) {
				char errbuf[512];
				perf_evlist__strerror_open(evlist, errno, errbuf, sizeof(errbuf));
				pr_debug("perf_evlist__open() failed!\n%s\n", errbuf);
			}

			goto out_put;
		}
		break;