All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiri Olsa <jolsa@redhat.com>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: acme@redhat.com, a.p.zijlstra@chello.nl, mingo@elte.hu,
	paulus@samba.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] perf, tool, record: Fix the header generation for pipe
Date: Mon, 22 Aug 2011 18:07:13 +0200	[thread overview]
Message-ID: <20110822160713.GA10134@jolsa.brq.redhat.com> (raw)
In-Reply-To: <1314028266.2307.93.camel@edumazet-HP-Compaq-6005-Pro-SFF-PC>

On Mon, Aug 22, 2011 at 05:51:06PM +0200, Eric Dumazet wrote:
> 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.

Right, better to store it to a temp file as you suggest,
so we have consistent view.. I'll prepare new patch.

thanks,
jirka


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

  reply	other threads:[~2011-08-22 16:07 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-22 14:23 [PATCH] perf, tool, record: Fix the header generation for pipe Jiri Olsa
2011-08-22 14:38 ` Eric Dumazet
2011-08-22 14:52   ` Jiri Olsa
2011-08-22 15:51     ` Eric Dumazet
2011-08-22 16:07       ` Jiri Olsa [this message]
2011-08-29 13:20         ` Arnaldo Carvalho de Melo
2011-08-29 13:41           ` Jiri Olsa
2011-08-29 14:25             ` Arnaldo Carvalho de Melo
2011-09-14 13:58               ` [PATCH] perf tools: Fix tracing info recording Jiri Olsa
2011-09-14 15:44                 ` Neil Horman
2011-09-21 15:30                 ` Frederic Weisbecker
2011-09-25 13:34                   ` Jiri Olsa
2011-09-26  9:11                     ` [PATCHv2 1/2] " Jiri Olsa
2011-09-26  9:11                       ` [PATCHv2 1/2] perf tools: Collect tracing event data files directly Jiri Olsa
2011-09-26 13:36                         ` Steven Rostedt
2011-09-26 14:56                           ` Jiri Olsa
2011-09-28 13:55                             ` Frederic Weisbecker
2011-09-28 14:03                               ` Steven Rostedt
2011-09-28 14:17                                 ` Frederic Weisbecker
2011-09-28 14:23                                   ` Steven Rostedt
2011-09-28 16:56                                   ` Ingo Molnar
2011-09-28 17:10                                     ` Steven Rostedt
2011-10-10  5:22                                       ` Ingo Molnar
2011-10-10 12:27                                         ` Steven Rostedt
2011-10-10 14:21                                           ` Frederic Weisbecker
2011-09-26 13:43                         ` David Ahern
2011-09-26 14:58                           ` Jiri Olsa
2011-09-26  9:11                       ` [PATCHv2 2/2] perf tools: Fix tracing info recording Jiri Olsa
2011-09-29 15:05                       ` [PATCHv3 0/2] " Jiri Olsa
2011-09-29 15:05                         ` [PATCHv3 1/2] perf tools: Fix raw sample reading Jiri Olsa
2011-09-29 15:34                           ` David Ahern
2011-09-29 15:05                         ` [PATCHv3 2/2] perf tools: Fix tracing info recording Jiri Olsa
2011-10-13 14:00                           ` Jiri Olsa
2011-10-20 13:59                             ` [PATCHv4] " Jiri Olsa
2011-10-20 21:28                               ` Arnaldo Carvalho de Melo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110822160713.GA10134@jolsa.brq.redhat.com \
    --to=jolsa@redhat.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@redhat.com \
    --cc=eric.dumazet@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=paulus@samba.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.