[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240611131737.564b6655@gandalf.local.home>
Date: Tue, 11 Jun 2024 13:17:37 -0400
From: Steven Rostedt <rostedt@...dmis.org>
To: Bart Van Assche <bvanassche@....org>
Cc: Dongliang Cui <dongliang.cui@...soc.com>, axboe@...nel.dk,
mhiramat@...nel.org, mathieu.desnoyers@...icios.com, ebiggers@...nel.org,
ke.wang@...soc.com, hongyu.jin.cn@...il.com, niuzhiguo84@...il.com,
hao_hao.wang@...soc.com, linux-block@...r.kernel.org,
linux-kernel@...r.kernel.org, akailash@...gle.com,
cuidongliang390@...il.com
Subject: Re: [PATCH v4] block: Add ioprio to block_rq tracepoint
On Tue, 11 Jun 2024 10:09:12 -0700
Bart Van Assche <bvanassche@....org> wrote:
> On 6/11/24 9:54 AM, Steven Rostedt wrote:
> > On Tue, 11 Jun 2024 09:26:54 -0700
> > Bart Van Assche <bvanassche@....org> wrote:
> >
> >> On 6/11/24 12:35 AM, Dongliang Cui wrote:
> >>> +#define IOPRIO_CLASS_STRINGS \
> >>> + { IOPRIO_CLASS_NONE, "none" }, \
> >>> + { IOPRIO_CLASS_RT, "rt" }, \
> >>> + { IOPRIO_CLASS_BE, "be" }, \
> >>> + { IOPRIO_CLASS_IDLE, "idle" }, \
> >>> + { IOPRIO_CLASS_INVALID, "invalid"}
> >>
> >> Shouldn't this array be defined in a C file instead of in a header file?
> >
> > The way the TRACE_EVENT() macro works, this will not work in a C file.
>
> Hmm ... if the above array is terminated with a { -1, NULL } sentinel and if
> __print_symbolic() is changed into trace_print_symbols_seq(p, ...) then the above
> array can be moved into a C file, isn't it?
>
Then it breaks user space parsing. The reason for __print_symbolic() is
that libtraceevent knows how to parse it. If you put the array into a C
file, the above mappings will not show up in the tracefs format file for
the event, and you'll just get "[FAILED TO PARSE]" output from the user
space tracing tooling.
-- Steve
Powered by blists - more mailing lists