Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp4536645pxu; Tue, 13 Oct 2020 00:15:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxB7qtqOpq+P57rYLVq3m/CfZecdy6hRBiEeLcldMfxOhiBBf3A0GxZnEJ/nDxO67POw3sq X-Received: by 2002:a17:906:a95:: with SMTP id y21mr32929894ejf.410.1602573320993; Tue, 13 Oct 2020 00:15:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602573320; cv=none; d=google.com; s=arc-20160816; b=Z2sFwt68aCGAIRoRVuF7RFwdnnAOhqJ1g2cU+IqWqrYaewNeVD2arqyjRhZT8aqVwW t0t9Ax+UxwcfmWOiueJwrG6IpuQXozltii0FAkha8TPOIv2emI5/dIJ5zoIs3coQvQ4T nvHyRPieJNX6Pgve+QNG84mE/tT/zTrH66PWXvcIqSjtm8hRx3NFsWyH1MAisOTt3NNS ldGm1SVKuqojldeWcbXjGSI/sluZPZnNiq0J5TLiglwrAQdHt3aBuWWpMnLr+EXim+Ge jEpztbh7/a6aqDJFWN/pEApf3QSIJMkjVLB5i0im6NLzMITgsSji/wfEei4A3BZ6Ddtm t+WA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:ironport-sdr :ironport-sdr; bh=hJGdlgwpjQEs8+sWp8syd5MG/zfHJsnZjZqXPZyJJiY=; b=igQGHarqx+V1bGdMbLB8i2LmipK/Ci2ZJiyj2HLzd7DGlSqobpBSQ6cF9g6fj5hoMp oOzBNGIzXDYS/daZc1cT6YiyNaE4onmFPVnftUR57woykEsWmRcdhzZL0d5X26rm5H9f YnG9nBFyW2BkCmq2ubQA9n7XpBAxnyRn/yXimQyBdQGZzjaBIFbknV8YpTTsXh3GPRid awGDV/k5YtDjsMUTjsjyUHW4g1pGVuzTiLa2hnNVYAqauckdezUMa9ITZmWEmrP0HlL2 RiV/7/8o9pgFUTBnp27llygIa4X2dyB2cv7iqSHkGh8z9CVozPIWpF+CAUnk0KDJ+pop tjCw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l14si13572005eje.378.2020.10.13.00.14.56; Tue, 13 Oct 2020 00:15:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390287AbgJLQDo (ORCPT + 99 others); Mon, 12 Oct 2020 12:03:44 -0400 Received: from mga02.intel.com ([134.134.136.20]:38593 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389555AbgJLQDn (ORCPT ); Mon, 12 Oct 2020 12:03:43 -0400 IronPort-SDR: vGOO8P+9X++1q/O+Anx1MvGBCAqqDNtDN9Y2tvHO2lVWrCEziXgUIcLx/wyf7W4R1hrZOr2DPC oU4dcXNLHdpg== X-IronPort-AV: E=McAfee;i="6000,8403,9772"; a="152689843" X-IronPort-AV: E=Sophos;i="5.77,367,1596524400"; d="scan'208";a="152689843" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Oct 2020 09:03:41 -0700 IronPort-SDR: M5j79n+CE0wd4PUjVgJxGHSdnkhN9BhNlbtFdkX7IjVPlC1RHRWg3Kcbd6wNAazbeftBLLl/mW XPWGaY0lljbQ== X-IronPort-AV: E=Sophos;i="5.77,367,1596524400"; d="scan'208";a="345899088" Received: from tassilo.jf.intel.com ([10.54.74.11]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Oct 2020 09:03:41 -0700 Date: Mon, 12 Oct 2020 09:03:39 -0700 From: Andi Kleen To: Alexey Budankov Cc: Arnaldo Carvalho de Melo , 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: <20201012160339.GB466880@tassilo.jf.intel.com> References: <810f3a69-0004-9dff-a911-b7ff97220ae0@linux.intel.com> <9ac7f12e-f5a4-dd91-a19a-bb7e5be27636@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9ac7f12e-f5a4-dd91-a19a-bb7e5be27636@linux.intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? > > 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 > >