From: Philippe Gerum <rpm@xenomai.org>
To: Florian Bezdeka <florian.bezdeka@siemens.com>
Cc: Andrew MacPherson <andrew@elk.audio>,
xenomai@lists.linux.dev, Gerte Hoogewerf <ghoogewerf@lmi3d.com>
Subject: Re: perf getting all-zeroes IP on STM32MP1
Date: Mon, 07 Sep 2026 14:41:30 +0200 [thread overview]
Message-ID: <87cxupgrnp.fsf@xenomai.org> (raw)
In-Reply-To: <dc1c6765187854e0758378af34098a64a8f7bf3b.camel@siemens.com> (Florian Bezdeka's message of "Mon, 07 Sep 2026 13:34:22 +0200")
Florian Bezdeka <florian.bezdeka@siemens.com> writes:
> On Mon, 2026-09-07 at 10:57 +0200, Andrew MacPherson wrote:
>> On Fri, 4 Sept 2026 at 16:08, Florian Bezdeka
>> <florian.bezdeka@siemens.com> wrote:
>> >
>> > Hi Andrew,
>> >
>> > [CC + Philippe]
>> >
>> > On Fri, 2026-09-04 at 15:26 +0200, Andrew MacPherson wrote:
>> > > Hello,
>> > >
>> > > We're working on an STM32MP1-based system running Xenomai and found
>> > > that perf top shows every symbol as "unknown [00000000]", i.e.
>> > > profiling is collecting samples, but they all point at address zero.
>> > >
>> > > I'm not a kernel developer but went through a few debug kernel builds
>> > > with an agent which eventually led to the attached patch. This change
>> > > does resolve the issue with perf, however I'm not sure if it's the
>> > > correct solution.
>> > >
>> > > The reasoning is that arm_arch_timer.c's percpu IRQ registration never
>> > > sets IRQF_TIMER, so Dovetail's copy_timer_regs() never populates
>> > > tick_regs, leaving get_irq_regs() to always return an all-zero
>> > > pt_regs, which in turn breaks perf's sample IP.
>> >
>> > Yep, that is wrong. The patch you provided looks OK to me. I'm just
>> > wondering if that should be addressed in Linux as well / first.
>> >
>> > @Philippe: Any additional thoughts? Should we take it already?
>> >
>> >
>> > @Andrew: Could you please provide a formal patch with proper signed-off
>> > and LLM notice (assuming agent means AI ;-)) targeting the dovetail 7.2.
>> > branch? That should help to speed things up. Thanks!
>> >
>> > Florian
>> >
>> > --
>> > Siemens AG, Foundational Technologies
>> > Linux Expert Center
>> >
>> >
>>
>> Hi Florian,
>>
>> I've submitted a patch now against dovetail 7.2, let me know if you
>> need anything else and thanks for the help!
>>
>>
>
> Thanks! We might consider merging that while working on a better
> solution - as suggested by Philippe.
>
Unfortunately, thinking a bit more/better, we'd still have an issue with
what I suggested. i.e. There are three contexts we need to care about in
this case:
1. when a timer tick can be immediately delivered to its handler
(i.e. hw irqs on) from a line tagged with IRQF_OOB.
2. when a timer tick can be immediately delivered (i.e. in-band stage is
installed) from a line set for in-band delivery (i.e. not tagged with
IRQF_OOB). In this case, the interrupt log is synchronized before
leaving handle_irq_pipelined_finish().
3. when a timer tick /should/ but cannot be delivered to the in-band stage
because the latter is stalled, i.e. need for deferral via the
interrupt log.
In the first two cases, postponing the copy logic to
clockevents_handle_event() would be ok, because the interrupt frame of
the timer event would still be active, therefore using get_irq_regs() to
find the regs to copy would be correct.
In case #3, we have a deferral, therefore the interrupt frame is
certainly gone when the in-band stage is unstalled. Since other
interrupts could happen in between, we are toast.
IOW, close, but no cigar. Back to the drawing board.
--
Philippe.
next prev parent reply other threads:[~2026-09-07 12:41 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-04 13:26 perf getting all-zeroes IP on STM32MP1 Andrew MacPherson
2026-09-04 14:08 ` Florian Bezdeka
2026-09-04 15:17 ` Philippe Gerum
2026-09-04 15:55 ` Florian Bezdeka
2026-09-05 9:16 ` Philippe Gerum
2026-09-07 8:57 ` Andrew MacPherson
2026-09-07 11:34 ` Florian Bezdeka
2026-09-07 12:03 ` Gerte Hoogewerf
2026-09-07 12:41 ` Philippe Gerum [this message]
2026-09-07 14:39 ` Florian Bezdeka
2026-09-07 15:00 ` Philippe Gerum
2026-09-08 8:02 ` Florian Bezdeka
2026-09-08 8:16 ` Philippe Gerum
2026-09-08 8:46 ` Florian Bezdeka
2026-09-09 8:21 ` Philippe Gerum
2026-09-09 8:29 ` Florian Bezdeka
2026-09-09 8:49 ` Philippe Gerum
2026-09-08 8:11 ` Philippe Gerum
2026-09-07 12:51 ` Andrew MacPherson
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=87cxupgrnp.fsf@xenomai.org \
--to=rpm@xenomai.org \
--cc=andrew@elk.audio \
--cc=florian.bezdeka@siemens.com \
--cc=ghoogewerf@lmi3d.com \
--cc=xenomai@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.