Re: [RFC PATCH 2/7] perf: add pipe-specific header read/write andevent processing code

From: Frederic Weisbecker
Date: Fri Mar 26 2010 - 23:15:08 EST


On Wed, Mar 03, 2010 at 01:05:24AM -0600, Tom Zanussi wrote:
>
> +int perf_header__write_pipe(struct perf_header *self, int fd)
> +{
> + struct perf_file_header_pipe f_header;
> + int err;
> +
> + f_header = (struct perf_file_header_pipe){
> + .magic = PERF_MAGIC,
> + .size = sizeof(f_header),
> + };
> +
> + err = do_write(fd, &f_header, sizeof(f_header));
> + if (err < 0) {
> + pr_debug("failed to write perf pipe header\n");
> + return err;
> + }
> +
> + self->frozen = 1;
> + return 0;
> +}



I actually wonder why you bother with a header in the pipe mode,
since it only contains MAGIC and its size.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/