From: Steven Rostedt <rostedt@goodmis.org>
To: Peter Zijlstra <peterz@infradead.org>
Cc: kernel test robot <oliver.sang@intel.com>,
oe-lkp@lists.linux.dev, lkp@intel.com,
linux-kernel@vger.kernel.org, x86@kernel.org,
Ingo Molnar <mingo@kernel.org>,
linux-trace-kernel@vger.kernel.org
Subject: Re: [tip:sched/core] [tracing, hardirq] 9aedeaed6f: WARNING:suspicious_RCU_usage
Date: Thu, 19 Jan 2023 11:24:33 -0500 [thread overview]
Message-ID: <20230119112433.611fa273@gandalf.local.home> (raw)
In-Reply-To: <Y8llrdNT6RD/0dbq@hirez.programming.kicks-ass.net>
On Thu, 19 Jan 2023 16:45:49 +0100
Peter Zijlstra <peterz@infradead.org> wrote:
> Steve, what's the easiest way to figure out what triggers this? Put a
> printk() in prepare_ftrace_return() or so?
Does it only trigger if all functions are enabled when running function
graph tracer?
That is, if you just trace one function, say "schedule" does it
have an issue?
trace-cmd start -p function_graph -l schedule
And then run your code, and it doesn't trigger, but:
trace-cmd reset # make sure schedule is no longer filtered
trace-cmd start -p function_graph
does trigger the issue, you can then bisect the functions with the script:
scripts/tracing/ftrace-bisect.sh
in the kernel tree.
I need to update this script, because I've optimized it with the "number"
trick. That is, instead echoing in the names of functions, you echo in the
location of were they exist in the available_filter_functions file.
That is: echo 5 > set_ftrace_filter
Will enable the fifth function in available_filter_functions. The reason
for this is because this is an O(1) operation. And echoing in thousands of
these numbers is an O(n) operation where n is the number of functions you
echo in. But by doing it via names, its an O(n*m) operation, where m is the
number of *all* functions, and this can take several minutes to complete,
were as the "number" version usually takes less than a second.
Here's what you can do (ignore the instructions in the script, as that
needs to be updated):
# cd /sys/kernel/tracing
# seq `wc -l available_filter_functions | cut -d' ' -f1` > ~/full-file
# /path/to/ftrace-bisect ~/full-file ~/test-file ~/non-test-file
# cat ~/test-file > set_ftrace_filter
run your tests. If they don't fail (bisect good), then, you can assume that
the bad function is in ~/non-test-file
# /path/to/ftrace-bisect ~/non-test-file ~/test-file.1 ~/non-test-file.1
And repeat:
# cat ~/test-file.1 > set_ftrace_filter
I suggest appending the ".1", ".2", etc, in case something goes wrong and
you want to go back (basically a bisect log).
If the test fails, then you use the first file:
# /path/to/ftrace-bisect ~/test-file.1 ~/test-file.2 ~/non-test-file.2
Keep going until you find a single function that causes the issue.
Always cat the "test-file*" into the set_ftrace_filter.
If it works use the "non-test-file*" for the next iteration. If it fails,
use the "test-file*" for the next iteration.
-- Steve
next prev parent reply other threads:[~2023-01-19 16:25 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-19 14:06 [tip:sched/core] [tracing, hardirq] 9aedeaed6f: WARNING:suspicious_RCU_usage kernel test robot
2023-01-19 15:45 ` Peter Zijlstra
2023-01-19 16:24 ` Steven Rostedt [this message]
2023-01-20 9:51 ` Peter Zijlstra
2023-01-21 16:49 ` 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=20230119112433.611fa273@gandalf.local.home \
--to=rostedt@goodmis.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=lkp@intel.com \
--cc=mingo@kernel.org \
--cc=oe-lkp@lists.linux.dev \
--cc=oliver.sang@intel.com \
--cc=peterz@infradead.org \
--cc=x86@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).