diff options
| author | Swapnil Sapkal <swapnil.sapkal@amd.com> | 2026-01-19 17:58:26 +0000 |
|---|---|---|
| committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2026-01-22 12:30:16 -0300 |
| commit | 55657d7ac8caa98c7c0ef241bf64e176db899b4d (patch) | |
| tree | 085da7b687727b1882e89b9d5d623faf1d23e6b6 /tools/perf | |
| parent | c3030995f23b3d35f94b9bc4375706ec5916fd55 (diff) | |
perf sched stats: Add schedstat v16 support
The /proc/schedstat file output is standardized with version number.
Add support to record and raw dump v16 version layout.
Version 16 of schedstats changed the order of definitions within 'enum
cpu_idle_type', which changed the order of [CPU_MAX_IDLE_TYPES] columns
in show_schedstat().
In particular the position of CPU_IDLE and __CPU_NOT_IDLE changed
places.
Co-developed-by: Ravi Bangoria <ravi.bangoria@amd.com>
Signed-off-by: Ravi Bangoria <ravi.bangoria@amd.com>
Signed-off-by: Swapnil Sapkal <swapnil.sapkal@amd.com>
Tested-by: Chen Yu <yu.c.chen@intel.com>
Tested-by: James Clark <james.clark@linaro.org>
Acked-by: Ian Rogers <irogers@google.com>
Acked-by: Peter Zijlstra <peterz@infradead.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Anubhav Shelat <ashelat@redhat.com>
Cc: Ben Gainey <ben.gainey@arm.com>
Cc: Blake Jones <blakejones@google.com>
Cc: Chun-Tse Shao <ctshao@google.com>
Cc: David Vernet <void@manifault.com>
Cc: Dmitriy Vyukov <dvyukov@google.com>
Cc: Dr. David Alan Gilbert <linux@treblig.org>
Cc: Gautham Shenoy <gautham.shenoy@amd.com>
Cc: Graham Woodward <graham.woodward@arm.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: James Clark <james.clark@arm.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Juri Lelli <juri.lelli@redhat.com>
Cc: K Prateek Nayak <kprateek.nayak@amd.com>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Leo Yan <leo.yan@arm.com>
Cc: Madadi Vineeth Reddy <vineethr@linux.ibm.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Sandipan Das <sandipan.das@amd.com>
Cc: Santosh Shukla <santosh.shukla@amd.com>
Cc: Shrikanth Hegde <sshegde@linux.ibm.com>
Cc: Steven Rostedt (VMware) <rostedt@goodmis.org>
Cc: Tejun Heo <tj@kernel.org>
Cc: Thomas Falcon <thomas.falcon@intel.com>
Cc: Tim Chen <tim.c.chen@linux.intel.com>
Cc: Vincent Guittot <vincent.guittot@linaro.org>
Cc: Yang Jihong <yangjihong@bytedance.com>
Cc: Yujie Liu <yujie.liu@intel.com>
Cc: Zhongqiu Han <quic_zhonhan@quicinc.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf')
| -rw-r--r-- | tools/perf/util/event.c | 6 | ||||
| -rw-r--r-- | tools/perf/util/synthetic-events.c | 6 |
2 files changed, 12 insertions, 0 deletions
diff --git a/tools/perf/util/event.c b/tools/perf/util/event.c index 5a98c16e1092..730021cec161 100644 --- a/tools/perf/util/event.c +++ b/tools/perf/util/event.c @@ -585,6 +585,9 @@ size_t perf_event__fprintf_schedstat_cpu(union perf_event *event, FILE *fp) if (version == 15) { #include <perf/schedstat-v15.h> return size; + } else if (version == 16) { +#include <perf/schedstat-v16.h> + return size; } #undef CPU_FIELD @@ -604,6 +607,9 @@ size_t perf_event__fprintf_schedstat_domain(union perf_event *event, FILE *fp) if (version == 15) { #include <perf/schedstat-v15.h> return size; + } else if (version == 16) { +#include <perf/schedstat-v16.h> + return size; } #undef DOMAIN_FIELD diff --git a/tools/perf/util/synthetic-events.c b/tools/perf/util/synthetic-events.c index 5366ea921e70..4ce37357db05 100644 --- a/tools/perf/util/synthetic-events.c +++ b/tools/perf/util/synthetic-events.c @@ -2567,6 +2567,8 @@ static union perf_event *__synthesize_schedstat_cpu(struct io *io, __u16 version if (version == 15) { #include <perf/schedstat-v15.h> + } else if (version == 16) { +#include <perf/schedstat-v16.h> } #undef CPU_FIELD @@ -2620,6 +2622,8 @@ static union perf_event *__synthesize_schedstat_domain(struct io *io, __u16 vers if (version == 15) { #include <perf/schedstat-v15.h> + } else if (version == 16) { +#include <perf/schedstat-v16.h> } #undef DOMAIN_FIELD @@ -2661,6 +2665,8 @@ int perf_event__synthesize_schedstat(const struct perf_tool *tool, if (!strcmp(line, "version 15\n")) { version = 15; + } else if (!strcmp(line, "version 16\n")) { + version = 16; } else { pr_err("Unsupported %s version: %s", path, line + 8); goto out_free_line; |
