public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [FEATURE REQUEST] tracing: Have event filters handle dynamic arrays
@ 2020-11-24 16:37 Steven Rostedt
  2020-11-25 15:16 ` Tom Zanussi
  0 siblings, 1 reply; 2+ messages in thread
From: Steven Rostedt @ 2020-11-24 16:37 UTC (permalink / raw)
  To: Tom Zanussi; +Cc: LKML, Daniel Wagner

Hi Tom,

Daniel asked about filtering bitmasks, something like:

   cpumask != 0xff

Looking into the code, I realized that bitmasks are dynamic arrays, and
there's no logic in the filter code to handle dynamic arrays of anything
other than 'char' type (which are dynamic strings).

If you have any cycles to spare, do you think you can add code to process
dynamic arrays other than char?

The compare logic may be complex though. I think the above example should
work, but we would need to define how that happens.

I guess we should follow the cpumask logic, and break all non string
dynamic arrays up into 32 bit words. Even if something is defined as u8, it
will be converted to the local endian of the machine. Basically, we should
follow the function bitmap_string() defined in lib/vsnprintf.c

If we have a u8 dynamic array of:

 0x12 0x34 0x56 0x78 0x9a 0xbc 0xde 0xf0

On a little endian machine it would match:

  0xf0debca9,0x78563412

This way, if we have a machine with 64 CPUS, and we want to match cpus 0-7,
then we only need to do:

  cpumask & 0xff

The above would be equivalent to:

 cpumask & 0,0xff

in such a case.

That's because, if I'm reading the code correctly, a cpumask for CPUs 0-7
bits set for 64 CPU machine in raw format would be:

 0x00 0x00 0x00 0xff 0x00 0x00 0x00 0x00

The dynamic arrays will allow comma separated 4 byte words to match.

Daniel brought this up, and he said he'd be willing to help out making a
patch if he has spare cycles to spare. Perhaps, between the two of you, you
could come up with the cycles to produce such a patch :-)

Cheers,

-- Steve

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-11-25 15:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-24 16:37 [FEATURE REQUEST] tracing: Have event filters handle dynamic arrays Steven Rostedt
2020-11-25 15:16 ` Tom Zanussi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox