From: Dave Chinner <david@fromorbit.com>
To: Qu Wenruo <wqu@suse.com>
Cc: fstests@vger.kernel.org
Subject: Re: [PATCH v2] fstests: add basic ftrace support
Date: Sat, 5 Jun 2021 08:44:24 +1000 [thread overview]
Message-ID: <20210604224424.GB2068689@dread.disaster.area> (raw)
In-Reply-To: <af48b9a5-9f94-5b57-7115-e802faf50886@suse.com>
On Fri, Jun 04, 2021 at 10:45:52AM +0800, Qu Wenruo wrote:
> > So how does one enable all 500+ xfs tracepoints for this? Or just
> > some subset? i.e. how do we pass it a list of events like we do
> > trace-cmd? IOWs, for this to be actually useful as a replacement
> > for trace-cmd, it has to be able to replace invocations like this:
> >
> > # trace-cmd record -e xfs_i*lock* -e xfs_buf* -e printk -e iomap* ....
>
> That's not a big problem, you can do the same thing just using tracefs
> interface, without invovling trace-cmd at all.
>
> For your above case, you can do the same thing without trace_cmd at all:
>
> # cat ${tracefs}/available_events | grep xfs_i*lock >> \
> ${tracefs}/set_event
> # cat ${tracefs}/available_events | grep xfs_buf* >> \
> ${tracefs}/set_event
> # cat ${tracefs}/available_events | grep iomap* >> \
> ${tracefs}/set_event
> # cat ${tracefs}/available_events | grep printk >> \
> ${tracefs}/set_event
....
You forgot that now I have to turn all the events off again
manually. And if the script crashes and doesn't clean up, then I've
got to do that manually.
Talk about going back to the dark ages....
> I mean, if you can use trace-cmd, I see now reason you can't pack your trace
> events into a small script to enable it before running the tests.
The whole point of using tools like perf and trace-cmd is so we
don't need to know how the underlying mechanisms work, and we don't
have to relearn this crap every time the developers decide they are
going to change how it works.
> Or is trace-cmd really making us forget how to manually setup ftrace
> evetnts?
You have got to be joking, right?
The whole point of trace-cmd and perf existing is so that nobody
except the developers of those tools need to know how the complex,
obscure, whacky low level kernel interfaces work. Nor do people have
to keep up with how they change from kernel to kernel, because the
tools abstract all this bullshit away from the user.
I forgot about that interface when trace-cmd was first written
(2009, IIRC). IOWs, I haven't used the low level tracing interfaces
at all for over a decade because it's an utter PITA to use.
Can you imaging saying to another developer "we don't need a mkfs
command because I can write the structures direct to the block
device myself!". It doesn't make much sense, does it? Yet that's
pretty much exactly what you are saying here....
So, no, I don't think poking at low level tracing interfaces inside
fstests is a good idea, especially as it also requires wrapping
fstests in more scripts to control it. Just use trace-cmd to control
trace recording like everyone else already does.
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
prev parent reply other threads:[~2021-06-04 22:44 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-03 6:21 [PATCH v2] fstests: add basic ftrace support Qu Wenruo
2021-06-04 2:35 ` Dave Chinner
2021-06-04 2:45 ` Qu Wenruo
2021-06-04 16:30 ` Darrick J. Wong
2021-06-04 22:44 ` Dave Chinner [this message]
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=20210604224424.GB2068689@dread.disaster.area \
--to=david@fromorbit.com \
--cc=fstests@vger.kernel.org \
--cc=wqu@suse.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