Commit 558d5f3c authored by Masami Hiramatsu (Google)'s avatar Masami Hiramatsu (Google)
Browse files

tracing: probes: Add a kerneldoc for traceprobe_parse_event_name()

Since traceprobe_parse_event_name() is a bit complicated, add a
kerneldoc for explaining the behavior.

Link: https://lore.kernel.org/all/175323430565.57270.2602609519355112748.stgit@devnote2/



Suggested-by: default avatarSteven Rostedt <rostedt@goodmis.org>
Signed-off-by: default avatarMasami Hiramatsu (Google) <mhiramat@kernel.org>
Reviewed-by: default avatarSteven Rostedt (Google) <rostedt@goodmis.org>
parent 97e8230f
Loading
Loading
Loading
Loading
+19 −1
Original line number Diff line number Diff line
@@ -247,7 +247,25 @@ int traceprobe_split_symbol_offset(char *symbol, long *offset)
	return 0;
}

/* @buf must has MAX_EVENT_NAME_LEN size */
/**
 * traceprobe_parse_event_name() - Parse a string into group and event names
 * @pevent: A pointer to the string to be parsed.
 * @pgroup: A pointer to the group name.
 * @buf:    A buffer to store the parsed group name.
 * @offset: The offset of the string in the original user command, for logging.
 *
 * This parses a string with the format `[GROUP/][EVENT]` or `[GROUP.][EVENT]`
 * (either GROUP or EVENT or both must be specified).
 * Since the parsed group name is stored in @buf, the caller must ensure @buf
 * is at least MAX_EVENT_NAME_LEN bytes.
 *
 * Return: 0 on success, or -EINVAL on failure.
 *
 * If success, *@pevent is updated to point to the event name part of the
 * original string, or NULL if there is no event name.
 * Also, *@pgroup is updated to point to the parsed group which is stored
 * in @buf, or NULL if there is no group name.
 */
int traceprobe_parse_event_name(const char **pevent, const char **pgroup,
				char *buf, int offset)
{