Linux Perf Users
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Alireza Haghdoost" <haghdoost@uber.com>
Cc: linux-perf-users@vger.kernel.org
Subject: Re: [PATCH] perf symbols: Don't let a module's last symbol overlap the next module
Date: Mon, 28 Sep 2026 23:39:15 +0000	[thread overview]
Message-ID: <20260928233916.51CE51F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260928-haghdoost-perf-symbols-fixup-module-end-v1-1-0a70d1edd401@uber.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] perf: missing explicit <string.h> inclusion for strcmp
--

commit 4f103cd2e58d587c3ce270538dfd9a32b1e56fa8
Author: Alireza Haghdoost <haghdoost@uber.com>

perf symbols: Don't let a module's last symbol overlap the next module

symbols__fixup_end() extends a zero-size symbol that is the last one in
the kernel or in a module to the end of the next page. This patch clamps
the end to the next symbol's start so that lookups do not return the
wrong symbol. It also adds a test case to the Symbols suite to cover
these boundary cases.

> diff --git a/tools/perf/tests/symbols.c b/tools/perf/tests/symbols.c
> index c09e04f36035a..b644d95c6be9a 100644
> --- a/tools/perf/tests/symbols.c
> +++ b/tools/perf/tests/symbols.c
> @@ -2,6 +2,7 @@
>  #include <linux/compiler.h>
>  #include <linux/string.h>
>  #include <sys/mman.h>
> +#include <inttypes.h>
>  #include <limits.h>
>  #include "debug.h"
>  #include "dso.h"

[ ... ]

> +static int check_symbol(struct dso *dso, u64 addr, const char *name, u64 end)
> +{
> +	struct symbol *sym = dso__find_symbol_nocache(dso, addr);
> +
> +	if (!sym || strcmp(sym->name, name)) {

[Severity: Low]
Omitting the exact POSIX header <string.h> for strcmp() can cause musl libc
builds to fail, as musl enforces strict namespace separation without the
implicit inclusions common in glibc.

Does this new call to strcmp() in check_symbol() require an explicit include of
<string.h> at the top of tools/perf/tests/symbols.c?

> +		pr_debug("%#" PRIx64 ": expected %s, got %s\n", addr, name,
> +			 sym ? sym->name : "no symbol");
> +		return TEST_FAIL;
> +	}

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260928-haghdoost-perf-symbols-fixup-module-end-v1-1-0a70d1edd401@uber.com?part=1

  reply	other threads:[~2026-09-28 23:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-28 23:32 [PATCH] perf symbols: Don't let a module's last symbol overlap the next module Alireza Haghdoost via B4 Relay
2026-09-28 23:39 ` sashiko-bot [this message]
2026-09-29 17:55 ` Namhyung Kim
2026-09-29 20:46   ` Arnaldo Carvalho de Melo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260928233916.51CE51F000FF@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=haghdoost@uber.com \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox