Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp132159pxu; Tue, 13 Oct 2020 19:11:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyVtTBX1W9Ra7bd4BF2alyFK1KLmfnFpkR83ZK6ZxYBUxjgsMdigMzNzmeUo656eY5Uq+Yw X-Received: by 2002:a17:906:5e4f:: with SMTP id b15mr2930950eju.353.1602641509066; Tue, 13 Oct 2020 19:11:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602641509; cv=none; d=google.com; s=arc-20160816; b=Nak8HXzDNSpcsU+Mwb46DA7DEdV3lC8FJwdGbvwR526vRd6/kIOe/piJnngFgFQ2ms hw77iiUGZpwxzrqDMSCe6TCx+np2qLOAClp0/6nGtqul4wswY6kIq81pFDUx6q4kPIFc uFjc7bLTjmNz5jIbZSvnkKQR3c2HUxFeGsFVhQt+d9e6BP0cI4D+Tye9f6uwIzD2Irhw OHOCDC95BwUvRafV4LLr6vVk5uX1twru1NTbeZ7Sl1U+GaQZzTC2uOL/wMX9nYHau253 mUPVLIAv+ELJmxlh7wUI+Dy4sx8Mz8vddQv3cANgnnT4WPMWBg5zIWhcCf9Z4x0JRa8A qqJw== 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=UpbYTMDbpOZbck3s1JYTCQOI7zxR0Dx7lmLKCh4b9So=; b=JUP0aTRT+1hMu5HPZJkVTo4OXcv/KufmfeVEJ+qTrsWU7Nfd7SDjcwgJ+bAHC+9VEj SGcJejADG2RVrnCBFrIk0ypWKNCcwVuFTjsmjOKmoV4F+I1MGNL6oQ8dVNeFStXszEJ2 WdN1VVLLecJWhr2Y32uHBItupYWAkF2mHKnB2BduQtqZirLS1nJEPuZCyR2bOg7kqTZD Pt8glBdvejjLcDatVnetZRZEMKf10V0CQuuc2R0mWBbM18DctAQdNkHzCTWawS+aVD90 Xyn3wSG+8LHFvtgA8tix1dRjN1osVMHkBoS1SgglsrFfsVui3M1m/n6UYQAnMrNInS8z 1ZKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=k0I7jHwV; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c6si1134254ejr.584.2020.10.13.19.11.27; Tue, 13 Oct 2020 19:11:49 -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=@kernel.org header.s=default header.b=k0I7jHwV; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389660AbgJMQWX (ORCPT + 99 others); Tue, 13 Oct 2020 12:22:23 -0400 Received: from mail.kernel.org ([198.145.29.99]:42766 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389406AbgJMQWX (ORCPT ); Tue, 13 Oct 2020 12:22:23 -0400 Received: from quaco.ghostprotocols.net (unknown [179.97.37.151]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 757E125271; Tue, 13 Oct 2020 16:22:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602606142; bh=WdHLl7lvBHFeej18gwouWeuZ//ygU1XtG9PhW9+5VTs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=k0I7jHwVtd46K7kY+jW6NyImvbi0Kgl4Dilkr7xrKPXLmAHEhaSy8jtUTGipEll0E Uist+XzE9Q4vO1E4bvzbOXdrLvZ8AijxAVa+otbPNTbgdmbMFFlVx1/yjIUJbXDz4P 0xRdl9vFtpZT3qQ/JvOrikCI6LSKPvte7bL8/o24= Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id 853B74047F; Tue, 13 Oct 2020 13:22:20 -0300 (-03) Date: Tue, 13 Oct 2020 13:22:20 -0300 From: Arnaldo Carvalho de Melo To: Alexey Budankov Cc: Andi Kleen , Jiri Olsa , Namhyung Kim , Alexander Shishkin , Adrian Hunter , Peter Zijlstra , Ingo Molnar , linux-kernel Subject: Re: [PATCH v1 03/15] perf data: open data directory in read access mode Message-ID: <20201013162220.GK1063281@kernel.org> References: <810f3a69-0004-9dff-a911-b7ff97220ae0@linux.intel.com> <9ac7f12e-f5a4-dd91-a19a-bb7e5be27636@linux.intel.com> <20201012160339.GB466880@tassilo.jf.intel.com> <49bfe810-f1cc-b1c6-67d3-b0a746552fd6@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <49bfe810-f1cc-b1c6-67d3-b0a746552fd6@linux.intel.com> X-Url: http://acmel.wordpress.com Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Mon, Oct 12, 2020 at 07:52:33PM +0300, Alexey Budankov escreveu: > > On 12.10.2020 19:03, Andi Kleen wrote: > > On Mon, Oct 12, 2020 at 11:55:07AM +0300, Alexey Budankov wrote: > >> > >> Open files located at data directory in case of read access mode. > > > > Need some rationale. Is this a bug fix? Did the case not matter > > before? > > This is not a bug fix. The case didn't matter before. In such cases can you please write a paragraph explaining why it didn't matter before and now it is required? - Arnaldo > > >> > >> 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 > > Alexei > -- - Arnaldo