lkml.org 
[lkml]   [2013]   [Nov]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/2] perf record: mmap output file - v4
On Thu, Nov 07, 2013 at 09:23:25PM -0700, David Ahern wrote:

SNIP

>
> +static void mmap_output_fini(struct perf_record *rec)
> +{
> + off_t len;
> + int fd;
> +
> + if (!rec->mmap.use)
> + return;
> +
> + rec->mmap.use = false;
> +
> + len = rec->session->header.data_offset + rec->bytes_written;
> + fd = rec->file.fd;
> +
> + munmap(rec->mmap.addr, rec->mmap.out_size);
> + rec->mmap.addr = NULL;
> +
> + if (ftruncate(fd, len) != 0)
> + pr_err("ftruncate failed\n");

I think we should fail here and dont let the finishing
code run on probably corrupted file.

the code that process build IDs could even get stuck

jirka


\
 
 \ /
  Last update: 2013-11-08 10:41    [W:0.075 / U:0.520 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site