Commit 439dbef2 authored by Namhyung Kim's avatar Namhyung Kim Committed by Arnaldo Carvalho de Melo
Browse files

perf test: Do not use instructions:u explicitly



I think it's to support non-root user tests.  But perf record can handle
the case and fall back to a software event (cpu-clock).  Practically this
would affect when it's run on a VM, but it seems no reason to prevent running
the test in the guest.

Reviewed-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
Acked-by: default avatarIan Rogers <irogers@google.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: https://lore.kernel.org/r/20221020172643.3458767-2-namhyung@kernel.org


Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent ad7ad6b5
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -21,18 +21,18 @@ trap trap_cleanup exit term int

test_per_thread() {
  echo "Basic --per-thread mode test"
  if ! perf record -e instructions:u -o ${perfdata} --quiet true 2> /dev/null
  if ! perf record -o /dev/null --quiet true 2> /dev/null
  then
    echo "Per-thread record [Skipped instructions:u not supported]"
    echo "Per-thread record [Skipped event not supported]"
    if [ $err -ne 1 ]
    then
      err=2
    fi
    return
  fi
  if ! perf record -e instructions:u --per-thread -o ${perfdata} true 2> /dev/null
  if ! perf record --per-thread -o ${perfdata} true 2> /dev/null
  then
    echo "Per-thread record of instructions:u [Failed]"
    echo "Per-thread record [Failed record]"
    err=1
    return
  fi
@@ -49,7 +49,7 @@ test_register_capture() {
  echo "Register capture test"
  if ! perf list | egrep -q 'br_inst_retired.near_call'
  then
    echo "Register capture test [Skipped missing instruction]"
    echo "Register capture test [Skipped missing event]"
    if [ $err -ne 1 ]
    then
      err=2