Re: [PATCH v5 02/58] perf arch arm: Sort includes and add missed explicit dependencies

sashiko-bot
2026-04-24T17:08:58Z

Sashiko AI review found 1 potential issue(s):
- [Low] The generic utility header `../../../util/cs-etm.h` is mistakenly placed at the very top of the file, while the actual local primary header `"cs-etm.h"` is relegated to the bottom.
--

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

perf arch arm: Sort includes and add missed explicit dependencies

This commit fixes missing includes found while cleaning header files and
sorts the remaining headers for consistency.

> diff --git a/tools/perf/arch/arm/util/cs-etm.c b/tools/perf/arch/arm/util/cs-etm.c
> index b7a839de870755..cdf8e3e6060670 100644
> --- a/tools/perf/arch/arm/util/cs-etm.c
> +++ b/tools/perf/arch/arm/util/cs-etm.c
> @@ -3,10 +3,13 @@
> * Copyright(C) 2015 Linaro Limited. All rights reserved.
> * Author: Mathieu Poirier <mathieu.poirier@linaro.org>
> */
> +#include "../../../util/cs-etm.h"

This isn't a bug, but standard practice dictates that a source file should
include its corresponding local header file first to guarantee that the header
is self-contained.

Was the generic utility header ../../../util/cs-etm.h mistakenly placed here
at the top instead of the local primary header "cs-etm.h" due to a name
collision?

[ ... ]

> #include "../../../util/session.h"
> -
> -#include <errno.h>
> -#include <stdlib.h>
> -#include <sys/stat.h>
> +#include "cs-etm.h"

The local primary header is relegated to the bottom here. Should "cs-etm.h"
be the one included at the very top instead?

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