Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1424011AbbFEOoj (ORCPT ); Fri, 5 Jun 2015 10:44:39 -0400 Received: from mail.kernel.org ([198.145.29.136]:45976 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1422958AbbFEOog (ORCPT ); Fri, 5 Jun 2015 10:44:36 -0400 Date: Fri, 5 Jun 2015 11:44:32 -0300 From: Arnaldo Carvalho de Melo To: He Kuang 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 Message-ID: <20150605144432.GM32707@kernel.org> References: <1432819050-30511-1-git-send-email-hekuang@huawei.com> <55718AA0.3060405@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <55718AA0.3060405@huawei.com> X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2010 Lines: 63 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 > >--- > > 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); > > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/