linux-perf: Remove remaining source filenames from executable
authorBen Hutchings <benh@debian.org>
Mon, 29 May 2023 22:16:39 +0000 (00:16 +0200)
committerSalvatore Bonaccorso <carnil@debian.org>
Fri, 25 Apr 2025 15:07:45 +0000 (17:07 +0200)
When we build perf with -ffile-prefix-map, there are still 2
source directory names embedded in the executable:

1. The Documentation subdirectory, used as a fallback from the
   installed location.
2. The python subdirectory, used in the Python script test.

Remove (1) since it is an unnecessary fallback.  Change (2)
to the installed location.

Gbp-Pq: Topic debian
Gbp-Pq: Name linux-perf-remove-remaining-source-filenames-from-executable.patch

tools/perf/Build
tools/perf/builtin-report.c
tools/perf/tests/Build

index 3e486f7df94bb5f669c500609c84e20e5fbb75e2..5230df4d5a77e7aca5e037212449b7f13146d46c 100644 (file)
@@ -52,7 +52,7 @@ CFLAGS_perf.o              += -DPERF_HTML_PATH="BUILD_STR($(htmldir_SQ))"     \
                              -DPREFIX="BUILD_STR($(prefix_SQ))"
 CFLAGS_builtin-trace.o    += -DSTRACE_GROUPS_DIR="BUILD_STR($(STRACE_GROUPS_DIR_SQ))"
 CFLAGS_builtin-report.o           += -DTIPDIR="BUILD_STR($(tipdir_SQ))"
-CFLAGS_builtin-report.o           += -DDOCDIR="BUILD_STR($(srcdir_SQ)/Documentation)"
+#CFLAGS_builtin-report.o          += -DDOCDIR="BUILD_STR($(srcdir_SQ)/Documentation)"
 
 perf-util-y += util/
 perf-util-y += arch/
index 8700c39680662a2112b91b280611b62716daf532..b307a7d7dd9e8c1f101924e54efc712911d471f4 100644 (file)
@@ -662,10 +662,12 @@ static int report__browse_hists(struct report *rep)
 
        path = system_path(TIPDIR);
        if (perf_tip(&help, path) || help == NULL) {
+#if 0
                /* fallback for people who don't install perf ;-) */
                free(path);
                path = system_path(DOCDIR);
                if (perf_tip(&help, path) || help == NULL)
+#endif
                        help = strdup("Cannot load tips.txt file, please install perf!");
        }
        free(path);
index 5671ee53001959ed8e2ec4a0a8f479620e139d40..efcb1c283a41a1c43370bc02dbd33daaf4292de5 100644 (file)
@@ -73,7 +73,7 @@ perf-test-$(CONFIG_DWARF_UNWIND) += dwarf-unwind.o
 endif
 
 CFLAGS_attr.o         += -DBINDIR="BUILD_STR($(bindir_SQ))" -DPYTHON="BUILD_STR($(PYTHON_WORD))"
-CFLAGS_python-use.o   += -DPYTHONPATH="BUILD_STR($(OUTPUT)python)" -DPYTHON="BUILD_STR($(PYTHON_WORD))"
+CFLAGS_python-use.o   += -DPYTHONPATH="BUILD_STR($(perfexec_instdir_SQ)/scripts/python)" -DPYTHON="BUILD_STR($(PYTHON_WORD))"
 CFLAGS_dwarf-unwind.o += -fno-optimize-sibling-calls
 
 perf-test-y += workloads/