From: Bernd Schubert <bernd.schubert@fastmail.fm>
To: Josef Bacik <josef@toxicpanda.com>
Cc: miklos@szeredi.hu, linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH][RESEND] fuse: add simple request tracepoints
Date: Fri, 5 Jul 2024 17:02:46 +0200 [thread overview]
Message-ID: <cdcb7b08-d7c6-4efb-a27c-23c9dff1de9e@fastmail.fm> (raw)
In-Reply-To: <20240705145226.GA879955@perftesting>
On 7/5/24 16:52, Josef Bacik wrote:
> On Thu, Jul 04, 2024 at 07:20:16PM +0200, Bernd Schubert wrote:
>>
>>
>> On 7/3/24 16:38, Josef Bacik wrote:
>>> I've been timing various fuse operations and it's quite annoying to do
>>> with kprobes. Add two tracepoints for sending and ending fuse requests
>>> to make it easier to debug and time various operations.
>>
>> Thanks, this is super helpful.
>>
>> [...]
>>>
>>> + EM( FUSE_STATX, "FUSE_STATX") \
>>> + EMe(CUSE_INIT, "CUSE_INIT")
>>> +
>>> +/*
>>> + * This will turn the above table into TRACE_DEFINE_ENUM() for each of the
>>> + * entries.
>>> + */
>>> +#undef EM
>>> +#undef EMe
>>> +#define EM(a, b) TRACE_DEFINE_ENUM(a);
>>> +#define EMe(a, b) TRACE_DEFINE_ENUM(a);
>>
>>
>> I'm not super familiar with tracepoints and I'm a bit list why "EMe" is
>> needed
>> in addition to EM? CUSE_INIT is just another number?
>
> This is just obnoxious preprocessor abuse, so you're right this first iteration
> of EMe() is the same as EM(), but if you look right below that you have
>
> /* Now we redfine it with the table that __print_symbolic needs. */
> #undef EM
> #undef EMe
> #define EM(a, b) {a, b},
> #define EMe(a, b) {a, b}
>
> so later when we do
>
> __print_symbolic(__entry->opcode, OPCODES)
>
> OPCODES gets turned intoo
>
> __print_symbolic(__entry->opcode,
> {FUSE_LOOKUP, "FUSE_LOOKUP"},{...},{CUSE_INIT, "CUSE_INIT"})
>
> it's subtle and annoying, but the cleanest way to have these big opcode tables
> that are easy to add/remove stuff from for clean output. Thanks,
Ah, I had missed the comma difference, sorry for the noise!
Looks good and very useful to me (I'm also using it now).
Reviewed-by: Bernd Schubert <bschubert@ddn.com>
next prev parent reply other threads:[~2024-07-05 15:02 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-03 14:38 [PATCH][RESEND] fuse: add simple request tracepoints Josef Bacik
2024-07-04 17:20 ` Bernd Schubert
2024-07-05 14:52 ` Josef Bacik
2024-07-05 15:02 ` Bernd Schubert [this message]
2024-08-28 16:01 ` Miklos Szeredi
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=cdcb7b08-d7c6-4efb-a27c-23c9dff1de9e@fastmail.fm \
--to=bernd.schubert@fastmail.fm \
--cc=josef@toxicpanda.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=miklos@szeredi.hu \
/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).