From d88bdd74b3f29953c470419b06ea4dde9bbc7d24 Mon Sep 17 00:00:00 2001 From: Vincent Li Date: Sat, 21 Dec 2024 18:00:47 -0800 Subject: [PATCH] perf: add linux perf tool Signed-off-by: Vincent Li --- config/rootfiles/common/loongarch64/linux | 1 + lfs/linux | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/config/rootfiles/common/loongarch64/linux b/config/rootfiles/common/loongarch64/linux index 683af41ba..21bb4918a 100644 --- a/config/rootfiles/common/loongarch64/linux +++ b/config/rootfiles/common/loongarch64/linux @@ -23752,3 +23752,4 @@ usr/lib/libcpupower.so.1 #usr/share/locale/ka/LC_MESSAGES/cpupower.mo #usr/share/locale/pt/LC_MESSAGES/cpupower.mo usr/sbin/bpftool +usr/sbin/perf diff --git a/lfs/linux b/lfs/linux index 92662fed5..54f5e22ae 100644 --- a/lfs/linux +++ b/lfs/linux @@ -184,6 +184,9 @@ endif cd $(DIR_APP)/tools/bpf/bpftool && sed -i -e 's/^prefix ?= \/usr\/local/prefix ?= \/usr/' Makefile cd $(DIR_APP)/tools/bpf/bpftool && make $(MAKETUNING) + # Build perf tool + cd $(DIR_APP)/tools/perf && NO_JEVENTS=1 NO_LIBTRACEEVENT=1 make $(MAKETUNING) + # Install the kernel cd $(DIR_APP) && cp -v arch/$(KERNEL_ARCH)/boot/$(KERNEL_TARGET) /boot/vmlinuz-$(KVER) cd $(DIR_APP) && cp -v System.map /boot/System.map-$(KVER) @@ -231,6 +234,9 @@ endif # Install bpftool cd $(DIR_APP)/tools/bpf/bpftool && make install + # Install perf tool + cd $(DIR_APP)/tools/perf && install -m 755 perf /usr/sbin/ + # Make sure we can build external modules touch -r /lib/modules/$(KVER)/build/Makefile \ /lib/modules/$(KVER)/build/include/generated/uapi/linux/version.h