public inbox for linux-next@vger.kernel.org 
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis•org>
To: Bert Karwatzki <spasswolf@web•de>
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix•de>,
	linux-kernel@vger•kernel.org, linux-next@vger•kernel.org,
	bpf@vger•kernel.org, linux-rt-users@vger•kernel.org,
	linux-rt-devel@lists•linux.dev,
	Thomas Gleixner	 <tglx@linutronix•de>,
	Alexei Starovoitov <alexei.starovoitov@gmail•com>
Subject: Re: BUG: scheduling while atomic with PREEMPT_RT=y and bpf selftests
Date: Fri, 6 Jun 2025 09:57:12 -0400	[thread overview]
Message-ID: <20250606095712.7287fa31@gandalf.local.home> (raw)
In-Reply-To: <b86bd98b23d1299981c4e95b593eb5a144fbf822.camel@web.de>

On Fri, 06 Jun 2025 15:13:05 +0200
Bert Karwatzki <spasswolf@web•de> wrote:

> I tried this and first thought my kernel did not have the right configuration as
> 
> # trace-cmd record -e preempt_disable -e preempt_enable
> 
> seemed to do nothing in particular, but it turns out it takes a long time to start
> (~1min) when the kernel is compiled with CONFIG_LOCKDEP=y. (on the standard debian

Yeah, that's a recent regression in the code which I'm currently testing a
fix for:

   https://lore.kernel.org/linux-trace-kernel/20250605161701.35f7989a@gandalf.local.home


> kernel starting to record takes less time, but it does not have CONFIG_PREEMPT_TRACER.)
> 
> So after the trace-cmd was running I ran the bpf example and got a trace.dat:
> 
> # ls -lh trace.dat 
> -rw-r--r-- 1 root root 152M  6. Jun 14:41 trace.dat
> 
> turning this into a report with
> 
> # trace-cmd report > preemp_trace.rep
> 
> gives a rather unwieldly large file

Of course, it's recording every time preemption is enabled and disabled ;-)

I usually run it with a test:

 # trace-cmd record -e preempt_disable -e preempt_enable ./myprog

Where it will stop when ./myprog is done.

> 
> # ls -lh preempt_trace.rep 
> -rw-rw-r-- 1 root root 7,4G  6. Jun 14:46 preempt_trace.rep
> 
> This file has about 61 million lines
> 
> # wc -l preempt_trace.rep
> 61627360 preempt_trace.rep
> 
> but only 742104 corresponding to the bpf example program "test_progs"
> 
> # grep test_progs preempt_trace.rep | wc -l
> 742104

 # trace-cmd record -e preempt_disable -e preempt_enable -F ./test_progs

where "-F" means "follow" and will only record when "./test_progs" is running.
Add "-c" to also trace its children.

> 
> Is it possible to filter the preempt_{en,dis}able events by task name (i.e.
> get_current()->comm)?
> 
> I tried this (from https://code.tools/man/1/trace-cmd-report/) but it
> fails with an error message:
> # trace-cmd record -e preempt_enable -F '.*:COMM == "test_progs"' -e preempt_disable -F '.*:COMM == "test_progs"'

 -F means to execute. The -F in trace-cmd report is filter (that's because
 -f was already taken :-p)

-- Steve

> 
> ********************
>  Unable to exec .*:COMM == "test_progs"
> ********************
> trace-cmd: No such file or directory
>   Failed to exec .*:COMM == "test_progs"
> libtracecmd: No such file or directory
>   can not stat 'trace.dat.cpu0'
> 
> 
> Bert Karwatzki


  reply	other threads:[~2025-06-06 13:56 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-05  9:19 BUG: scheduling while atomic with PREEMPT_RT=y and bpf selftests Bert Karwatzki
2025-06-05 12:48 ` Steven Rostedt
2025-06-05 12:51   ` Sebastian Andrzej Siewior
2025-06-08  8:45     ` Bert Karwatzki
2025-06-08 15:53       ` Bert Karwatzki
2025-06-09 11:37         ` Bert Karwatzki
2025-06-14 12:01           ` Bert Karwatzki
2025-06-15 22:12             ` Bert Karwatzki
2025-06-16  6:28               ` Sebastian Andrzej Siewior
2025-06-06 13:13   ` Bert Karwatzki
2025-06-06 13:57     ` Steven Rostedt [this message]
  -- strict thread matches above, loose matches on Subject: below --
2025-05-25 22:47 Bert Karwatzki
2025-05-26  1:32 ` Alexei Starovoitov
2025-05-26  9:22   ` Bert Karwatzki
2025-05-27  7:19   ` Sebastian Andrzej Siewior
2025-05-25 12:14 Bert Karwatzki
2025-05-25 11:54 Bert Karwatzki

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=20250606095712.7287fa31@gandalf.local.home \
    --to=rostedt@goodmis$(echo .)org \
    --cc=alexei.starovoitov@gmail$(echo .)com \
    --cc=bigeasy@linutronix$(echo .)de \
    --cc=bpf@vger$(echo .)kernel.org \
    --cc=linux-kernel@vger$(echo .)kernel.org \
    --cc=linux-next@vger$(echo .)kernel.org \
    --cc=linux-rt-devel@lists$(echo .)linux.dev \
    --cc=linux-rt-users@vger$(echo .)kernel.org \
    --cc=spasswolf@web$(echo .)de \
    --cc=tglx@linutronix$(echo .)de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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