Re: [PATCH v1 06/58] perf util: Sort includes and add missed explicit dependencies

sashiko-bot
2026-04-20T00:20:55Z

Sashiko AI review found 1 potential issue(s):
- [Low] Inconsistent include path prefix cleanup for hashmap.h in stat-shadow.c.
--

commit e221e930350cab6bed86340ed82955a75d841278
Author: Ian Rogers <irogers@google.com>

perf util: Sort includes and add missed explicit dependencies

This commit adds missing includes found while cleaning up the evsel and
evlist header files. It also sorts the remaining header files across various
utilities for consistency with the rest of the code.

[ ... ]

> diff --git a/tools/perf/util/stat-shadow.c b/tools/perf/util/stat-shadow.c
> index bc2d44df7bafa..2f68f02dbc431 100644
> --- a/tools/perf/util/stat-shadow.c
> +++ b/tools/perf/util/stat-shadow.c
> @@ -2,20 +2,24 @@
> #include <errno.h>
> #include <math.h>
> #include <stdio.h>
> -#include "evsel.h"
> -#include "stat.h"
> +
> +#include <linux/zalloc.h>
> +
> +#include "cgroup.h"
> #include "color.h"
> #include "debug.h"
> -#include "pmu.h"
> -#include "rblist.h"
> #include "evlist.h"
> +#include "evsel.h"
> #include "expr.h"
> +#include "iostat.h"
> #include "metricgroup.h"
> -#include "cgroup.h"
> +#include "pmu.h"
> +#include "pmus.h"
> +#include "rblist.h"
> +#include "stat.h"
> +#include "tool_pmu.h"
> #include "units.h"
> -#include "iostat.h"
> #include "util/hashmap.h"

This isn't a bug, but I noticed the "util/" prefix was removed from
hashmap.h in other files like evsel.c and stat.c, while it remains here.

Should this be updated to just "hashmap.h" so it sorts correctly under 'h'
instead of 'u'?

> -#include "tool_pmu.h"
>
> static bool tool_pmu__is_time_event(const struct perf_stat_config *config,

--
Sashiko AI review · https://sashiko.dev/#/patchset/20260419235911.2186050-1-irogers@google.com?part=6