lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Tue, 11 Jun 2024 12:54:40 -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 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.

> -	TP_printk("%d,%d %s (%s) %llu + %u [%d]",
> +	TP_printk("%d,%d %s (%s) %llu + %u %s,%u,%u [%d]",
>  		  MAJOR(__entry->dev), MINOR(__entry->dev),
>  		  __entry->rwbs, __get_str(cmd),
> -		  (unsigned long long)__entry->sector,
> -		  __entry->nr_sector, 0)
> +		  (unsigned long long)__entry->sector, __entry->nr_sector,
> +		  __print_symbolic(IOPRIO_PRIO_CLASS(__entry->ioprio),
> +				   IOPRIO_CLASS_STRINGS),
> +		  IOPRIO_PRIO_HINT(__entry->ioprio),
> +		  IOPRIO_PRIO_LEVEL(__entry->ioprio),  0)
>  );
>  

It's used for __print_symbolic() which the TRACE_EVENT() macro logic (using
header files) will expand it to something useful.

-- Steve

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ