Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp5332824pxu; Wed, 21 Oct 2020 22:13:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJylBsb7DktXNAsDF53FNOH8UfPnRYwbQdqDARTn80VNYUAcmFfX01z8hEnjNK2ZP6Xk+XcH X-Received: by 2002:a50:fb0d:: with SMTP id d13mr693620edq.85.1603343610662; Wed, 21 Oct 2020 22:13:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603343610; cv=none; d=google.com; s=arc-20160816; b=wKhVp3doHDzmG73x1Dfr5q4qLoEQg6FHKNDUPNjUP9gurCUwB9klIA00Lpp0VJ+U3u 4Rscj+ZpmA1pOAuKF1NPZTYpgMoO64hbD+P0cNja8ygJF+DkpDYbjoYsH24IOtV0qYue RRx1rY/exfUo/7wC/Kd5R+Cqe5evp8hiRcY4gJKibHTDvSih/mo/3Zv10xrsfDmSEh8A f2KW99FhiLkrhMwjKZaouAe+ZaJr8bGdGmMrjrDU7nypfo3r3UcnRHqrNmuhyeGJVw9e Uaa1fLfdgCiWbQDTtRXS0b6uCCWX8YFt/tHw9RSph3gvTPF7zhlKXeYOmXeeLK2lYo+l PPKQ== 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 :references:cc:to:from:subject:ironport-sdr:ironport-sdr; bh=5leMTf5NaNP53PkMLiSzZN44Nvx0jJ0VHhdiKVsooUc=; b=v9WDdUhyIsEU3peqk7ZX5ML5chaujWNEZ+QXCwcfOdUO0KlTbKEASknlfMr8hwR9h8 bKbg+7SKa5r+kBXPDbRuImfVOrk1iDYQfou8vd12PtcytfPRQHoD6A14re4lsUN6v2Qk OGxq0qadL+qFsyVFE2UiJ8p5vBeMc/DVAgJvrDPsGEwmwcch1FbbBJEN7Ei6A4n7JNpT woHL0u8jZeroSSVrJ3iW0NADx8q2d8N4GvziZft2GR+CT0PlPwkzPIfBsD4EYaD2/W+a +ozpwubrNkAGL8Cu6lbKN4aki9w5qtjt0kk/X8kilwDWz4ssp1xzhUAxG3S5B6ZS//mO eF+Q== 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 b6si248150eja.565.2020.10.21.22.13.09; Wed, 21 Oct 2020 22:13:30 -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 S2443371AbgJUP56 (ORCPT + 99 others); Wed, 21 Oct 2020 11:57:58 -0400 Received: from mga06.intel.com ([134.134.136.31]:31390 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387963AbgJUP55 (ORCPT ); Wed, 21 Oct 2020 11:57:57 -0400 IronPort-SDR: IN9MF/FIzXzWYeNd3/Jfp1UM7V/S9BsnZZPsC0D00JdsnXrIb+3XEuilT5TpI4cdWUvCypJeAg EfpzKFOs0VTQ== X-IronPort-AV: E=McAfee;i="6000,8403,9780"; a="229015350" X-IronPort-AV: E=Sophos;i="5.77,401,1596524400"; d="scan'208";a="229015350" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Oct 2020 08:57:56 -0700 IronPort-SDR: 91ZSyJiRZQkYxjao9T715rcxo2B5yWh3+WDB32S5mK/Q9qeGJeSqLXVoWN6OfQ9FWRdqryjP46 Ia/lkH49pTYQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,401,1596524400"; d="scan'208";a="522789255" Received: from linux.intel.com ([10.54.29.200]) by fmsmga006.fm.intel.com with ESMTP; 21 Oct 2020 08:57:56 -0700 Received: from [10.249.231.46] (abudanko-mobl.ccr.corp.intel.com [10.249.231.46]) by linux.intel.com (Postfix) with ESMTP id 6986E580720; Wed, 21 Oct 2020 08:57:54 -0700 (PDT) Subject: [PATCH v2 03/15] perf data: open data directory in read access mode From: Alexey Budankov To: Arnaldo Carvalho de Melo , Jiri Olsa Cc: Namhyung Kim , Alexander Shishkin , Adrian Hunter , Andi Kleen , Peter Zijlstra , Ingo Molnar , linux-kernel References: <1ec29ed6-0047-d22f-630b-a7f5ccee96b4@linux.intel.com> Organization: Intel Corp. Message-ID: Date: Wed, 21 Oct 2020 18:57:53 +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: <1ec29ed6-0047-d22f-630b-a7f5ccee96b4@linux.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 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)) { + 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