Tested on Graviton2, ARM64, Ubuntu 22.04
git clone https://github.com/torvalds/linux.git # I did not have to match my kernel version to the source tree
cd tools/perf
sudo apt install make gcc flex bison pkg-config libzstd1 libdwarf-dev libdw-dev binutils-dev libcap-dev libelf-dev libnuma-dev python3 python3-dev python-setuptools libssl-dev libunwind-dev libdwarf-dev zlib1g-dev liblzma-dev libaio-dev libtraceevent-dev debuginfod libpfm4-dev libslang2-dev systemtap-sdt-dev libperl-dev binutils-dev libbabeltrace-dev libiberty-dev libzstd-dev python-dev-is-python3 libssl-dev python3-dev libpython3.10-dev libcapstone-dev
make # Ensure that all flags are turned on as necessary