As my first contribution to Linux I added support for showing readable Rust symbols in Linux’s
perf performance counter profiling tool. If you are doing performance-related work in Rust on Linux you want this patch.
For some examples of what
perf is useful for, here is
perf showing relative amount of time spent in individual functions:
And at the machine instruction level, inline with the source code:
Here are the steps for cloning and building
perf with my patch. Note that the build requires about 500 MB of disk space.
git init perf-core cd perf-core/ git remote add tip git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip git config core.sparsecheckout true cat > .git/info/sparse-checkout << SPARSE include/* tools/arch/* tools/build/* tools/include/* tools/lib/* tools/perf/* tools/scripts/* SPARSE git pull --depth=1 tip perf/core cd tools/perf/ CC=gcc make
make command will tell you which development headers you need to install. Just keep trying until you get it right. I had to install binutils-dev, libaudit-dev, libdw-dev, libelf-dev, libgtk2.0-dev, libiberty-dev, liblzma-dev, libnuma-dev, libperl-dev, libslang2-dev, libunwind8-dev. There may have been others that I already had installed.