Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

perf tests ftrace: Add pattern check for time, count

In 'perf ftrace profile sleep 0.1' we know that we'll have an specific
kernel function that will take a bit more than 0.1 seconds and will take
place just one time, so we can add a check for that so that we validate
more than just the presence of some functions in the profile.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Steven Rostedt (VMware) <rostedt@goodmis.org>
Link: https://lore.kernel.org/lkml/ZrTBo7KACZeuCyLj@x1
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

+5
+5
tools/perf/tests/shell/ftrace.sh
··· 72 72 grep sleep "${output}" 73 73 grep schedule "${output}" 74 74 grep execve "${output}" 75 + time_re="[[:space:]]+10[[:digit:]]{4}\.[[:digit:]]{3}" 76 + # 100283.000 100283.000 100283.000 1 __x64_sys_clock_nanosleep 77 + # Check for one *clock_nanosleep line with a Count of just 1 that takes a bit more than 0.1 seconds 78 + # Strip the _x64_sys part to work with other architectures 79 + grep -E "^${time_re}${time_re}${time_re}[[:space:]]+1[[:space:]]+.*clock_nanosleep" "${output}" 75 80 echo "perf ftrace profile test [Success]" 76 81 } 77 82