Skip to content

Commit

Permalink
tracing: Have memmapped ring buffer use ioctl of "R" range 0x20-2F
Browse files Browse the repository at this point in the history
To prevent conflicts with other ioctl numbers to allow strace to have an
idea of what is happening, add the range of ioctls for the trace buffer
mapping from _IO("T", 0x1) to the range of "R" 0x20 - 0x2F.

Link: https://lore.kernel.org/linux-trace-kernel/20240630105322.GA17573@altlinux.org/
Link: https://lore.kernel.org/linux-trace-kernel/20240630213626.GA23566@altlinux.org/

Cc: Jonathan Corbet <corbet@lwn.net>
Fixes: cf9f0f7 ("tracing: Allow user-space mapping of the ring-buffer")
Link: https://lore.kernel.org/20240702153354.367861db@rorschach.local.home
Reported-by: "Dmitry V. Levin" <ldv@strace.io>
Reviewed-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
  • Loading branch information
rostedt committed Jul 3, 2024
1 parent 22a40d1 commit 4ecaf7e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions Documentation/userspace-api/ioctl/ioctl-number.rst
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ Code Seq# Include File Comments
'Q' all linux/soundcard.h
'R' 00-1F linux/random.h conflict!
'R' 01 linux/rfkill.h conflict!
'R' 20-2F linux/trace_mmap.h
'R' C0-DF net/bluetooth/rfcomm.h
'R' E0 uapi/linux/fsl_mc.h
'S' all linux/cdrom.h conflict!
Expand Down
2 changes: 1 addition & 1 deletion include/uapi/linux/trace_mmap.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@ struct trace_buffer_meta {
__u64 Reserved2;
};

#define TRACE_MMAP_IOCTL_GET_READER _IO('T', 0x1)
#define TRACE_MMAP_IOCTL_GET_READER _IO('R', 0x20)

#endif /* _TRACE_MMAP_H_ */

0 comments on commit 4ecaf7e

Please sign in to comment.