public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: He Kuang <hekuang@huawei.com>
Cc: mingo@redhat.com, a.p.zijlstra@chello.nl, namhyung@kernel.org,
	wangnan0@huawei.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] perf record: Fix perf.data size in no-buildid mode
Date: Fri, 5 Jun 2015 11:44:32 -0300	[thread overview]
Message-ID: <20150605144432.GM32707@kernel.org> (raw)
In-Reply-To: <55718AA0.3060405@huawei.com>

Em Fri, Jun 05, 2015 at 07:40:16PM +0800, He Kuang escreveu:
> 
> ping..

Thanks, applied.

- Arnaldo

> On 2015/5/28 21:17, He Kuang wrote:
> >The size of perf.data is missing update in no-buildid mode, which gives
> >wrong output result.
> >
> >Before this patch:
> >
> >   $ perf.perf record -B -e syscalls:sys_enter_open uname
> >   Linux
> >   [ perf record: Woken up 1 times to  write data ]
> >   [ perf record: Captured and wrote 0.000 MB perf.data ]
> >
> >After this patch:
> >
> >   $ perf.perf record -B -e syscalls:sys_enter_open uname
> >   Linux
> >   [ perf record: Woken up 1 times to write data ]
> >   [ perf record: Captured and wrote 0.001 MB perf.data ]
> >
> >Signed-off-by: He Kuang <hekuang@huawei.com>
> >---
> >  tools/perf/builtin-record.c | 6 ++----
> >  1 file changed, 2 insertions(+), 4 deletions(-)
> >
> >diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
> >index 91aa2a3..d3731cc 100644
> >--- a/tools/perf/builtin-record.c
> >+++ b/tools/perf/builtin-record.c
> >@@ -345,12 +345,9 @@ static int process_buildids(struct record *rec)
> >  	struct perf_data_file *file  = &rec->file;
> >  	struct perf_session *session = rec->session;
> >
> >-	u64 size = lseek(perf_data_file__fd(file), 0, SEEK_CUR);
> >-	if (size == 0)
> >+	if (file->size == 0)
> >  		return 0;
> >
> >-	file->size = size;
> >-
> >  	/*
> >  	 * During this process, it'll load kernel map and replace the
> >  	 * dso->long_name to a real pathname it found.  In this case
> >@@ -719,6 +716,7 @@ out_child:
> >
> >  	if (!err && !file->is_pipe) {
> >  		rec->session->header.data_size += rec->bytes_written;
> >+		file->size = lseek(perf_data_file__fd(file), 0, SEEK_CUR);
> >
> >  		if (!rec->no_buildid) {
> >  			process_buildids(rec);
> >

  reply	other threads:[~2015-06-05 14:44 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-28 13:17 [PATCH] perf record: Fix perf.data size in no-buildid mode He Kuang
2015-06-05 11:40 ` He Kuang
2015-06-05 14:44   ` Arnaldo Carvalho de Melo [this message]
2015-06-09  9:52 ` [tip:perf/core] " tip-bot for He Kuang

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=20150605144432.GM32707@kernel.org \
    --to=acme@kernel.org \
    --cc=a.p.zijlstra@chello.nl \
    --cc=hekuang@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=wangnan0@huawei.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox