Re: [PATCH v3 11/15] perf header: add a buffer to struct feat_fd

Jiri Olsa
2017-06-08T11:54:28Z

On Tue, Jun 06, 2017 at 12:07:18AM -0700, David Carrillo-Cisneros wrote:

SNIP

> static int do_read_u32(struct feat_fd *ff, u32 *addr)
> @@ -188,6 +233,10 @@ static char *do_read_string(struct feat_fd *ff)
> static int write_tracing_data(struct feat_fd *ff,
> struct perf_evlist *evlist)
> {
> + if (ff->buf) {
> + WARN_ON("Pipe-mode doesn't supported write_tracing_data.\n");
> + return -1;
> + }

I think you need to use WARN or WARN_ONCE here, like:

if (WARN_ONCE(ff->buf, "Pipe....."))
return -1;

WARN_ON takes condition as an argument not string

jirka