From: Steven Rostedt <rostedt@goodmis.org>
To: Andy Chiu <andybnac@gmail.com>
Cc: linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org,
mark.rutland@arm.com, mhiramat@kernel.org,
mathieu.desnoyers@efficios.com, bjorn@rivosinc.com,
puranjay12@gmail.com, alexghiti@rivosinc.com,
paul.walmsley@sifive.com, greentime.hu@sifive.com,
nick.hu@sifive.com, nylon.chen@sifive.com, eric.lin@sifive.com,
vincent.chen@sifive.com, zong.li@sifive.com,
yongxuan.wang@sifive.com, samuel.holland@sifive.com,
olivia.chu@sifive.com, c2232430@gmail.com
Subject: Re: [PATCH v2] ftrace: properly merge notrace hash
Date: Tue, 8 Apr 2025 12:33:06 -0400 [thread overview]
Message-ID: <20250408123306.5477f30c@gandalf.local.home> (raw)
In-Reply-To: <20250408160258.48563-1-andybnac@gmail.com>
On Wed, 9 Apr 2025 00:02:57 +0800
Andy Chiu <andybnac@gmail.com> wrote:
> The global notrace hash should be jointly decided by the intersection of
> each subops's notrace hash, but not the filter hash.
>
> Fixes: 5fccc7552ccb ("ftrace: Add subops logic to allow one ops to manage many")
> Signed-off-by: Andy Chiu <andybnac@gmail.com>
>
Thanks.
I'll apply this (currently testing it along with other fixes), but I
realized that this isn't working as expected.
I did the following:
# trace-cmd start -B foo -p function_graph -l '*lock*' -n '*clock*'
# trace-cmd start -B bar -p function_graph -l '*sched*' -n '*time*'
And then looked at:
# cat /sys/kernel/tracing/enabled_functions |grep clock | wc -l
176
# cat /sys/kernel/tracing/enabled_functions |grep time | wc -l
37
Which means those functions are still having callbacks even though nothing
is tracing them.
What needs to be done is to filter out the filter ops from the notrace ops
before adding them to the main ops.
The main ops shouldn't need any notrace hash unless all the subops hashes
are the empty set.
What needs to be done when adding a new subops is to:
Copy subops filter hash:
If subops filter hash is not empty:
1) Remove all the nohash functions from the copy.
2) If the main ops notrace hash is not empty, remove any of the functions
in the copy from it.
If subops filter hash is empty
1) intersect the notrace ops with the current notrace ops
I'll write up a patch on top of this one.
-- Steve
next prev parent reply other threads:[~2025-04-08 16:31 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-08 16:02 [PATCH v2] ftrace: properly merge notrace hash Andy Chiu
2025-04-08 16:33 ` Steven Rostedt [this message]
2025-04-08 18:03 ` 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=20250408123306.5477f30c@gandalf.local.home \
--to=rostedt@goodmis.org \
--cc=alexghiti@rivosinc.com \
--cc=andybnac@gmail.com \
--cc=bjorn@rivosinc.com \
--cc=c2232430@gmail.com \
--cc=eric.lin@sifive.com \
--cc=greentime.hu@sifive.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mathieu.desnoyers@efficios.com \
--cc=mhiramat@kernel.org \
--cc=nick.hu@sifive.com \
--cc=nylon.chen@sifive.com \
--cc=olivia.chu@sifive.com \
--cc=paul.walmsley@sifive.com \
--cc=puranjay12@gmail.com \
--cc=samuel.holland@sifive.com \
--cc=vincent.chen@sifive.com \
--cc=yongxuan.wang@sifive.com \
--cc=zong.li@sifive.com \
/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