Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3329440pxj; Mon, 24 May 2021 04:20:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzh9nboTkd1CGGmgbDAF8XNHs0yWQWbOLV1OERU3ouJmZBisloHPsFmSrTjzcjrGGtVnLpo X-Received: by 2002:a17:907:7749:: with SMTP id kx9mr23268821ejc.90.1621855223280; Mon, 24 May 2021 04:20:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621855223; cv=none; d=google.com; s=arc-20160816; b=ucxSDFaPWilhlwDXtJqUQbgJYQ7mdsAG2KIfDhXOFz6JXsuSYbfMq4BQ3JKQX6tf56 i1jHRb3wkp9SZRleC+plPo37MZ8mL6H900nwPIiO4WW7rCl3RGMY/BGOG7UMx06F46Ey /BAMPeE9Dw308IwQ/KmDCKAVTSCrAuEwHudkD+bOZ4WIDTq1M7Eyy1yRELGuaaeAtM1v Iti4EYVVjMbSgKyiCDoYsDRQqs2d/kTcpu0iuTRWCt8y3XWd+UhYsw/PQ7w+1tDwM1TZ DuFxxSQK9SVgJ843+ur8e3HDpgGjay7Gox8KQQRqLiAJbcV1cnxKswa+kc3OO7j886+F tQzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:to:from :ironport-hdrordr:ironport-data:dkim-signature; bh=GlDvcqeT1U722BzY6/pTkgszgEVfqg1qctJgWYp+T+0=; b=ypYZK6V2kIkhxjOJ8j5WGU1AtyEt/AGmYRGNGuqwtsnTa6VPLmsNjabdoq1KcTHlq8 GOgQuHuDqZ6J0I7UDtlTueK71Rxg5vmanOk0O3+jOGGWnRXRsBCPxEIDLzbwCBVqPpes /OIFGZzeoa7vTONUU5ZrEEeHtDH+/6ehQt1zHJqm/KtAlPKON6P2pX+KFfzjkrlsTgVb i86EBdZrW7m2573WEbP0pSwEBrEVXidblbPu8d1zbzcwH2q6iHl/JJ27bxSW/HT0zNR1 zgdeM8gzw0mbcEidLJKSHI0fglppuDi/360J+PlbbZ4YZcOouZfN6nkcv4CVKzzTXZrz TRuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cisco.com header.s=iport header.b=ClUcGhRr; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=cisco.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m9si14055910ejj.467.2021.05.24.04.20.00; Mon, 24 May 2021 04:20:23 -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=@cisco.com header.s=iport header.b=ClUcGhRr; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=cisco.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232795AbhEXLRD (ORCPT + 99 others); Mon, 24 May 2021 07:17:03 -0400 Received: from alln-iport-1.cisco.com ([173.37.142.88]:13883 "EHLO alln-iport-1.cisco.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232777AbhEXLQo (ORCPT ); Mon, 24 May 2021 07:16:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=3312; q=dns/txt; s=iport; t=1621854916; x=1623064516; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=JFjfl4xJfPfBHw99z86+v8NqOKExMrnDkDvZI6epnsk=; b=ClUcGhRrQVTh35gwh7Q9fC5SsxJCFH5LYwi1RjIR9Z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qjejK9Qv5X4YJHZWi+/JqiUHVzWsWYDUfUVarqP+1h1T4QNJeM EwX+ywGqak06VztT9/hUhn+q3mB1jYaUt9QAvA85ymOx7DS7gLfAXILJhZIY9krnMw7Xzon0 hmOhdyBLSRirLCPW1qc8LmOpD+/MCRTKnUNDQcBRBEGpcP+vIU6iB7nR8xmVqWyi7XI9SrY2 TuGqm01gK8eyJ5N3KSg9leBiDWpznTUcuIrzgjmYFyH6TpzWJaeZLLx0nPxsNlBLK/MGzFto 0M4d9iiAPEmVM/XzXHdHr1SQNlF9N7eamyA3gUH840JsmXzpCb5Lei89RknfB8xWvvobwMFd 6M6Vel53p5YPHKwYbRwZepd4Ox1kPCwTLwJuh0oB+eij7BrfwOBuSppf0PVjwgBcXTAc4liY v93ku71UB727JiLKhLtG4/xNpdwnEgDKZv7H8yT8vhe+eP2iISppVI53L2mMLlRAESs/ly9z jqjH5HiJ+h3CbenOXCHreb/03hXfSBT6W/KRzx/L77ffVUO9JAJIP7KyrRpQJ1+g6lQjY/1E oKVCxIGkgGm7UAr3T6iNyE4AJuyDMkXkJ7OFXF1Vbpe8yN7MdjHAWZ2X8ZfQITLA8QznKYoE KFdI5vo7zYmYm2vxgnxpKLV9ORKHClHTyrVV8Z5SFDTp6JdejE= IronPort-HdrOrdr: A9a23:CIppnKij7UP2MHy/CnLutxDU53BQXtsji2hC6mlwRA09TyX+rb HLoB1173HJYVoqNU3I3OrwW5VoIkmskKKdn7NxAV7KZmCP0wGVxcNZnOnfKlbbdBEWmNQw6U 4ZSchD4BmaNykdsS48izPIdOod/A== X-IronPort-Anti-Spam-Filtered: true X-IronPort-AV: E=Sophos;i="5.82,319,1613433600"; d="scan'208";a="697150789" Received: from rcdn-core-8.cisco.com ([173.37.93.144]) by alln-iport-1.cisco.com with ESMTP/TLS/DHE-RSA-SEED-SHA; 24 May 2021 11:15:15 +0000 Received: from sjc-ads-9103.cisco.com (sjc-ads-9103.cisco.com [10.30.208.113]) by rcdn-core-8.cisco.com (8.15.2/8.15.2) with ESMTPS id 14OBFE27012694 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 24 May 2021 11:15:14 GMT Received: by sjc-ads-9103.cisco.com (Postfix, from userid 487941) id 350EBCC1254; Mon, 24 May 2021 04:15:14 -0700 (PDT) From: Denys Zagorui To: jolsa@redhat.com, linux-kernel@vger.kernel.org, peterz@infradead.org, mingo@redhat.com, acme@kernel.org, mark.rutland@arm.com, alexander.shishkin@linux.intel.com, namhyung@kernel.org Subject: [PATCH v8 3/3] perf parse-events: add bison --file-prefix-map option Date: Mon, 24 May 2021 04:15:14 -0700 Message-Id: <20210524111514.65713-3-dzagorui@cisco.com> X-Mailer: git-send-email 2.26.2.Cisco In-Reply-To: <20210524111514.65713-1-dzagorui@cisco.com> References: <20210524111514.65713-1-dzagorui@cisco.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Outbound-SMTP-Client: 10.30.208.113, sjc-ads-9103.cisco.com X-Outbound-Node: rcdn-core-8.cisco.com Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org During perf build with O= bison stores full paths in generated files and those paths are stored in resulting perf binary. Starting from v3.7.1. those paths can be remapped by using --file-prefix-map option. Use this option if it possible to make perf binary more reproducible. Signed-off-by: Denys Zagorui --- tools/perf/Makefile.config | 9 +++++++++ tools/perf/util/Build | 6 +++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config index 406a9519145e..dacd16874d3d 100644 --- a/tools/perf/Makefile.config +++ b/tools/perf/Makefile.config @@ -202,6 +202,12 @@ ifeq ($(call get-executable,$(BISON)),) dummy := $(error Error: $(BISON) is missing on this system, please install it) endif +ifneq ($(OUTPUT),) + ifeq ($(shell expr $(shell $(BISON) --version | grep bison | sed -e 's/.\+ \([0-9]\+\).\([0-9]\+\).\([0-9]\+\)/\1\2\3/g') \>\= 371), 1) + BISON_FILE_PREFIX_MAP := --file-prefix-map=$(OUTPUT)= + endif +endif + # Treat warnings as errors unless directed not to ifneq ($(WERROR),0) CORE_CFLAGS += -Werror @@ -1228,6 +1234,9 @@ $(call detected_var,LIBDIR) $(call detected_var,GTK_CFLAGS) $(call detected_var,PERL_EMBED_CCOPTS) $(call detected_var,PYTHON_EMBED_CCOPTS) +ifneq ($(BISON_FILE_PREFIX_MAP),) +$(call detected_var,BISON_FILE_PREFIX_MAP) +endif # re-generate FEATURE-DUMP as we may have called feature_check, found out # extra libraries to add to LDFLAGS of some other test and then redo those diff --git a/tools/perf/util/Build b/tools/perf/util/Build index b64bdc1a7026..95e15d1035ab 100644 --- a/tools/perf/util/Build +++ b/tools/perf/util/Build @@ -216,7 +216,7 @@ $(OUTPUT)util/parse-events-flex.c $(OUTPUT)util/parse-events-flex.h: util/parse- $(OUTPUT)util/parse-events-bison.c $(OUTPUT)util/parse-events-bison.h: util/parse-events.y $(call rule_mkdir) - $(Q)$(call echo-cmd,bison)$(BISON) -v $< -d $(PARSER_DEBUG_BISON) \ + $(Q)$(call echo-cmd,bison)$(BISON) -v $< -d $(PARSER_DEBUG_BISON) $(BISON_FILE_PREFIX_MAP) \ -o $(OUTPUT)util/parse-events-bison.c -p parse_events_ $(OUTPUT)util/expr-flex.c $(OUTPUT)util/expr-flex.h: util/expr.l $(OUTPUT)util/expr-bison.c @@ -226,7 +226,7 @@ $(OUTPUT)util/expr-flex.c $(OUTPUT)util/expr-flex.h: util/expr.l $(OUTPUT)util/e $(OUTPUT)util/expr-bison.c $(OUTPUT)util/expr-bison.h: util/expr.y $(call rule_mkdir) - $(Q)$(call echo-cmd,bison)$(BISON) -v $< -d $(PARSER_DEBUG_BISON) \ + $(Q)$(call echo-cmd,bison)$(BISON) -v $< -d $(PARSER_DEBUG_BISON) $(BISON_FILE_PREFIX_MAP) \ -o $(OUTPUT)util/expr-bison.c -p expr_ $(OUTPUT)util/pmu-flex.c $(OUTPUT)util/pmu-flex.h: util/pmu.l $(OUTPUT)util/pmu-bison.c @@ -236,7 +236,7 @@ $(OUTPUT)util/pmu-flex.c $(OUTPUT)util/pmu-flex.h: util/pmu.l $(OUTPUT)util/pmu- $(OUTPUT)util/pmu-bison.c $(OUTPUT)util/pmu-bison.h: util/pmu.y $(call rule_mkdir) - $(Q)$(call echo-cmd,bison)$(BISON) -v $< -d $(PARSER_DEBUG_BISON) \ + $(Q)$(call echo-cmd,bison)$(BISON) -v $< -d $(PARSER_DEBUG_BISON) $(BISON_FILE_PREFIX_MAP) \ -o $(OUTPUT)util/pmu-bison.c -p perf_pmu_ FLEX_GE_26 := $(shell expr $(shell $(FLEX) --version | sed -e 's/flex \([0-9]\+\).\([0-9]\+\)/\1\2/g') \>\= 26) -- 2.26.2.Cisco