original_kernel/samples
Steven Rostedt (VMware) 883b4aee4d tracing: Add trace_event helper macros __string_len() and __assign_str_len()
There's a few cases that a string that is to be recorded in a trace event,
does not have a terminating 'nul' character, and instead, the tracepoint
passes in the length of the string to record.

Add two helper macros to the trace event code that lets this work easier,
than tricks with "%.*s" logic.

  __string_len() which is similar to __string() for declaration, but takes a
                 length argument.

  __assign_str_len() which is similar to __assign_str() for assiging the
                 string, but it too takes a length argument.

Note, the TRACE_EVENT() macro will allocate the location on the ring
buffer to 'len + 1', that will be used to store the string into. It is a
requirement that the 'len' used for this is a most the length of the
string being recorded.

This string can still use __get_str() just like strings created with
__string() can use to retrieve the string.

Link: https://lore.kernel.org/linux-nfs/20210513105018.7539996a@gandalf.local.home/

Tested-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2021-08-17 11:47:52 -04:00
..
acrn
auxdisplay
binderfs
bpf bpf, samples: Fix xdpsock with '-M' parameter missing unload process 2021-07-05 23:34:18 +02:00
configfs
connector
ftrace
hidraw
hw_breakpoint
kdb
kfifo
kmemleak
kobject
kprobes This was a reasonably active cycle for documentation; this pull includes: 2021-06-28 16:53:05 -07:00
landlock
livepatch
mei
nitro_enclaves
pidfd
pktgen
qmi
rpmsg
seccomp
timers
trace_events tracing: Add trace_event helper macros __string_len() and __assign_str_len() 2021-08-17 11:47:52 -04:00
trace_printk
uhid
v4l
vfio-mdev vfio/mtty: Enforce available_instances 2021-06-28 14:09:01 -06:00
vfs
watch_queue
watchdog
Kconfig vfio/mdev: Remove CONFIG_VFIO_MDEV_DEVICE 2021-06-21 15:29:25 -06:00
Makefile