From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D9DD8C433E7 for ; Tue, 13 Oct 2020 16:22:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 81AB425272 for ; Tue, 13 Oct 2020 16:22:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602606144; bh=WdHLl7lvBHFeej18gwouWeuZ//ygU1XtG9PhW9+5VTs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=bSqK70n1FBzqmzhAH/0PX11cFsYEdDIRXyeXUOgKejVxhUqso3akQ+u6JABa5HZUw YDrJsnPTSFuY7T2E7W9w10gt6Vx4FErNJmnlSakuoim+5RHaJgzx3ClDCE9dPC0Ix1 UohK4yBTf2TV0NxsN4MRJQzCrakHzsoGNK8SPjgE= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389672AbgJMQWX (ORCPT ); Tue, 13 Oct 2020 12:22:23 -0400 Received: from mail.kernel.org ([198.145.29.99]:42766 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389406AbgJMQWX (ORCPT ); Tue, 13 Oct 2020 12:22:23 -0400 Received: from quaco.ghostprotocols.net (unknown [179.97.37.151]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 757E125271; Tue, 13 Oct 2020 16:22:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602606142; bh=WdHLl7lvBHFeej18gwouWeuZ//ygU1XtG9PhW9+5VTs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=k0I7jHwVtd46K7kY+jW6NyImvbi0Kgl4Dilkr7xrKPXLmAHEhaSy8jtUTGipEll0E Uist+XzE9Q4vO1E4bvzbOXdrLvZ8AijxAVa+otbPNTbgdmbMFFlVx1/yjIUJbXDz4P 0xRdl9vFtpZT3qQ/JvOrikCI6LSKPvte7bL8/o24= Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id 853B74047F; Tue, 13 Oct 2020 13:22:20 -0300 (-03) Date: Tue, 13 Oct 2020 13:22:20 -0300 From: Arnaldo Carvalho de Melo To: Alexey Budankov Cc: Andi Kleen , Jiri Olsa , Namhyung Kim , Alexander Shishkin , Adrian Hunter , Peter Zijlstra , Ingo Molnar , linux-kernel Subject: Re: [PATCH v1 03/15] perf data: open data directory in read access mode Message-ID: <20201013162220.GK1063281@kernel.org> References: <810f3a69-0004-9dff-a911-b7ff97220ae0@linux.intel.com> <9ac7f12e-f5a4-dd91-a19a-bb7e5be27636@linux.intel.com> <20201012160339.GB466880@tassilo.jf.intel.com> <49bfe810-f1cc-b1c6-67d3-b0a746552fd6@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <49bfe810-f1cc-b1c6-67d3-b0a746552fd6@linux.intel.com> X-Url: http://acmel.wordpress.com Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Mon, Oct 12, 2020 at 07:52:33PM +0300, Alexey Budankov escreveu: > > On 12.10.2020 19:03, Andi Kleen wrote: > > On Mon, Oct 12, 2020 at 11:55:07AM +0300, Alexey Budankov wrote: > >> > >> Open files located at data directory in case of read access mode. > > > > Need some rationale. Is this a bug fix? Did the case not matter > > before? > > This is not a bug fix. The case didn't matter before. In such cases can you please write a paragraph explaining why it didn't matter before and now it is required? - Arnaldo > > >> > >> Signed-off-by: Alexey Budankov > >> --- > >> tools/perf/util/data.c | 4 ++++ > >> 1 file changed, 4 insertions(+) > >> > >> diff --git a/tools/perf/util/data.c b/tools/perf/util/data.c > >> index c47aa34fdc0a..6ad61ac6ba67 100644 > >> --- a/tools/perf/util/data.c > >> +++ b/tools/perf/util/data.c > >> @@ -321,6 +321,10 @@ static int open_dir(struct perf_data *data) > >> return -1; > >> > >> ret = open_file(data); > >> + if (!ret && perf_data__is_dir(data)) { > >> + if (perf_data__is_read(data)) > >> + ret = perf_data__open_dir(data); > >> + } > >> > >> /* Cleanup whatever we managed to create so far. */ > >> if (ret && perf_data__is_write(data)) > >> -- > >> 2.24.1 > > Alexei > -- - Arnaldo