Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp5429228pxu; Thu, 22 Oct 2020 01:56:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz18cTRyqbcV4Ja/h0W+Ktys5P81BYoBCKTo/NrOhxjvTojh6k3zRqjJOM12sM4p/VbAWrh X-Received: by 2002:a17:906:319a:: with SMTP id 26mr1347909ejy.9.1603356996243; Thu, 22 Oct 2020 01:56:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603356996; cv=none; d=google.com; s=arc-20160816; b=Bcl6ux4uuWEOE+z4vLoOf7Va02gQACxQ3GmOur52I/QG9lKdFQVRL14q1SKHe6CaOT NgW29GteZnVGohXB2dvOZo04HG+EwChBu40yyLjdc+AWH9o0rh7QuKEESAMYUcOjQcmQ +7/MC06MhQcavZrP3IH6J3aiv3+hyOQYaJ8Naj4OIsu4azHzAV9bdfI3DNwxn7iktlko b2BKHV1MG033hCV0/sdwb5wODvNDHRSLy+pKjCP2j6B57zhGN9V4iAKwpgWYjJDHdp7V K0wO1qUwt7rwFmDuvkGPwXmNxmW4XsRbIRuRtPKdrnqUAwpYyd3//YraIyqm4DwJ9Vpr 9N1A== 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=dv0MlhoJSdU8AJXHzNhnyUFlxhp5bpUPATr9XI8Z/7o=; b=HDfI0kOxuosbW0237PZmbCaEWga/Jg9hKG/rOWSefcD8ruICZfMgB9UId7tX/X2Gws D8FJEcLbRtGggp/jw8cK8ReHt/LR2TdCmqMqJ1wlDKnFbI6ZQCpUvi1sD9SvYMAGNrIu G40uRu/Dz45KnLcyZtffj+11eactMgEgCye30FpNjwu3MCfRMjSCqRTmQGwHqE1xqS/l i2xuYrfy2UhiTJNw8RuIjRXU4u/xYfw7fwFyAPdspkiSZ8f/u5VtXOnVG7DD229jdPTN 4ASeGQNG/XL4tH+rKYH45BrC/UgQsCgtY0aB4TClVDaPGXuaid8YZdNs+SGBDzpXli2G 3BjA== 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 co5si551499edb.493.2020.10.22.01.56.13; Thu, 22 Oct 2020 01:56:36 -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 S2507542AbgJVHuX (ORCPT + 99 others); Thu, 22 Oct 2020 03:50:23 -0400 Received: from mga02.intel.com ([134.134.136.20]:25651 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2440683AbgJVHuX (ORCPT ); Thu, 22 Oct 2020 03:50:23 -0400 IronPort-SDR: lS3/1YjygRt2pdURCrlDg2eRvC+uEROrLorNkcGT/YWka2fN/f8ZUOZdnqFl/WPvGjeyDACG0J nFALhEw8qwEg== X-IronPort-AV: E=McAfee;i="6000,8403,9781"; a="154441789" X-IronPort-AV: E=Sophos;i="5.77,404,1596524400"; d="scan'208";a="154441789" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Oct 2020 00:50:22 -0700 IronPort-SDR: jtR6437IXpCU+H6DPCfYdtkozVitBIfopm+gfWrIEW284irYtzdboWsCCQEaVZIwrt81roZKem HAVfS5KpR05g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,404,1596524400"; d="scan'208";a="348648693" Received: from linux.intel.com ([10.54.29.200]) by fmsmga004.fm.intel.com with ESMTP; 22 Oct 2020 00:50:22 -0700 Received: from [10.249.228.198] (unknown [10.249.228.198]) by linux.intel.com (Postfix) with ESMTP id F10C3580720; Thu, 22 Oct 2020 00:50:19 -0700 (PDT) Subject: Re: [PATCH v2 03/15] perf data: open data directory in read access mode To: Namhyung Kim Cc: Arnaldo Carvalho de Melo , Jiri Olsa , Alexander Shishkin , Adrian Hunter , Andi Kleen , Peter Zijlstra , Ingo Molnar , linux-kernel References: <1ec29ed6-0047-d22f-630b-a7f5ccee96b4@linux.intel.com> From: Alexey Budankov Organization: Intel Corp. Message-ID: <258b35e5-03ed-ad2f-c3a8-7df2c36cef6b@linux.intel.com> Date: Thu, 22 Oct 2020 10:50:18 +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: 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 22.10.2020 7:31, Namhyung Kim wrote: > On Thu, Oct 22, 2020 at 12:58 AM Alexey Budankov > wrote: >> >> >> Open files located at trace data directory in case read access >> mode is requested. File are opened and its fds assigned to >> perf_data dir files especially for loading data directories >> content in perf report mode. >> >> 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)) { > > I think this __is_dir() check is unnecessary since it's checked > from the caller side already. Corrected in v3. Thanks! Alexei