linux/tools/perf/tests/workloads/deterministic.c
James Clark 3fdf30607e perf test: Add deterministic workload
Add a workload that does the same thing every time for testing CPU trace
decoding.

Reviewed-by: Leo Yan <leo.yan@arm.com>
Signed-off-by: James Clark <james.clark@linaro.org>
Cc: Amir Ayupov <aaupov@meta.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Mike Leach <mike.leach@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paschalis Mpeis <Paschalis.Mpeis@arm.com>
Cc: Shuah Khan <skhan@linuxfoundation.org>
Cc: Suzuki Poulouse <suzuki.poulose@arm.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2026-06-10 18:55:48 -03:00

40 lines
522 B
C

// SPDX-License-Identifier: GPL-2.0
#include <linux/compiler.h>
#include "../tests.h"
int dt_work = 1234;
static void function1(void)
{
dt_work += 7;
dt_work += 7;
dt_work += 7;
}
static void function2(void)
{
dt_work += 7;
dt_work += 7;
dt_work += 7;
}
static int deterministic(int argc __maybe_unused,
const char **argv __maybe_unused)
{
dt_work += 7;
dt_work += 7;
dt_work += 7;
function1();
dt_work += 7;
dt_work += 7;
dt_work += 7;
function2();
return 0;
}
DEFINE_WORKLOAD(deterministic);