perf stat: Refactor __run_perf_stat() common code
authorAdrián Herrera Arcila <adrian.herrera@arm.com>
Fri, 29 Jul 2022 16:12:43 +0000 (16:12 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 31 Dec 2022 12:14:33 +0000 (13:14 +0100)
commita273f1dd5d97092e564e49de37eefe37223b4218
tree58af6b722c95560ee722ad196497dcf18da8d682
parentd21534ab4fd7883e1c8037a76671d4e8b6ea14cb
perf stat: Refactor __run_perf_stat() common code

[ Upstream commit bb8bc52e75785af94b9ba079277547d50d018a52 ]

This extracts common code from the branches of the forks if-then-else.

enable_counters(), which was at the beginning of both branches of the
conditional, is now unconditional; evlist__start_workload() is extracted
to a different if, which enables making the common clocking code
unconditional.

Reviewed-by: Leo Yan <leo.yan@linaro.org>
Signed-off-by: Adrián Herrera Arcila <adrian.herrera@arm.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: James Clark <james.clark@arm.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Song Liu <songliubraving@fb.com>
Link: https://lore.kernel.org/r/20220729161244.10522-1-adrian.herrera@arm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Stable-dep-of: c587e77e100f ("perf stat: Do not delay the workload with --delay")
Signed-off-by: Sasha Levin <sashal@kernel.org>
tools/perf/builtin-stat.c