about summary refs log tree commit diff
path: root/third_party
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2020-07-13T16·19+0100
committertazjin <mail@tazj.in>2020-07-13T17·56+0000
commitf70afe61a4d4792fafd54e83dd80cfe7856836ed (patch)
tree83dfc52a875bce3546317443694b4fbee5b283c9 /third_party
parent4e52e2bd3d483430cd21e9d21570ee15024c223e (diff)
feat(3p/rr): Add ThreadRipper compatibility patch r/1273
Change-Id: Ia73883075e11bccaa234d3b1212f3ab9363f234c
Reviewed-on: https://cl.tvl.fyi/c/depot/+/1129
Tested-by: BuildkiteCI
Reviewed-by: lukegb <lukegb@tvl.fyi>
Diffstat (limited to 'third_party')
-rw-r--r--third_party/default.nix2
-rw-r--r--third_party/rr/0001-PerfCounters-don-t-exit-on-AMD-ThreadRipper-3960X.patch47
-rw-r--r--third_party/rr/default.nix7
3 files changed, 55 insertions, 1 deletions
diff --git a/third_party/default.nix b/third_party/default.nix
index 47f6ededecc7..b0f2e1bd43cc 100644
--- a/third_party/default.nix
+++ b/third_party/default.nix
@@ -205,7 +205,7 @@ in exposed.lib.fix(self: exposed // {
 
   # Packages to be overridden
   originals = {
-    inherit (nixpkgs) openldap go grpc notmuch;
+    inherit (nixpkgs) openldap go grpc notmuch rr;
     inherit (stableNixpkgs) git;
     ffmpeg = nixpkgs.ffmpeg-full;
   };
diff --git a/third_party/rr/0001-PerfCounters-don-t-exit-on-AMD-ThreadRipper-3960X.patch b/third_party/rr/0001-PerfCounters-don-t-exit-on-AMD-ThreadRipper-3960X.patch
new file mode 100644
index 000000000000..841840014757
--- /dev/null
+++ b/third_party/rr/0001-PerfCounters-don-t-exit-on-AMD-ThreadRipper-3960X.patch
@@ -0,0 +1,47 @@
+From 7f54898386f39b65fca902a39d39cd4c258960fd Mon Sep 17 00:00:00 2001
+From: Vincent Ambo <mail@tazj.in>
+Date: Mon, 13 Jul 2020 17:16:22 +0100
+Subject: [PATCH] PerfCounters: don't exit on AMD ThreadRipper 3960X
+
+Patch from
+https://github.com/mozilla/rr/issues/2034#issuecomment-581769936
+
+It's unclear whether this will actually make it work - the main issue
+seems to be that some complex tests are failing, but people are
+reporting that the debugger still works for some cases.
+---
+ src/PerfCounters.cc | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/PerfCounters.cc b/src/PerfCounters.cc
+index 7da26a51..1ca830a7 100644
+--- a/src/PerfCounters.cc
++++ b/src/PerfCounters.cc
+@@ -70,6 +70,7 @@ enum CpuMicroarch {
+   IntelCometlake,
+   AMDF15R30,
+   AMDRyzen,
++  AMDRyzen2,
+ };
+ 
+ /*
+@@ -137,6 +138,7 @@ static const PmuConfig pmu_configs[] = {
+   { AMDF15R30, "AMD Family 15h Revision 30h", 0xc4, 0xc6, 0, 250,
+     PMU_TICKS_TAKEN_BRANCHES | PMU_SKIP_INTEL_BUG_CHECK },
+   { AMDRyzen, "AMD Ryzen", 0x5100d1, 0, 0, 1000, PMU_TICKS_RCB },
++  { AMDRyzen2, "AMD Ryzen 2", 0xd1, 0, 0x2c, 2000, PMU_TICKS_RCB | PMU_SKIP_INTEL_BUG_CHECK },
+ };
+ 
+ #define RR_SKID_MAX 1000
+@@ -227,6 +229,8 @@ static CpuMicroarch get_cpu_microarch() {
+ 	return IntelCometlake;
+     case 0x30f00:
+       return AMDF15R30;
++    case 0x30f10: // AMD Ryzen Threadripper 3960X
++      return AMDRyzen2;
+     case 0x00f10:
+       if (ext_family == 8) {
+         if (!Flags::get().suppress_environment_warnings) {
+-- 
+2.23.0
+
diff --git a/third_party/rr/default.nix b/third_party/rr/default.nix
new file mode 100644
index 000000000000..9c164a36fdde
--- /dev/null
+++ b/third_party/rr/default.nix
@@ -0,0 +1,7 @@
+{ pkgs, ... }:
+
+pkgs.originals.rr.overrideAttrs(_: {
+  patches = [
+    ./0001-PerfCounters-don-t-exit-on-AMD-ThreadRipper-3960X.patch
+  ];
+})