Re: [PATCH] perf test: Test case 66 broken on s390 (lib/traceevent issue)

Masami Hiramatsu
2020-01-24T16:32:00Z

Hi Steven and Thomas,

On Fri, 24 Jan 2020 10:07:42 -0500
Steven Rostedt <rostedt@goodmis.org> wrote:

> This looks like a kernel bug, not a libtraceevent parsing bug.

Totally agreed. It was my fault to update the print format.
Even if still there is a problem on s390, this patch must be
applied.

Fixes: 88903c464321 ("tracing/probe: Add ustring type for user-space string")
Acked-by: Masami Hiramatsu <mhiramat@kernel.org>

>
> > + }
> > str = malloc(len + 1);
> > if (!str) {
> > do_warning_event(event, "%s: not enough memory!",
>
> Does this patch fix it for you?
>
> -- Steve
>
> diff --git a/kernel/trace/trace_probe.c b/kernel/trace/trace_probe.c
> index 905b10af5d5c..d3309fceb480 100644
> --- a/kernel/trace/trace_probe.c
> +++ b/kernel/trace/trace_probe.c
> @@ -876,7 +876,8 @@ static int __set_print_fmt(struct trace_probe *tp, char *buf, int len,
> for (i = 0; i < tp->nr_args; i++) {
> parg = tp->args + i;
> if (parg->count) {
> - if (strcmp(parg->type->name, "string") == 0)
> + if ((strcmp(parg->type->name, "string") == 0) ||
> + (strcmp(parg->type->name, "ustring") == 0))
> fmt = ", __get_str(%s[%d])";
> else
> fmt = ", REC->%s[%d]";
> @@ -884,7 +885,8 @@ static int __set_print_fmt(struct trace_probe *tp, char *buf, int len,
> pos += snprintf(buf + pos, LEN_OR_ZERO,
> fmt, parg->name, j);
> } else {
> - if (strcmp(parg->type->name, "string") == 0)
> + if ((strcmp(parg->type->name, "string") == 0) ||
> + (strcmp(parg->type->name, "ustring") == 0))
> fmt = ", __get_str(%s)";
> else
> fmt = ", REC->%s";

Thank you!

--
Masami Hiramatsu <mhiramat@kernel.org>