Re: [PATCH v6 2/9] perf c2c: add function view browser skeleton

[email protected] Mon, 03 Aug 2026 03:55:37 +0000
Newsgroups org.kernel.vger.linux-perf-users
Message-ID <[email protected]>
Thank you for your contribution! Sashiko AI review found 1 potential issue(=
s) to consider:
- [Medium] The c2c function browser incorrectly relies on the host-bound `a=
rch__compare_symbol_names` for cross-platform `perf.data` analysis.
--

--- Patch [2]: [PATCH v6 2/9] perf c2c: add function view browser skeleton =
---
commit 319d5bb2b85df1b9f28814f5dc315251c6aed01a
Author: Jiebin Sun <[email protected]>

perf c2c: add function view browser skeleton

Add the skeleton of the c2c function view: a new TUI browser in
tools/perf/ui/browsers/c2c-function.c reached by pressing TAB in the
cacheline view. This commit wires up the entry point, registers the file
in the build, and adds the TAB key handler and help text.

> diff --git a/tools/perf/ui/browsers/c2c-function.c b/tools/perf/ui/browse=
rs/c2c-function.c
> new file mode 100644
> index 0000000000000..c0fd7799e4f85
> --- /dev/null
> +++ b/tools/perf/ui/browsers/c2c-function.c
[ ... ]
> +static inline __maybe_unused bool symbol_name_equal(struct symbol *a, st=
ruct symbol *b)
> +{
> +	/* Two unknown symbols compare equal, matching cmp_null() in util/sort.=
c. */
> +	if (!a || !b)
> +		return a =3D=3D b;
> +	return arch__compare_symbol_names(a->name, b->name) =3D=3D 0;

[Severity: Medium]
Does this code rely on host-bound architecture logic for symbol comparison?

Looking at arch__compare_symbol_names(), it typically uses the host's
compilation rules rather than dynamically resolving symbol comparison based
on the target machine's architecture (e.g., via e_machine from perf_env).

When performing cross-platform profiling analysis, such as opening a perf.d=
ata
file generated on an architecture with specific symbol rules (like PowerPC)=
 on
a host with different rules (like x86), could this lead to the c2c analysis
failing to match symbols properly?

> +}

--=20
Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20260803035220.1720=
[email protected]?part=3D2