Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp3953877pxu; Mon, 12 Oct 2020 05:57:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxQ7lwinVopPYR77+AJ9v2Qw+KUGiE4z6lpA+umvT7T+Qp4JsOcZzZUaZORNHrbwYZnfSYv X-Received: by 2002:a17:907:33d2:: with SMTP id zk18mr28570263ejb.145.1602507441890; Mon, 12 Oct 2020 05:57:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602507441; cv=none; d=google.com; s=arc-20160816; b=gIfl2nvlRQuT1nCSus0RzFniCkZK+KXaVp6I3vGbRHpYM6G1r60/W66y2cB+ZKtC73 Mc1PB1zUUYIF6FOEqOS/oV6uirosemzzgxwBvdergeXs/cQIQGUpGz4zp+tFcMn32j3c lvIEsSjZlipaDHCMPwYVoMfFVpwiNimQH77HAS/+vGx5mPkMSiY7JMd14f0wjTKZI+LT 7I5q1EtBZ/evTVkfYqprxZ85dPIk6Ei9e0Km823224BctYBq+WpXttGsGdxHKjydibxi tDy59aXYMdaVh828YQd0I7KezewcocIYYpbXrrpwIeTyZ+ZWYXMOfYZ6MrecMJK/KCI/ B3gg== 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=nTnxfFmrbDL62djWnWLgzLAtR9s83zYVv2VSpHqVi2s=; b=YmGFfZsI9NPzE/+8dPGevjz/7KQTwHC/am3emqpM1QuuBw+ngVoPnP3LR9NDK9jXg+ ajbLnk/6YuyfzZ/qBPe6M6AJcfmxX89DF/FzEn7i2I8k7YES2j9bCQhk1ENwVrArbKf0 58pJMwf7LKlL1BjayvsvTFJxNtpHXl9b14PLuvax3lNi0bTux8m7kPpw2n+5ni1pMkQG pc2ojW0AAAySmP85ZBcC8xKH1CM8ywiUMp71jwggSGqclRFUFmFpMC0ZysmxgEBdSH// jEHPJR0Fbo4g4cgqoh6rG4OgiLnn7wSWN66Fjtfh1Ghgoy5oScOi5FkC3V0xa4cDD/Dw p/oQ== 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 bm24si8854950ejb.683.2020.10.12.05.56.59; Mon, 12 Oct 2020 05:57:21 -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 S1728605AbgJLIzM (ORCPT + 99 others); Mon, 12 Oct 2020 04:55:12 -0400 Received: from mga01.intel.com ([192.55.52.88]:44619 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728268AbgJLIzM (ORCPT ); Mon, 12 Oct 2020 04:55:12 -0400 IronPort-SDR: pslZkfJ/Guh4w/Xca8BbnK46p5DUUtGNs1b3SqcGPdiVhJ+r9/+XcnpQEgNxcZyZDTtxFZqVGn 4I0j6orKD0nw== X-IronPort-AV: E=McAfee;i="6000,8403,9771"; a="183165355" X-IronPort-AV: E=Sophos;i="5.77,366,1596524400"; d="scan'208";a="183165355" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Oct 2020 01:55:11 -0700 IronPort-SDR: 0wYcmmC2DE365hOCd3AkUbqTExfdCK705lawhSjPxDQ4UivFonsgZt+kTPouPecp1Jay1X6nAr Q78Loq+v6Txw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,366,1596524400"; d="scan'208";a="345784955" Received: from linux.intel.com ([10.54.29.200]) by orsmga008.jf.intel.com with ESMTP; 12 Oct 2020 01:55:11 -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 EA2FC5805EC; Mon, 12 Oct 2020 01:55:08 -0700 (PDT) Subject: [PATCH v1 03/15] perf data: open data directory in read access mode To: Arnaldo Carvalho de Melo , Jiri Olsa Cc: Namhyung Kim , Alexander Shishkin , Andi Kleen , Adrian Hunter , Peter Zijlstra , Ingo Molnar , linux-kernel References: <810f3a69-0004-9dff-a911-b7ff97220ae0@linux.intel.com> From: Alexey Budankov Organization: Intel Corp. Message-ID: <9ac7f12e-f5a4-dd91-a19a-bb7e5be27636@linux.intel.com> Date: Mon, 12 Oct 2020 11:55:07 +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: <810f3a69-0004-9dff-a911-b7ff97220ae0@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 data directory in case of read access 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