Re: [PATCH] [RFC] perf: robustify proc and debugfs file recording

From: Steven Rostedt
Date: Wed Jul 13 2011 - 16:39:11 EST


On Wed, 2011-07-13 at 20:52 +1000, Michael Neuling wrote:

> Actually, here's an updated patch to fix these..
>
> FYI perf record/annotate/report works fine on my powerpc box here with
> this. I don't have modules handy so I've not tested that aspect.

Sure it worked for you...


> -static unsigned long get_size(const char *file)
> -{
> - unsigned long long size = 0;
> - int fd;
> -
> - fd = open(file, O_RDONLY);
> - if (fd < 0)
> - die("Can't read '%s'", file);
> - size = get_size_fd(fd);
> close(fd);
>
> - return size;
> + /* ugh, handle big-endian hdr_size == 4 */
> + sizep = (char*)&size;
> + if (bigendian())
> + sizep += sizeof(u64) - hdr_sz;
> +
> + if (pwrite(output_fd, &size, hdr_sz, hdr_pos) < 0)

s/&size/sizep/

-- Steve

> + die("writing to %s", output_file);
> }


--
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/