Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932560AbbFELut (ORCPT ); Fri, 5 Jun 2015 07:50:49 -0400 Received: from szxga03-in.huawei.com ([119.145.14.66]:9551 "EHLO szxga03-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751210AbbFELuq (ORCPT ); Fri, 5 Jun 2015 07:50:46 -0400 Subject: Re: [PATCH] perf record: Fix perf.data size in no-buildid mode To: , , , References: <1432819050-30511-1-git-send-email-hekuang@huawei.com> CC: , From: He Kuang Message-ID: <55718AA0.3060405@huawei.com> Date: Fri, 5 Jun 2015 19:40:16 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.0 MIME-Version: 1.0 In-Reply-To: <1432819050-30511-1-git-send-email-hekuang@huawei.com> Content-Type: text/plain; charset="gbk"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.110.54.65] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020205.55718D0B.002C,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2013-05-26 15:14:31, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 0103927dd65d9c6ca2c1179c2687079a Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1854 Lines: 58 ping.. 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/