From: Ilya Leoshkevich <iii@linux.ibm.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: linux-trace-devel@vger.kernel.org,
Heiko Carstens <hca@linux.ibm.com>,
Vasily Gorbik <gor@linux.ibm.com>,
Alexander Gordeev <agordeev@linux.ibm.com>
Subject: Re: [PATCH] libtracecmd: Support changing /proc/kallsyms
Date: Wed, 14 May 2025 09:51:16 +0200 [thread overview]
Message-ID: <bab0be078205af4c8d38e8211accc402ac6b6a4a.camel@linux.ibm.com> (raw)
In-Reply-To: <20250416231325.14113-1-iii@linux.ibm.com>
On Thu, 2025-04-17 at 01:13 +0200, Ilya Leoshkevich wrote:
> Running BPF selftests under trace-cmd intermittently fails with:
>
> error in size of file '/proc/kallsyms'
>
> This is because these selftests load and unload BPF programs.
> bpf_prog_put() uses workqueues and RCU, so these programs disappear
> from /proc/kallsyms after a delay.
>
> trace-cmd reads /proc/kallsyms twice: the first time to compute its
> size, and the second time to copy it into the trace file. If the
> resulting sizes don't match, which is what happens in this case,
> recording fails.
>
> Fix by first copying /proc/kallsyms into a temporary file, and then
> into the trace file. An alternative would be to read it into a
> malloc()-ed buffer, but this would increase trace-cmd memory usage,
> since /proc/kallsyms can be a few dozen megabytes large. In case
> /tmp is tmpfs, both solutions are almost equivalent.
>
> Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
> ---
> lib/trace-cmd/trace-output.c | 66 ++++++++++++++++++++++++++++------
> --
> 1 file changed, 52 insertions(+), 14 deletions(-)
Gentle ping.
next prev parent reply other threads:[~2025-05-14 7:51 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-16 23:13 [PATCH] libtracecmd: Support changing /proc/kallsyms Ilya Leoshkevich
2025-05-14 7:51 ` Ilya Leoshkevich [this message]
2025-05-14 13:45 ` Steven Rostedt
2025-05-30 20:45 ` Steven Rostedt
2025-06-02 15:05 ` Ilya Leoshkevich
2025-06-02 15:19 ` Steven Rostedt
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=bab0be078205af4c8d38e8211accc402ac6b6a4a.camel@linux.ibm.com \
--to=iii@linux.ibm.com \
--cc=agordeev@linux.ibm.com \
--cc=gor@linux.ibm.com \
--cc=hca@linux.ibm.com \
--cc=linux-trace-devel@vger.kernel.org \
--cc=rostedt@goodmis.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 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.