Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

perf parse-events: Add bison --file-prefix-map option

During a perf build with O= bison stores full paths in generated files
and those paths are stored in resulting perf binary.

Starting from bison v3.7.1 those paths can be remapped by using the
--file-prefix-map option. Use this option if possible to make perf
binary more reproducible.

Signed-off-by: Denys Zagorui <dzagorui@cisco.com>
Acked-by: Jiri Olsa <jolsa@redhat.com>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: https://lore.kernel.org/r/20210524111514.65713-3-dzagorui@cisco.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

authored by

Denys Zagorui and committed by
Arnaldo Carvalho de Melo
6793672a f7fc0d1c

+12 -3
+9
tools/perf/Makefile.config
··· 202 202 dummy := $(error Error: $(BISON) is missing on this system, please install it) 203 203 endif 204 204 205 + ifneq ($(OUTPUT),) 206 + ifeq ($(shell expr $(shell $(BISON) --version | grep bison | sed -e 's/.\+ \([0-9]\+\).\([0-9]\+\).\([0-9]\+\)/\1\2\3/g') \>\= 371), 1) 207 + BISON_FILE_PREFIX_MAP := --file-prefix-map=$(OUTPUT)= 208 + endif 209 + endif 210 + 205 211 # Treat warnings as errors unless directed not to 206 212 ifneq ($(WERROR),0) 207 213 CORE_CFLAGS += -Werror ··· 1234 1228 $(call detected_var,GTK_CFLAGS) 1235 1229 $(call detected_var,PERL_EMBED_CCOPTS) 1236 1230 $(call detected_var,PYTHON_EMBED_CCOPTS) 1231 + ifneq ($(BISON_FILE_PREFIX_MAP),) 1232 + $(call detected_var,BISON_FILE_PREFIX_MAP) 1233 + endif 1237 1234 1238 1235 # re-generate FEATURE-DUMP as we may have called feature_check, found out 1239 1236 # extra libraries to add to LDFLAGS of some other test and then redo those
+3 -3
tools/perf/util/Build
··· 216 216 217 217 $(OUTPUT)util/parse-events-bison.c $(OUTPUT)util/parse-events-bison.h: util/parse-events.y 218 218 $(call rule_mkdir) 219 - $(Q)$(call echo-cmd,bison)$(BISON) -v $< -d $(PARSER_DEBUG_BISON) \ 219 + $(Q)$(call echo-cmd,bison)$(BISON) -v $< -d $(PARSER_DEBUG_BISON) $(BISON_FILE_PREFIX_MAP) \ 220 220 -o $(OUTPUT)util/parse-events-bison.c -p parse_events_ 221 221 222 222 $(OUTPUT)util/expr-flex.c $(OUTPUT)util/expr-flex.h: util/expr.l $(OUTPUT)util/expr-bison.c ··· 226 226 227 227 $(OUTPUT)util/expr-bison.c $(OUTPUT)util/expr-bison.h: util/expr.y 228 228 $(call rule_mkdir) 229 - $(Q)$(call echo-cmd,bison)$(BISON) -v $< -d $(PARSER_DEBUG_BISON) \ 229 + $(Q)$(call echo-cmd,bison)$(BISON) -v $< -d $(PARSER_DEBUG_BISON) $(BISON_FILE_PREFIX_MAP) \ 230 230 -o $(OUTPUT)util/expr-bison.c -p expr_ 231 231 232 232 $(OUTPUT)util/pmu-flex.c $(OUTPUT)util/pmu-flex.h: util/pmu.l $(OUTPUT)util/pmu-bison.c ··· 236 236 237 237 $(OUTPUT)util/pmu-bison.c $(OUTPUT)util/pmu-bison.h: util/pmu.y 238 238 $(call rule_mkdir) 239 - $(Q)$(call echo-cmd,bison)$(BISON) -v $< -d $(PARSER_DEBUG_BISON) \ 239 + $(Q)$(call echo-cmd,bison)$(BISON) -v $< -d $(PARSER_DEBUG_BISON) $(BISON_FILE_PREFIX_MAP) \ 240 240 -o $(OUTPUT)util/pmu-bison.c -p perf_pmu_ 241 241 242 242 FLEX_GE_26 := $(shell expr $(shell $(FLEX) --version | sed -e 's/flex \([0-9]\+\).\([0-9]\+\)/\1\2/g') \>\= 26)