From: sashiko-bot@kernel.org
To: "Sandipan Das" <sandipan.das@amd.com>
Cc: linux-perf-users@vger.kernel.org
Subject: Re: [PATCH 1/3] perf/x86: Add x86_pmu::print_debug
Date: Thu, 06 Aug 2026 10:24:07 +0000 [thread overview]
Message-ID: <20260806102408.4A8941F000E9@smtp.kernel.org> (raw)
In-Reply-To: <fc6ff612d26c2f5b0f015d9fac309cc58e913c1f.1786010408.git.sandipan.das@amd.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] The function `x86_pmu_print_debug` takes `cpu` as a parameter but also declares it as a local variable. This results in a compilation error due to the redefinition of the identifier in the same scope.
--
--- Patch [1]: [PATCH 1/3] perf/x86: Add x86_pmu::print_debug ---
commit 020114d6f9bb4628136240e2b9270b949589ab7b
Author: Sandipan Das <sandipan.das@amd.com>
perf/x86: Add x86_pmu::print_debug
This commit splits out the register dumping portion of
perf_event_print_debug() into a new x86_pmu_print_debug() helper. It
adds an optional print_debug method to x86_pmu to allow vendor-specific
PMUs to dump their global state.
> diff --git a/arch/x86/events/core.c b/arch/x86/events/core.c
> index d1af33d96d0a3..901a294d6e6cf 100644
> --- a/arch/x86/events/core.c
> +++ b/arch/x86/events/core.c
> @@ -1557,7 +1557,7 @@ static void x86_pmu_start(struct perf_event *event, int flags)
> perf_event_update_userpage(event);
> }
>
> -void perf_event_print_debug(void)
> +void x86_pmu_print_debug(int cpu)
> {
> u64 ctrl, status, overflow, pmc_ctrl, pmc_count, prev_left, fixed;
> unsigned long *cntr_mask, *fixed_cntr_mask;
> @@ -1566,17 +1566,11 @@ void perf_event_print_debug(void)
> u64 pebs, debugctl;
> int cpu, idx;
[Severity: Low]
Will this cause a compilation error? The x86_pmu_print_debug() function
now takes 'cpu' as a parameter, but the local variable declaration 'int cpu'
was left in place, which redefines the identifier in the same scope.
>
> - guard(irqsave)();
> -
> - cpu = smp_processor_id();
> cpuc = &per_cpu(cpu_hw_events, cpu);
--
Sashiko AI review · https://sashiko.dev/#/patchset/cover.1786010408.git.sandipan.das@amd.com?part=1
next prev parent reply other threads:[~2026-08-06 10:24 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-06 10:03 [PATCH 0/3] perf/x86: Fix perf_event_print_debug() on non-Intel PMUs Sandipan Das
2026-08-06 10:03 ` [PATCH 1/3] perf/x86: Add x86_pmu::print_debug Sandipan Das
2026-08-06 10:24 ` sashiko-bot [this message]
2026-08-06 10:03 ` [PATCH 2/3] perf/x86: Move MSR_CORE_PERF_GLOBAL_* dump to vendor code Sandipan Das
2026-08-06 10:03 ` [PATCH 3/3] perf/x86/amd: Implement x86_pmu::print_debug Sandipan Das
2026-08-06 15:44 ` Petr Tesarik
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=20260806102408.4A8941F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=sandipan.das@amd.com \
--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