linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Linus Walleij <linus.walleij@linaro.org>
To: Tomislav Novak <tnovak@fb.com>
Cc: Will Deacon <will@kernel.org>,
	Russell King <linux@armlinux.org.uk>,
	 Mark Rutland <mark.rutland@arm.com>,
	 Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Jiri Olsa <jolsa@kernel.org>,  Namhyung Kim <namhyung@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	 Ingo Molnar <mingo@redhat.com>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	linux-arm-kernel@lists.infradead.org,
	 linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org,
	 Arnd Bergmann <arnd@arndb.de>
Subject: Re: [PATCH] ARM: perf: Fix stacktraces for tracepoint events in THUMB2 kernels
Date: Thu, 22 Sep 2022 10:57:11 +0200	[thread overview]
Message-ID: <CACRpkdZZFx3W3EHZh30FnQ+xH9ub_S7DZdGLJFQ_wBVN5EBVwA@mail.gmail.com> (raw)
In-Reply-To: <20220920230728.2617421-1-tnovak@fb.com>

On Wed, Sep 21, 2022 at 1:19 AM Tomislav Novak <tnovak@fb.com> wrote:

> Store the frame address where arm_get_current_stackframe() looks for it
> (ARM_r7 instead of ARM_fp if CONFIG_THUMB2_KERNEL=y). Otherwise frame->fp
> gets set to 0, causing unwind_frame() to fail.
>
>   # bpftrace -e 't:sched:sched_switch { @[kstack] = count(); exit(); }'
>   Attaching 1 probe...
>   @[
>       __schedule+1059
>   ]: 1
>
> A typical first unwind instruction is 0x97 (SP = R7), so after executing
> it SP ends up being 0 and -URC_FAILURE is returned.
>
>   unwind_frame(pc = ac9da7d7 lr = 00000000 sp = c69bdda0 fp = 00000000)
>   unwind_find_idx(ac9da7d7)
>   unwind_exec_insn: insn = 00000097
>   unwind_exec_insn: fp = 00000000 sp = 00000000 lr = 00000000 pc = 00000000
>
> With this patch:
>
>   # bpftrace -e 't:sched:sched_switch { @[kstack] = count(); exit(); }'
>   Attaching 1 probe...
>   @[
>       __schedule+1059
>       __schedule+1059
>       schedule+79
>       schedule_hrtimeout_range_clock+163
>       schedule_hrtimeout_range+17
>       ep_poll+471
>       SyS_epoll_wait+111
>       sys_epoll_pwait+231
>       __ret_fast_syscall+1
>   ]: 1
>
> Signed-off-by: Tomislav Novak <tnovak@fb.com>

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Can you put this patch into Russell's patch tracker please?
https://www.armlinux.org.uk/developer/patches/

BTW: what is this interesting CONFIG_THUMB2_KERNEL target
that Facebook/Meta is working on? (It's OK if you can't tell, just
curious.)

Yours,
Linus Walleij

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2022-09-22  9:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-20 23:07 [PATCH] ARM: perf: Fix stacktraces for tracepoint events in THUMB2 kernels Tomislav Novak
2022-09-22  8:57 ` Linus Walleij [this message]
2022-09-23 15:05   ` Tomislav Novak
2022-10-03 21:56     ` Linus Walleij

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=CACRpkdZZFx3W3EHZh30FnQ+xH9ub_S7DZdGLJFQ_wBVN5EBVwA@mail.gmail.com \
    --to=linus.walleij@linaro.org \
    --cc=acme@kernel.org \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=arnd@arndb.de \
    --cc=jolsa@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=tnovak@fb.com \
    --cc=will@kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).