Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3247338pxb; Fri, 12 Feb 2021 13:09:52 -0800 (PST) X-Google-Smtp-Source: ABdhPJw5UmensqiKU+3wytZ1QIOeE+i0ubRMgv8HQRmas8Xj522HdB5Xyx5bwVWPKfvB23/7AuB3 X-Received: by 2002:a05:6402:125a:: with SMTP id l26mr5467113edw.188.1613164192109; Fri, 12 Feb 2021 13:09:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613164192; cv=none; d=google.com; s=arc-20160816; b=0k5WzHCUFZDUvzb+bAq7h4JKqHPFKUiUn+iscxHzAlrCAzNr9MqLMijZ4tZsfF9oNF 7XHiokEhKUhbf38zxzJjpetSrw/IamVoPdNKPCyN0mFt351VdwIGDgKsQ1dQaO6sRumk 5ThlaHOy35sSKQUejf991mfoZDSVhwK8FKfIuJWyNbiu2ndlTMIbHVJqKBgcGPenYZxd dooGy8Eeg+UuQwWwyBjQgqF3jLQfNC5KzVvgclvd3CpZh0SOcC3lSyl8b667onQonmLD hZ39r/KC86akCzH+JyAdcKQipekZCrXAfy9iOIQ6i+vgB7GeaMNZxBJDYisMo2VoQGJ0 BJtQ== 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=my2fFy8yrHE32P75Yd5xj2W+kLjGw0vVIpl5Jm9VXuo=; b=I4lLACIM/yCgeh9hZgzwOICRIb5GC++9c08vPrVK0hxSSzG74WhQj0x8GB5ZqACUC+ sv1TtGUkciKbyJaDVF/Mzm3AymMwF+wvKqEZpDjW5etMCOUzG2ljvuJMhu4jRKqnWiTO RJOQB3K30QJ0UyVXR4tsFkZKplh+YKeYOV39n0oL0p9C/Q/vc5NtEf9pjkelBzawGo6T zUPtfAtOO1hJZj44SXxpfH2YMcYoikyuXnPcipdBtKdhhGM7cr4C5FM9jZPbBjNBDd+j 5jXombU+Wty3cQOSH5XuFjdu60IHJvUnXrqZG4dolB5q5duuPLbsHnXrb12EeRoJhNZ2 Fw7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=YsAbrkQE; 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 f19si6830658edw.370.2021.02.12.13.09.28; Fri, 12 Feb 2021 13:09:52 -0800 (PST) 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=k20201202 header.b=YsAbrkQE; 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 S231513AbhBLVIZ (ORCPT + 99 others); Fri, 12 Feb 2021 16:08:25 -0500 Received: from mail.kernel.org ([198.145.29.99]:58630 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231830AbhBLVIS (ORCPT ); Fri, 12 Feb 2021 16:08:18 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6E0A764E05; Fri, 12 Feb 2021 21:07:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1613164057; bh=0Z6o3IjOByHGdRgIp6J7ZzM78Yts8YPv+8j0VQbytYg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=YsAbrkQEU3mgUUY2bDcfB7ypftxBmU/K7S//Bf2Hp+zu6jewvY93Hlg4/d3BYpRLQ 7jGTLNTYqpFWGjxKRPKaG+GUVtRNv63Pi+xlxa0Al/CuxUpdpHJoCIWWoq6HilzlxW wjW/xOuFP1n8BMsdZRc/1jh/tRFRV5nfRZ1lK0zOgQedwumHu16D4vnzfZuU82qoAm cFaK9hJBFG7gjLgd84JrGpphnWgCYpueamOY7riTI43ivBgCaRRgGhbb0E7ljOZZ2F EbSA7PH2LlH7EJ/oEVOm0ACNhCXOHfOOPYW07hQnFu6ngoDUFWYa9mIYbXnesIcAJj 5qDzHfM7Ontzw== Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id BD20F40513; Fri, 12 Feb 2021 18:07:34 -0300 (-03) Date: Fri, 12 Feb 2021 18:07:34 -0300 From: Arnaldo Carvalho de Melo To: Nicholas Fraser Cc: Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Ian Rogers , "Frank Ch. Eigler" , Song Liu , Adrian Hunter , Kim Phillips , Tommi Rantala , Remi Bernon , linux-kernel@vger.kernel.org, Ulrich Czekalla , Huw Davies Subject: Re: [PATCH 3/4] perf archive: Fix filtering of empty build-ids Message-ID: <20210212210734.GK1398414@kernel.org> References: <7708cca1-b8f6-c394-75f1-5f9681d625d0@codeweavers.com> <20210212122901.GB1398414@kernel.org> <8f50e586-ae58-ef4e-a594-e2248203a2a7@codeweavers.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8f50e586-ae58-ef4e-a594-e2248203a2a7@codeweavers.com> X-Url: http://acmel.wordpress.com Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Fri, Feb 12, 2021 at 01:49:36PM -0500, Nicholas Fraser escreveu: > The current version of "perf buildid-list" prints missing build-ids as > blank even when loading perf.data files generated from older versions of > perf. I've tested with a few older versions. > > Since perf-archive is an external script that calls back into perf, it > could in theory find a different older version that still returns zeroes. > We could make it look for a matching perf, e.g. "$(dirname "$0")/perf". > Unfortunately that won't work in general because at least on my system > perf-archive is installed to a different path than perf. It shouldn't try to find a "matching perf" as the userspace perf is not in lockstep with the kernel perf subsystem :-) If a current 'perf archive' is called on some perf.data file, it should know that a zero-filled or a blank filled build-id means the same and act accordingly. - Arnaldo > Nick > > > On 2021-02-12 7:29 a.m., Arnaldo Carvalho de Melo wrote: > > Em Wed, Feb 10, 2021 at 02:17:49PM -0500, Nicholas Fraser escreveu: > >> A non-existent build-id used to be treated as all-zero SHA-1 hash. > >> Build-ids are now variable width. A non-existent build-id is an empty > >> string and "perf buildid-list" pads this with spaces. > >> > >> This fixes "perf-archive" to skip missing build-ids by skipping lines > >> that start with a padding space rather than with zeroes. > >> > >> Signed-off-by: Nicholas Fraser > >> --- > >> tools/perf/perf-archive.sh | 3 +-- > >> 1 file changed, 1 insertion(+), 2 deletions(-) > >> > >> diff --git a/tools/perf/perf-archive.sh b/tools/perf/perf-archive.sh > >> index 0cfb3e2cefef..133f0eddbcc4 100644 > >> --- a/tools/perf/perf-archive.sh > >> +++ b/tools/perf/perf-archive.sh > >> @@ -20,9 +20,8 @@ else > >> fi > >> > >> BUILDIDS=$(mktemp /tmp/perf-archive-buildids.XXXXXX) > >> -NOBUILDID=0000000000000000000000000000000000000000 > >> > >> -perf buildid-list -i $PERF_DATA --with-hits | grep -v "^$NOBUILDID " > $BUILDIDS > >> +perf buildid-list -i $PERF_DATA --with-hits | grep -v "^ " > $BUILDIDS > >> if [ ! -s $BUILDIDS ] ; then > >> echo "perf archive: no build-ids found" > >> rm $BUILDIDS || true > > > > What should we do when using older files? We have to support both cases. > > > > - Arnaldo > > -- - Arnaldo