Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp602327pxx; Mon, 26 Oct 2020 16:32:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyR0V62kottNotAOWyx/stiTTa23Wmi8bi0TosPG2bY68zWD9MqLm0HBS+JN7Dj3rrUOvg7 X-Received: by 2002:a17:906:3406:: with SMTP id c6mr17148083ejb.65.1603755153089; Mon, 26 Oct 2020 16:32:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603755153; cv=none; d=google.com; s=arc-20160816; b=f2sc1v6xWy0vzeZBHpgUbnFCbkAV273UfMrp4I6Abevf17yENTTM6mnTpPrmrMSKNM e7rim1IP9YDLrjiT/hz858HX/CXnPQ379QXvW+6RSdHNhtSj1nwvv2veEvrK2Rhz4YUT 7W/hbYWzCKsTs4wHph+xALepqaKE2jn6X9JCFMJghW6sij6qf8dRRk3DzFDIwCEnyWX2 wXUKg9x1qck76yt8x9cLgiMTVMephDssHRntumKwCKens4pREFNls62J24N6jLoZQJqD ZQGMQjbbVWHHiNW+cSUWYzaUUobsh7laK3ZmZNqd8N0kJYFuhX/ICVSGfC6fO9TWcpqf M2Hw== 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=icsf9r3a2pJnHe7hd5NRkcjvDaeqTrdSD4wSKPcsmqE=; b=SLA8bmXiMr+HF7kgMAVlzWsZUqA1CYSMBw9nA6lCHZGEiOJoFw2aBS7U72XtFidOO1 eXtnKKKzVDO8IWXxBiL2stH6o5X5jE9WHqRz5yKyl9QiysU9p56lY6jlrX+wtM/3+B/d OKzczxHqytb+sVtO4KKVragTOroLGl3oKsie9fzM7vLdVYcmAhpFhmm0ONuNGE7vNSqV nHympnoPP6yT6X9Cqx5IzNS5YDUvl69LOR3J2hfcLiBny8emSJZ7PBqwF+VsPyQT/A7Y VoFZjkLzmpawb9dEF4b/+3UvQZP2UAIPCpTTVxLwCUKbjbKMzEYyoDPIiHmU5OPfl5fr jWMw== 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 m3si8121392edb.600.2020.10.26.16.32.11; Mon, 26 Oct 2020 16:32:33 -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 S1788359AbgJZRrM (ORCPT + 99 others); Mon, 26 Oct 2020 13:47:12 -0400 Received: from mga12.intel.com ([192.55.52.136]:18462 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1788355AbgJZRrM (ORCPT ); Mon, 26 Oct 2020 13:47:12 -0400 IronPort-SDR: PjpLfO3tHYZxVRkyP/LJfPVpL0HExFEeduV7pUo9DOPm8YW0tGyZkw+li9nAxITo01SS7NymE7 CAvsW+6JVErQ== X-IronPort-AV: E=McAfee;i="6000,8403,9786"; a="147247828" X-IronPort-AV: E=Sophos;i="5.77,420,1596524400"; d="scan'208";a="147247828" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Oct 2020 10:47:11 -0700 IronPort-SDR: 87IvYXJf/B2GGXjaPxtnWGtPa1UQjFKLKyR4oNmhVg27NzktJpDbJHodHbu/DIxUaOJGwLdxDI MtfgvkZdmtUw== X-IronPort-AV: E=Sophos;i="5.77,420,1596524400"; d="scan'208";a="535449111" Received: from abudanko-mobl.ccr.corp.intel.com (HELO [10.249.226.224]) ([10.249.226.224]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Oct 2020 10:47:08 -0700 Subject: Re: [PATCH v2 03/15] perf data: open data directory in read access mode To: Jiri Olsa Cc: Arnaldo Carvalho de Melo , Namhyung Kim , Alexander Shishkin , Adrian Hunter , Andi Kleen , Peter Zijlstra , Ingo Molnar , linux-kernel References: <1ec29ed6-0047-d22f-630b-a7f5ccee96b4@linux.intel.com> <20201024154317.GB2589351@krava> From: Alexey Budankov Organization: Intel Corp. Message-ID: Date: Mon, 26 Oct 2020 20:47:06 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.4.0 MIME-Version: 1.0 In-Reply-To: <20201024154317.GB2589351@krava> 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 24.10.2020 18:43, Jiri Olsa wrote: > On Wed, Oct 21, 2020 at 06:57:53PM +0300, 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)) { >> + if (perf_data__is_read(data)) >> + ret = perf_data__open_dir(data); >> + } > > perf_data__open_dir is also called from perf_session__new > is it called twice? It is not called twice. It is in different branches. This one is for write and the other one is for read. Alexei > > jirka > >> >> /* Cleanup whatever we managed to create so far. */ >> if (ret && perf_data__is_write(data)) >> -- >> 2.24.1 >> >