Skip to content

Commit 558d5f3

Browse files
committed
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: Steven Rostedt <[email protected]> Signed-off-by: Masami Hiramatsu (Google) <[email protected]> Reviewed-by: Steven Rostedt (Google) <[email protected]>
1 parent 97e8230 commit 558d5f3

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

kernel/trace/trace_probe.c

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,25 @@ int traceprobe_split_symbol_offset(char *symbol, long *offset)
247247
return 0;
248248
}
249249

250-
/* @buf must has MAX_EVENT_NAME_LEN size */
250+
/**
251+
* traceprobe_parse_event_name() - Parse a string into group and event names
252+
* @pevent: A pointer to the string to be parsed.
253+
* @pgroup: A pointer to the group name.
254+
* @buf: A buffer to store the parsed group name.
255+
* @offset: The offset of the string in the original user command, for logging.
256+
*
257+
* This parses a string with the format `[GROUP/][EVENT]` or `[GROUP.][EVENT]`
258+
* (either GROUP or EVENT or both must be specified).
259+
* Since the parsed group name is stored in @buf, the caller must ensure @buf
260+
* is at least MAX_EVENT_NAME_LEN bytes.
261+
*
262+
* Return: 0 on success, or -EINVAL on failure.
263+
*
264+
* If success, *@pevent is updated to point to the event name part of the
265+
* original string, or NULL if there is no event name.
266+
* Also, *@pgroup is updated to point to the parsed group which is stored
267+
* in @buf, or NULL if there is no group name.
268+
*/
251269
int traceprobe_parse_event_name(const char **pevent, const char **pgroup,
252270
char *buf, int offset)
253271
{

0 commit comments

Comments
 (0)