Re: [PATCH v2 10/13] perf header: add a buffer to struct feat_fd
From: Jiri Olsa
Date: Thu May 25 2017 - 04:07:35 EST
On Tue, May 23, 2017 at 12:48:50AM -0700, David Carrillo-Cisneros wrote:
SNIP
> +
> + memcpy(addr, fd->buf + fd->offset, size);
> + fd->offset += size;
>
> - if (ret != (ssize_t)size)
> - return ret < 0 ? (int)ret : -1;
> return 0;
> }
>
> @@ -187,6 +215,10 @@ static char *do_read_string(struct feat_fd *fd)
> static int write_tracing_data(struct feat_fd *fd,
> struct perf_evlist *evlist)
> {
> + if (fd->buf) {
> + pr_err("Unsupported write_tracing_data to memory buffer.\n");
> + return -1;
> + }
could those messsages mention the pipe mode, this one
does not give clue it's pipe mode related
also together with your following patches, this condition
should never hit right? more like the assert stuff..
WARN_ON/WARN_ON_ONCE maybe
thanks,
jirka