Skip to content

Commit 63e9d1c

Browse files
committedJun 12, 2017
perf: Fix perf annotate
This command requires objdump, so make sure it can find it.
1 parent d8f2284 commit 63e9d1c

File tree

2 files changed

+21
-4
lines changed

2 files changed

+21
-4
lines changed
 
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
diff -ru -x '*~' linux-4.9.31-orig/tools/perf/util/annotate.c linux-4.9.31/tools/perf/util/annotate.c
2+
--- linux-4.9.31-orig/tools/perf/util/annotate.c 2017-06-07 12:08:04.000000000 +0200
3+
+++ linux-4.9.31/tools/perf/util/annotate.c 2017-06-12 13:10:08.811079574 +0200
4+
@@ -1350,7 +1350,7 @@
5+
"%s %s%s --start-address=0x%016" PRIx64
6+
" --stop-address=0x%016" PRIx64
7+
" -l -d %s %s -C %s 2>/dev/null|grep -v %s|expand",
8+
- objdump_path ? objdump_path : "objdump",
9+
+ objdump_path ? objdump_path : OBJDUMP_PATH,
10+
disassembler_style ? "-M " : "",
11+
disassembler_style ? disassembler_style : "",
12+
map__rip_2objdump(map, sym->start),

‎pkgs/os-specific/linux/kernel/perf.nix

+9-4
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ assert versionAtLeast kernel.version "3.12";
1111
stdenv.mkDerivation {
1212
name = "perf-linux-${kernel.version}";
1313

14-
inherit (kernel) src patches;
14+
inherit (kernel) src;
15+
16+
patches = kernel.patches ++ [ ./perf-binutils-path.patch ];
1517

1618
preConfigure = ''
1719
cd tools/perf
@@ -30,9 +32,12 @@ stdenv.mkDerivation {
3032

3133
# Note: we don't add elfutils to buildInputs, since it provides a
3234
# bad `ld' and other stuff.
33-
NIX_CFLAGS_COMPILE = [
34-
"-Wno-error=cpp" "-Wno-error=bool-compare" "-Wno-error=deprecated-declarations"
35-
]
35+
NIX_CFLAGS_COMPILE =
36+
[ "-Wno-error=cpp"
37+
"-Wno-error=bool-compare"
38+
"-Wno-error=deprecated-declarations"
39+
"-DOBJDUMP_PATH=\"${binutils}/bin/objdump\""
40+
]
3641
# gcc before 6 doesn't know these options
3742
++ stdenv.lib.optionals (hasPrefix "gcc-6" stdenv.cc.cc.name) [
3843
"-Wno-error=unused-const-variable" "-Wno-error=misleading-indentation"

0 commit comments

Comments
 (0)
Please sign in to comment.