From: Nick Alcock <nick.alcock@oracle.com>
To: Eugene Loh <eugene.loh@oracle.com>
Cc: dtrace@lists.linux.dev, dtrace-devel@oss.oracle.com
Subject: Re: [PATCH] Allow arbitrary tracefs mount points
Date: Fri, 08 Nov 2024 14:12:28 +0000 [thread overview]
Message-ID: <87ed3l7r1v.fsf@esperi.org.uk> (raw)
In-Reply-To: <09b50c9d-f2b5-8284-53e1-2050afe4421a@oracle.com> (Eugene Loh's message of "Wed, 6 Nov 2024 20:14:16 -0500")
On 7 Nov 2024, Eugene Loh stated:
> The whole thing with dtp->dt_tracefs_file is... interesting. We store a temporary string in dtp-> just (if I understand correctly)
> to simplify its free. It's kind of a cool trick but also kind of ugly. We'll see what Kris says.
Yep! To massively reduce the amount of noise this patch produces. (This
is what torpedoed every previous attempt of mine to do this.)
I stole the idea from libctf, which does something similar (and did even
in the Solaris days) in ctf_lookup_by_name()...
It works until you think you can call tracefs_file() twice in the same
function call, but honestly if that happens the flames will be immediate
and you'll spot it in no time (and so will the valgrind runs we
sometimes do).
> In dt_prov_dtrace.c attach():
>
> *) We should convert "len=snprintf(NULL, 0, ...); snprintf(fn, len, ...)" into asprintf() for the format file name. I realize that
> in some sense that is "beyond the scope of this patch," but it seems like we've used a couple of patches recently an an opportunity
> to fix this sort of thing.
Yeah, that niggled at me but I left it explicitly because I thought
people might think it was a bridge too far. Will change.
There was one other place with a [256] static array which I flipped to a
PATH_MAX in lieu of doing something more dynamic.
> *) Using the variable uprobe_events first for "uprobe_events" and later for "events" seems confusing. At the very least, how about
> naming uprobe_events to be something more generic.
Agreed. Renamed to "tmp_path" which at least makes it clear that all
that's really consistent about this variable is that it's a path and
it's temporary.
> On 11/6/24 11:46, Nick Alcock wrote:
>> So as of kernel 6.3 (upstream commit 2455f0e124d317dd08d337a75), the
>> canonical tracefs location has moved to /sys/kernel/tracing. Unfortunately
>> this requires an explicit mount, and a great many installations have not
>> done this and perhaps never will. So if the debugfs is mounted on
>> /sys/kernel/debug, it automatically makes /sys/kernel/debug/tracing appear
>> as it used to, as another tracefs mount. And of course there's nothing
>> special about the "canonical location": it's up to the admin, who might
>> choose to remount the thing anywhere at all.
>
> Anywhere at all? But the scripts in test/ only look in two places.
Yeah, I didn't fix the tests the same way.
> Speaking of which, could runtest.sh look for TRACEFS and then make that available to any test script that needs it?
... in /proc/mounts? I suppose so! I'll have a go.
--
NULL && (void)
next prev parent reply other threads:[~2024-11-08 14:12 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-06 16:46 [PATCH] Allow arbitrary tracefs mount points Nick Alcock
2024-11-07 1:14 ` Eugene Loh
2024-11-08 14:12 ` Nick Alcock [this message]
2024-11-07 18:16 ` [DTrace-devel] " Kris Van Hees
2024-11-11 12:46 ` Nick Alcock
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=87ed3l7r1v.fsf@esperi.org.uk \
--to=nick.alcock@oracle.com \
--cc=dtrace-devel@oss.oracle.com \
--cc=dtrace@lists.linux.dev \
--cc=eugene.loh@oracle.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