Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1402998pxj; Fri, 21 May 2021 13:23:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxiZJPuVBZwdqVvo5icikzQCGAK/npN98ZtXFi+QZoDVAW4ZmPuxNorlWgbqooV0UmjDFnW X-Received: by 2002:a05:6e02:be8:: with SMTP id d8mr660242ilu.63.1621628634731; Fri, 21 May 2021 13:23:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621628634; cv=none; d=google.com; s=arc-20160816; b=dykECxQe4iyulpdrX30Trk3k6exFQKGksNAvHeFAHr20trYrd6nw2bZYDZPo+aFrL4 xElVr9Pr0ta7rizsQ1Itjd2aTyMaa9DtNRCgmBXwAaIteDIUKpe4AYhO1zdLmDHbCXVv sx8/hi8n6uFfkMOGelT2URbcKzIpB2pkZVnGf4uuX+8RYdqk5Bk1KjJihvmsHNG+YXUU Dzxcnab8yYe7ozisShMSn7WTyvUg/zY+LV3CAEDdBEAWG8JF9jnw+POVNzj+iS2HoS2c 1TY+mRdHHxCKz2GZginL23+ziOaUQKpA4ynkWdwaNKO06tSU0m8AObX/rNVxC8LSi/kO znOA== 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=0SxSZaoTuprdgJmu4ZvW3dApya/9rjpiuKzdoUJOn9AUCEoTBC7ydRX+kJ/iztVpQ7 /twK7xPSOvuvbus1H6wBsiKexvfVjYUYneTiCMV8WFTkqsj4xlQFpoGrfexHfANweUFY MapzVH4i268ILnfiHzxnhMrxA/a1XkwjMwVKBqUTuTytveoaj1InL+HA0guPUykX0sTt 7Wzx0T0AXUvhd2sGmfOky/CeC0MTWjhS4UfhgsdqHiinJQWHMuuD6EFOfO36oRGNaQm7 QAfKCHfqhtVTvyS45SfXulU+HS4/sHz38oRSTy/raIsgCGX4rS12KI6Lr5c5uIvvqKnH E4BA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cisco.com header.s=iport header.b=ME9B4oRQ; 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 b18si7132144ile.24.2021.05.21.13.23.42; Fri, 21 May 2021 13:23:54 -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=ME9B4oRQ; 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 S232299AbhEUR3U (ORCPT + 99 others); Fri, 21 May 2021 13:29:20 -0400 Received: from alln-iport-2.cisco.com ([173.37.142.89]:12233 "EHLO alln-iport-2.cisco.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232068AbhEUR3S (ORCPT ); Fri, 21 May 2021 13:29:18 -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=1621618075; x=1622827675; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=JFjfl4xJfPfBHw99z86+v8NqOKExMrnDkDvZI6epnsk=; b=ME9B4oRQqShBKB07Uj6jqQedmEGz+17JDS7MOP+pifvxCRBHVSrDeXPS tk6CZ2dh9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ioYDxh+fVK/rOmwjEKzQZREK 00P+ikvq4A29Uq2Xp/8WQG1pDiPuRt0c9xZFu0r9QeC4qnZ+QCUAi4DVDEpQNUtscIeRjEw0 FKN2dTzClRHqLCJRGiP3raSoym7NSUcISkFfyBsZQ4M+dqlupwvihvJQv5qCqvzhdrwcQwc2 BiDqCw4wr4Ul8NOh+Ow/EvMhHSnoZ2hohMJChv/Rz6LwSJWddCff42H2FjkytJ/D62odwzU1 JQboPRy/NziHLnUynbUHbVTRO70jxqWGGaH2Q81T/HN4xzoqiD9Id0MiN1rDBoxWvvobwMFd 6M6Vel5zZtXMX3CgURfPN/pU55CIUQN6b3Yuh38Z95KZN16cxWKuXEGia+sM4LFzRNEfUIXY MrznSOQ4ZAyVfwPIN2eHLp17FPT7npirV4/vLiip/hd7VZ7WJJzYelbWLdpRr5ghJ5oXC2Om zqiH5LQkk4GALGWjtf/r9BMRbz1EZTLLcmm95MIHgJyCiFnA2omQ8TA2q8sfpcNokimvraVo SvjCydlJK7ErSCWcm2iNyE8AI4DqL4i9BrXywR3ZQb2s5XiCK7yhJoim2wfLeh/qLM7laYqJ xTHEu3Zaslypv3802x1RfHAQEZKLXxHWSrm0/KZXQUC IronPort-HdrOrdr: A9a23:9zUCZqoQtgfEoGx8jp7tfjEaV5oqeYIsimQD101hICG9Ffbo8/ xG88506faZslsssTQb6LO90cq7MBbhHOBOgLX5VI3KNGKNhILrFvAB0WKI+VLd8kPFmtK1rZ 0BT0C7Y+eAa2STSq3BkW6FL+o= X-IronPort-Anti-Spam-Filtered: true X-IronPort-AV: E=Sophos;i="5.82,319,1613433600"; d="scan'208";a="722938239" Received: from alln-core-8.cisco.com ([173.36.13.141]) by alln-iport-2.cisco.com with ESMTP/TLS/DHE-RSA-SEED-SHA; 21 May 2021 17:27:54 +0000 Received: from sjc-ads-9103.cisco.com (sjc-ads-9103.cisco.com [10.30.208.113]) by alln-core-8.cisco.com (8.15.2/8.15.2) with ESMTPS id 14LHRsrc004198 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 21 May 2021 17:27:54 GMT Received: by sjc-ads-9103.cisco.com (Postfix, from userid 487941) id 092AFCC1254; Fri, 21 May 2021 10:27:54 -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 v6 3/3] perf parse-events: add bison --file-prefix-map option Date: Fri, 21 May 2021 10:27:53 -0700 Message-Id: <20210521172753.55399-3-dzagorui@cisco.com> X-Mailer: git-send-email 2.26.2.Cisco In-Reply-To: <20210521172753.55399-1-dzagorui@cisco.com> References: <20210521172753.55399-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: alln-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