[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201013113709.09531d7c@gandalf.local.home>
Date: Tue, 13 Oct 2020 11:37:09 -0400
From: Steven Rostedt <rostedt@...dmis.org>
To: Tom Zanussi <zanussi@...nel.org>
Cc: axelrasmussen@...gle.com, mhiramat@...nel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 4/7] tracing: Add synthetic event error logging
On Tue, 13 Oct 2020 09:17:55 -0500
Tom Zanussi <zanussi@...nel.org> wrote:
> +static int save_cmdstr(int argc, const char *name, const char **argv)
> +{
> + struct seq_buf s;
> + char *buf;
> + int i;
> +
> + buf = kzalloc(MAX_DYNEVENT_CMD_LEN, GFP_KERNEL);
> + if (!buf)
> + return -ENOMEM;
> +
> + seq_buf_init(&s, buf, MAX_DYNEVENT_CMD_LEN);
> +
> + seq_buf_puts(&s, name);
> +
> + for (i = 0; i < argc; i++) {
> + seq_buf_putc(&s, ' ');
> + seq_buf_puts(&s, argv[i]);
> + }
> +
> + if (!seq_buf_buffer_left(&s)) {
> + synth_err(SYNTH_ERR_CMD_TOO_LONG, 0);
> + kfree(buf);
> + return -EINVAL;
> + }
> + buf[s.len] = 0;
> + last_cmd_set(buf);
> +
> + kfree(buf);
> + return 0;
> +}
I see you cut and pasted this ;-)
I fixed up the whitespace.
-- Steve
Powered by blists - more mailing lists