[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1314028266.2307.93.camel@edumazet-HP-Compaq-6005-Pro-SFF-PC>
Date: Mon, 22 Aug 2011 17:51:06 +0200
From: Eric Dumazet <eric.dumazet@...il.com>
To: Jiri Olsa <jolsa@...hat.com>
Cc: acme@...hat.com, a.p.zijlstra@...llo.nl, mingo@...e.hu,
paulus@...ba.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] perf, tool, record: Fix the header generation for pipe
Le lundi 22 août 2011 à 16:52 +0200, Jiri Olsa a écrit :
> - fd is always file.. the descriptor, which might be pipe, is in output_fd variable
> but, maybe the die call is not necessary.. this should not fail
>
> - the record_file function is called only on debugfs or procfs files:
> events/header_page
> events/header_event
> events/**/format
> printk_formats
> /proc/kallsyms
>
> so I think I need to read the whole file as in current code.
>
You read the file twice. Is it the right fix ?
Once to compute the length to be able to write the output header, once
to process the content.
Are you sure length cannot change between the two phases ?
/proc/kallsyms can definitely change when a module is loaded.
Usually, when input "file" is not seekable or procfs based (fstat()
returns st_size=0), we must load/cache it in memory (or using a
temporary file) to get a consistent view of it.
This is what is done by following commands :
cat /proc/kallsyms | less
less /proc/kallsyms
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists