summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2021-06-04 14:14:10 -0400
committerKent Overstreet <kent.overstreet@gmail.com>2021-06-04 14:26:33 -0400
commit51275f2bc38ab66c850c6834cccaa60fe2117603 (patch)
treeb115f294e246b1384a6b34776f2047649104e97e
parent1bde894ea5700a16b0d941bc9639daa47bbd5f1c (diff)
Add a helper for running perf
The new /usr/local/bin/perf runs the newest version of perf installed, instead of failing if it doesn't match the kernel version. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
-rwxr-xr-xlib/perf3
-rwxr-xr-xroot_image6
2 files changed, 8 insertions, 1 deletions
diff --git a/lib/perf b/lib/perf
new file mode 100755
index 0000000..10c56b8
--- /dev/null
+++ b/lib/perf
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+exec $(ls /usr/bin/perf_*|sort -Vr|head -n1) "$@"
diff --git a/root_image b/root_image
index a81dabb..07333ed 100755
--- a/root_image
+++ b/root_image
@@ -155,7 +155,7 @@ update_files()
install -m0644 "$ktest_dir/lib/fstab" "$MNT/etc/fstab"
install -m0755 "$ktest_dir/lib/rc.local" "$MNT/etc/rc.local"
install -m0755 "$ktest_dir/lib/rc-local.service" "$MNT/lib/systemd/system/rc-local.service"
- rm "$MNT/lib/systemd/system/rc-local.service.d/debian.conf"
+ rm -f "$MNT/lib/systemd/system/rc-local.service.d/debian.conf"
touch "$MNT/etc/resolv.conf"
chmod 644 "$MNT/etc/resolv.conf"
@@ -202,6 +202,10 @@ ZZ
rm -f "$MNT/lib/udev/rules.d/*hdparm*"
echo $(hostname)-kvm >"$MNT/etc/hostname"
+
+ # Use most recent version of perf installed, instead of failing if it
+ # doesn't match the kernel version:
+ install -m0755 "$ktest_dir/lib/perf" "$MNT/usr/local/bin/perf"
}
update_packages()