Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp1378807pxu; Sat, 24 Oct 2020 08:50:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxmlHl1jjJBAKah0unjyVoiu255VFsbuzHp6xfWXE5H6emqj8kBjkS5XoIIx7JW6cNrMmaw X-Received: by 2002:a17:906:8891:: with SMTP id ak17mr7284179ejc.176.1603554648490; Sat, 24 Oct 2020 08:50:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603554648; cv=none; d=google.com; s=arc-20160816; b=aNSgPOkyG+bcbKTFzkU8pllu/yoSl+u+msPtWk/+8NreKgsCc5Q9Il3/z3kUHBQRaG EGYDwH0izQu0XUQ+h8ZXah5sOS6zPMxVQT+wBieLqVnV8a1FsIViZl+j65dwvxuPNa6L XPizQU0ufJd4lBiiAwNy2l5/BB3fan/Kq5PxRyXauRs7JNkfMEbg7tv5xnPXRREPPjjm ZUyTEkBqGo2/j71OOMniIjJ9pgpYT6prilqCNfkEzY/VZlr1rNkUgXd5N1VHecSDCZRq 3YuOmS1ezi5dYd580iUy3Xh6IGQnUJk/1cjBFr25vmTqw3EUxLHUvqpdcQX2B+zSseOi jMSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=/SAObKvoFYpmQ+QYKJsoy0EO6zCZgavM+XPxIgmLRg8=; b=I5mEU6D2KJINnbT6khCTxF7x1jzEV9I5Hc4uAUNIhUEZwLuSS5Sus8BChGU1DHErqF qq4wrD8NaL8dplZa73GT64hOG+wOxRgtDX+H0d94i7oKLn9dFFKHvmZ4rXNqZ/aE5Dy3 Wpo2If6AwvKlONqKetTMkxAakIj8dZqNFrBgvaX2B4YucWTJDEIV01wKXDmRS54wfyCv P7joaBF5MwaBQXSh69z9Ua58TjsVrcI48HbC4XCvwsHMO6tFWa05L0teS2xNEac6Ab46 63cuM9lKTRjt+7J0vvpH8VZE/5FPIPqn5kfXtI83DjAobZOaTuTf2vurlaAKTu+dMAt9 qm/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=BUhYkVhs; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z15si3220526edq.289.2020.10.24.08.50.26; Sat, 24 Oct 2020 08:50:48 -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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=BUhYkVhs; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761909AbgJXPn1 (ORCPT + 99 others); Sat, 24 Oct 2020 11:43:27 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:36146 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1761905AbgJXPn1 (ORCPT ); Sat, 24 Oct 2020 11:43:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1603554206; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=/SAObKvoFYpmQ+QYKJsoy0EO6zCZgavM+XPxIgmLRg8=; b=BUhYkVhsZNbwoQyfauDtlN9m9mrLHex17UYSgqPhxZgVrEIryTwLbzQ58UjUtSHT83Jk+i f2Luv0Us16tqrAGLqtmwE+657q8UpNf/Vz5Km8OqHqZJNk6r5C6yDYsobgeQfo95c0fp47 EXoGL7epETvxVrUW4dgSb4hts8LcUx4= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-439-Jzgn3x0GNTirFAfIBk2YOQ-1; Sat, 24 Oct 2020 11:43:22 -0400 X-MC-Unique: Jzgn3x0GNTirFAfIBk2YOQ-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B6D26803F78; Sat, 24 Oct 2020 15:43:20 +0000 (UTC) Received: from krava (unknown [10.40.192.80]) by smtp.corp.redhat.com (Postfix) with SMTP id D0F2955793; Sat, 24 Oct 2020 15:43:18 +0000 (UTC) Date: Sat, 24 Oct 2020 17:43:17 +0200 From: Jiri Olsa To: Alexey Budankov Cc: Arnaldo Carvalho de Melo , Namhyung Kim , Alexander Shishkin , Adrian Hunter , Andi Kleen , Peter Zijlstra , Ingo Molnar , linux-kernel Subject: Re: [PATCH v2 03/15] perf data: open data directory in read access mode Message-ID: <20201024154317.GB2589351@krava> References: <1ec29ed6-0047-d22f-630b-a7f5ccee96b4@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? jirka > > /* Cleanup whatever we managed to create so far. */ > if (ret && perf_data__is_write(data)) > -- > 2.24.1 >