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=-11.4 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 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 1C2FAC4363A for ; Thu, 22 Oct 2020 07:50:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B62B4223C7 for ; Thu, 22 Oct 2020 07:50:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2508877AbgJVHuX (ORCPT ); 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