Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp4118585pxu; Mon, 12 Oct 2020 09:56:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyxwaPoAzP8W0PT3sVr2nx55JWKz/2aDaNRr/Njbinu9prcytn1GFjXWKTXS6BsEEh+N/R7 X-Received: by 2002:a05:6402:16c9:: with SMTP id r9mr14879138edx.27.1602521764548; Mon, 12 Oct 2020 09:56:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602521764; cv=none; d=google.com; s=arc-20160816; b=wN4TBNjetCG/my+qZd1+auvGWMd67Pqtfnkghy0aOZYsjh8N9MKSIMnPNKtEOv9hWh zmIEVlgOj76Umfm6YkUxqzPm8p5c5nvJ+WkxB7tXz4ySqGBDXm2lQSQDe/aFD4x9rty8 6zXnEShncrhrpq5vBBNs1h0v4Tdgqm9jQbnd56uETjaRauX2apgVHxXSUYYBbjXa604E ZptaY7X93K5C1vDZMrOi+Z8pSK845A3Heq5bDxeR+HHjwfhiRdyVbOJU45PTEAfmDk4e /oCfPIOtqR/TgK++EEfIH7lyeGtqVpssM77GKFnuxDgfJVkKPP3sv6QOA+Qm4ZKtiOeo THAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:organization :from:references:cc:to:subject:ironport-sdr:ironport-sdr; bh=S4ODmqa0BWeXSb5ClJPjxdHMgNLQ2a3JFq7Wup58SFE=; b=FGmmr5VJnjeRkSjCQVSHumZRg9lr3OpqyRsCqexohOucBwdwTxfKm31pmdHziRQUpm Cj0mc638IIH1acBqoKFTtdm7lcHesywvlTkrRHwC+hh4vK8mCNrVWhxbdM+Vu+vpLCCw /W9fQuN5vDzOyb4fmXciZc9GpXAVXa5LxdhkMGsodXRv3pkHNBdEznNFlNHJhBNRsbK/ BzFxsJN8ntFpsQeJ5Cfvpw0em4PeEzRtwb+r8wZv2JbBOlKeDGol/yy9nIzKGrA7G7vC O7BDmxpmATfzjTuxspuxtrqpAMkCeK+L3AcIy8IEPTFCdQ916L4nNWwyFixKhALZYLBr 7mSg== 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 y21si13583088edm.83.2020.10.12.09.55.41; Mon, 12 Oct 2020 09:56:04 -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 S2403911AbgJLQwo (ORCPT + 99 others); Mon, 12 Oct 2020 12:52:44 -0400 Received: from mga03.intel.com ([134.134.136.65]:35518 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390622AbgJLQwo (ORCPT ); Mon, 12 Oct 2020 12:52:44 -0400 IronPort-SDR: qEZ5V7PJxKLSqDAGOeNV/xaWEaEXJEJd9jw552v9zm73L8pRqa6xvTLiOxIZK9t9jlySLRmjve nL+s0FoIrLXQ== X-IronPort-AV: E=McAfee;i="6000,8403,9772"; a="165829527" X-IronPort-AV: E=Sophos;i="5.77,367,1596524400"; d="scan'208";a="165829527" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Oct 2020 09:52:42 -0700 IronPort-SDR: WQON228o5cjV2jjXjJk4CHWOjmpm3P1PQKLPFSKHztBmmW1qef5lTNKM/dEf+fk+ESqMSmyxtx StT9W4+ygdBw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,367,1596524400"; d="scan'208";a="299341621" Received: from linux.intel.com ([10.54.29.200]) by fmsmga008.fm.intel.com with ESMTP; 12 Oct 2020 09:52:41 -0700 Received: from [10.249.225.186] (abudanko-mobl.ccr.corp.intel.com [10.249.225.186]) by linux.intel.com (Postfix) with ESMTP id 112715807A3; Mon, 12 Oct 2020 09:52:35 -0700 (PDT) Subject: Re: [PATCH v1 03/15] perf data: open data directory in read access mode To: Andi Kleen Cc: Arnaldo Carvalho de Melo , Jiri Olsa , Namhyung Kim , Alexander Shishkin , Adrian Hunter , Peter Zijlstra , Ingo Molnar , linux-kernel References: <810f3a69-0004-9dff-a911-b7ff97220ae0@linux.intel.com> <9ac7f12e-f5a4-dd91-a19a-bb7e5be27636@linux.intel.com> <20201012160339.GB466880@tassilo.jf.intel.com> From: Alexey Budankov Organization: Intel Corp. Message-ID: <49bfe810-f1cc-b1c6-67d3-b0a746552fd6@linux.intel.com> Date: Mon, 12 Oct 2020 19:52:33 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.12.1 MIME-Version: 1.0 In-Reply-To: <20201012160339.GB466880@tassilo.jf.intel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. > >> >> 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