Skip to content

Commit a78416d

Browse files
committed
Merge tag 'trace-v5.5-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace
Pull tracing fix from Steven Rostedt: "Kprobe events added 'ustring' to distinguish reading strings from kernel space or user space. But the creating of the event format file only checks for 'string' to display string formats. 'ustring' must also be handled" * tag 'trace-v5.5-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: tracing/kprobes: Have uname use __get_str() in print_fmt
2 parents abb22e4 + 2027942 commit a78416d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

kernel/trace/trace_probe.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -876,15 +876,17 @@ static int __set_print_fmt(struct trace_probe *tp, char *buf, int len,
876876
for (i = 0; i < tp->nr_args; i++) {
877877
parg = tp->args + i;
878878
if (parg->count) {
879-
if (strcmp(parg->type->name, "string") == 0)
879+
if ((strcmp(parg->type->name, "string") == 0) ||
880+
(strcmp(parg->type->name, "ustring") == 0))
880881
fmt = ", __get_str(%s[%d])";
881882
else
882883
fmt = ", REC->%s[%d]";
883884
for (j = 0; j < parg->count; j++)
884885
pos += snprintf(buf + pos, LEN_OR_ZERO,
885886
fmt, parg->name, j);
886887
} else {
887-
if (strcmp(parg->type->name, "string") == 0)
888+
if ((strcmp(parg->type->name, "string") == 0) ||
889+
(strcmp(parg->type->name, "ustring") == 0))
888890
fmt = ", __get_str(%s)";
889891
else
890892
fmt = ", REC->%s";

0 commit comments

Comments
 (0)