tracing/user_events: Document user_event_mm one-shot list usage
authorBeau Belgrave <beaub@linux.microsoft.com>
Fri, 19 May 2023 23:07:41 +0000 (16:07 -0700)
committerSteven Rostedt (Google) <rostedt@goodmis.org>
Wed, 24 May 2023 01:08:33 +0000 (21:08 -0400)
commitff9e1632d69e596d8ca256deb07433a8f3565038
tree01bbfbd82acf346b45615b32bc405331577bca7a
parentdcbd1ac2668b5fa02069ea96d581ca3f70a7543c
tracing/user_events: Document user_event_mm one-shot list usage

During 6.4 development it became clear that the one-shot list used by
the user_event_mm's next field was confusing to others. It is not clear
how this list is protected or what the next field usage is for unless
you are familiar with the code.

Add comments into the user_event_mm struct indicating lock requirement
and usage. Also document how and why this approach was used via comments
in both user_event_enabler_update() and user_event_mm_get_all() and the
rules to properly use it.

Link: https://lkml.kernel.org/r/20230519230741.669-5-beaub@linux.microsoft.com
Link: https://lore.kernel.org/linux-trace-kernel/CAHk-=wicngggxVpbnrYHjRTwGE0WYscPRM+L2HO2BF8ia1EXgQ@mail.gmail.com/
Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Beau Belgrave <beaub@linux.microsoft.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
include/linux/user_events.h
kernel/trace/trace_events_user.c