Tiny Core Extensions > Extension requests
[Solved] Kernel tool: perf ?
polikuo:
Hi, I'm taking a course in school.
The teacher wants us to install "perf" to see how our coding performs.
I've seen posts about compiling one with no luck. (aarch64)
Most of them say make -C <kernel source root directory>/tools/perf would do the trick.
On some web pages I see java may be required. (keyword: export JDIR="/usr/lib/jvm/open-jdk")
Is it perhaps locked in the kernel ?
I've never successfully compiled a kernel before.
Or do you have it around in your kernel build directory ?
Juanito:
You don't need to compile the kernel, this worked for me:
--- Code: ---$ cd linux-5.4.3
$ make -C tools/perf
--- End code ---
It looks like you need compiletc elftools-dev openssl-1.1.1-dev perl5 liblzma-dev zstd-dev libcap-dev
You'll also need to add the arch specific flags.
polikuo:
--- Quote from: Juanito on October 07, 2020, 09:52:00 AM ---It looks like you need compiletc elftools-dev openssl-1.1.1-dev perl5 liblzma-dev zstd-dev libcap-dev
--- End quote ---
Which arch are you using ?
I don't see elftools-dev anywhere.
P.S. I'm using aarch64.
I don't have any other machine around right now.
Perhaps I should make a USB and boot into it :-\
Juanito:
I did a test on x86_64 - you need libelf-dev on aarch64
polikuo:
:(
--- Code: ---tc@box:/mnt/mmcblk0p2/compile/source_code/Kernel/linux-5.4.51$ tce-load -i compiletc libelf-dev openssl-dev perl5 liblzma-dev zstd-dev libcap-dev
compiletc is already installed!
libelf-dev is already installed!
openssl-dev is already installed!
perl5 is already installed!
liblzma-dev is already installed!
zstd-dev is already installed!
libcap-dev is already installed!
tc@box:/mnt/mmcblk0p2/compile/source_code/Kernel/linux-5.4.51$ CC="gcc -march=armv8-a+crc -mtune=cortex-a72 -Os -pipe"
tc@box:/mnt/mmcblk0p2/compile/source_code/Kernel/linux-5.4.51$ CXX="g++ -march=armv8-a+crc -mtune=cortex-a72 -Os -pipe -fno-exceptions -fno-rtti"
tc@box:/mnt/mmcblk0p2/compile/source_code/Kernel/linux-5.4.51$ LDFLAGS="-Wl,-O1"
tc@box:/mnt/mmcblk0p2/compile/source_code/Kernel/linux-5.4.51$ export CC CXX LDFLAGS
tc@box:/mnt/mmcblk0p2/compile/source_code/Kernel/linux-5.4.51$ make -C tools/perf
make: Entering directory '/mnt/mmcblk0p2/compile/source_code/Kernel/linux-5.4.51/tools/perf'
BUILD: Doing 'make -j4' parallel build
Warning: Kernel ABI header at 'tools/include/uapi/linux/kvm.h' differs from latest version at 'include/uapi/linux/kvm.h'
diff -u tools/include/uapi/linux/kvm.h include/uapi/linux/kvm.h
Warning: Kernel ABI header at 'tools/include/uapi/linux/sched.h' differs from latest version at 'include/uapi/linux/sched.h'
diff -u tools/include/uapi/linux/sched.h include/uapi/linux/sched.h
Warning: Kernel ABI header at 'tools/arch/x86/include/asm/cpufeatures.h' differs from latest version at 'arch/x86/include/asm/cpufeatures.h'
diff -u tools/arch/x86/include/asm/cpufeatures.h arch/x86/include/asm/cpufeatures.h
Warning: Kernel ABI header at 'tools/arch/x86/include/uapi/asm/unistd.h' differs from latest version at 'arch/x86/include/uapi/asm/unistd.h'
diff -u tools/arch/x86/include/uapi/asm/unistd.h arch/x86/include/uapi/asm/unistd.h
sh: command: line 1: illegal option -c
Auto-detecting system features:
... dwarf: [ OFF ]
... dwarf_getlocations: [ OFF ]
... glibc: [ on ]
... gtk2: [ OFF ]
... libaudit: [ OFF ]
... libbfd: [ on ]
... libcap: [ on ]
... libelf: [ on ]
... libnuma: [ OFF ]
... numa_num_possible_cpus: [ OFF ]
... libperl: [ OFF ]
... libpython: [ OFF ]
... libcrypto: [ on ]
... libunwind: [ OFF ]
... libdw-dwarf-unwind: [ OFF ]
... zlib: [ on ]
... lzma: [ on ]
... get_cpuid: [ OFF ]
... bpf: [ on ]
... libaio: [ on ]
... libzstd: [ on ]
... disassembler-four-args: [ on ]
Makefile.config:389: No libdw DWARF unwind found, Please install elfutils-devel/libdw-dev >= 0.158 and/or set LIBDW_DIR
Makefile.config:394: No libdw.h found or old libdw.h found or elfutils is older than 0.138, disables dwarf support. Please install new elfutils-devel/libdw-dev
Makefile.config:465: gelf_getnote() not found on libelf, SDT support disabled
Makefile.config:498: DWARF support is off, BPF prologue is disabled
Makefile.config:506: No sys/sdt.h found, no SDT events are defined, please install systemtap-sdt-devel or systemtap-sdt-dev
Makefile.config:554: No libunwind found. Please install libunwind-dev[el] >= 1.1 and/or set LIBUNWIND_DIR
Makefile.config:581: Disabling post unwind, no support found.
Makefile.config:662: slang not found, disables TUI support. Please install slang-devel, libslang-dev or libslang2-dev
Makefile.config:679: GTK2 not found, disables GTK2 support. Please install gtk2-devel or libgtk2.0-dev
Makefile.config:706: Missing perl devel files. Disabling perl scripting support, please install perl-ExtUtils-Embed/libperl-dev
Makefile.config:733: No python interpreter was found: disables Python support - please install python-devel/python-dev
Makefile.config:791: No bfd.h/libbfd found, please install binutils-dev[el]/zlib-static/libiberty-dev to gain symbol demangling
Makefile.config:859: No numa.h found, disables 'perf bench numa mem' benchmark, please install numactl-devel/libnuma-devel/libnuma-dev
Makefile.config:914: No libbabeltrace found, disables 'perf data' CTF format support, please install libbabeltrace-dev[el]/libbabeltrace-ctf-dev
Makefile.config:940: No alternatives command found, you need to set JDIR= to point to the root of your Java directory
DESCEND plugins
make[3]: Nothing to be done for 'plugins/libtraceevent-dynamic-list'.
GEN perf-archive
GEN perf-with-kcore
CC builtin-script.o
CC tests/builtin-test.o
CC util/annotate.o
LD bench/perf-in.o
ld: bench/futex-lock-pi.o:/mnt/mmcblk0p2/compile/source_code/Kernel/linux-5.4.51/tools/perf/bench/futex-lock-pi.c:40: multiple definition of `runtime'; bench/futex-hash.o:/mnt/mmcblk0p2/compile/source_code/Kernel/linux-5.4.51/tools/perf/bench/futex-hash.c:40: first defined here
ld: bench/futex-lock-pi.o:/mnt/mmcblk0p2/compile/source_code/Kernel/linux-5.4.51/tools/perf/bench/futex-lock-pi.c:40: multiple definition of `end'; bench/futex-hash.o:/mnt/mmcblk0p2/compile/source_code/Kernel/linux-5.4.51/tools/perf/bench/futex-hash.c:40: first defined here
ld: bench/futex-lock-pi.o:/mnt/mmcblk0p2/compile/source_code/Kernel/linux-5.4.51/tools/perf/bench/futex-lock-pi.c:40: multiple definition of `start'; bench/futex-hash.o:/mnt/mmcblk0p2/compile/source_code/Kernel/linux-5.4.51/tools/perf/bench/futex-hash.c:40: first defined here
ld: bench/epoll-wait.o:/mnt/mmcblk0p2/compile/source_code/Kernel/linux-5.4.51/tools/perf/bench/epoll-wait.c:93: multiple definition of `runtime'; bench/futex-hash.o:/mnt/mmcblk0p2/compile/source_code/Kernel/linux-5.4.51/tools/perf/bench/futex-hash.c:40: first defined here
ld: bench/epoll-wait.o:/mnt/mmcblk0p2/compile/source_code/Kernel/linux-5.4.51/tools/perf/bench/epoll-wait.c:93: multiple definition of `end'; bench/futex-hash.o:/mnt/mmcblk0p2/compile/source_code/Kernel/linux-5.4.51/tools/perf/bench/futex-hash.c:40: first defined here
ld: bench/epoll-wait.o:/mnt/mmcblk0p2/compile/source_code/Kernel/linux-5.4.51/tools/perf/bench/epoll-wait.c:93: multiple definition of `start'; bench/futex-hash.o:/mnt/mmcblk0p2/compile/source_code/Kernel/linux-5.4.51/tools/perf/bench/futex-hash.c:40: first defined here
ld: bench/epoll-ctl.o:/mnt/mmcblk0p2/compile/source_code/Kernel/linux-5.4.51/tools/perf/bench/epoll-ctl.c:38: multiple definition of `runtime'; bench/futex-hash.o:/mnt/mmcblk0p2/compile/source_code/Kernel/linux-5.4.51/tools/perf/bench/futex-hash.c:40: first defined here
ld: bench/epoll-ctl.o:/mnt/mmcblk0p2/compile/source_code/Kernel/linux-5.4.51/tools/perf/bench/epoll-ctl.c:38: multiple definition of `end'; bench/futex-hash.o:/mnt/mmcblk0p2/compile/source_code/Kernel/linux-5.4.51/tools/perf/bench/futex-hash.c:40: first defined here
ld: bench/epoll-ctl.o:/mnt/mmcblk0p2/compile/source_code/Kernel/linux-5.4.51/tools/perf/bench/epoll-ctl.c:38: multiple definition of `start'; bench/futex-hash.o:/mnt/mmcblk0p2/compile/source_code/Kernel/linux-5.4.51/tools/perf/bench/futex-hash.c:40: first defined here
make[4]: *** [/mnt/mmcblk0p2/compile/source_code/Kernel/linux-5.4.51/tools/build/Makefile.build:145: bench/perf-in.o] Error 1
make[3]: *** [/mnt/mmcblk0p2/compile/source_code/Kernel/linux-5.4.51/tools/build/Makefile.build:139: bench] Error 2
make[3]: *** Waiting for unfinished jobs....
CC tests/parse-events.o
CC util/block-range.o
CC tests/dso-data.o
CC util/build-id.o
In file included from /usr/include/stdio.h:867,
from util/dso.h:11,
from builtin-script.c:6:
In function 'fprintf',
inlined from 'perf_sample__fprintf_regs.isra' at builtin-script.c:602:14:
/usr/include/bits/stdio2.h:100:10: error: '%5s' directive argument is null [-Werror=format-overflow=]
100 | return __fprintf_chk (__stream, __USE_FORTIFY_LEVEL - 1, __fmt,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
101 | __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~
CC tests/attr.o
CC util/cacheline.o
CC tests/vmlinux-kallsyms.o
CC util/config.o
CC tests/openat-syscall.o
CC tests/openat-syscall-all-cpus.o
CC tests/openat-syscall-tp-fields.o
CC tests/mmap-basic.o
CC tests/perf-record.o
CC tests/evsel-roundtrip-name.o
CC tests/evsel-tp-sched.o
CC tests/fdarray.o
CC util/copyfile.o
CC tests/pmu.o
CC util/ctype.o
cc1: all warnings being treated as errors
CC tests/hists_common.o
CC util/db-export.o
mv: cannot stat './.builtin-script.o.tmp': No such file or directory
make[3]: *** [/mnt/mmcblk0p2/compile/source_code/Kernel/linux-5.4.51/tools/build/Makefile.build:96: builtin-script.o] Error 1
CC util/env.o
CC tests/hists_link.o
util/env.c: In function 'perf_env__arch':
cc1: error: function may return address of local variable [-Werror=return-local-addr]
util/env.c:329:17: note: declared here
329 | struct utsname uts;
| ^~~
CC tests/hists_filter.o
cc1: all warnings being treated as errors
mv: cannot stat 'util/.env.o.tmp': No such file or directory
make[4]: *** [/mnt/mmcblk0p2/compile/source_code/Kernel/linux-5.4.51/tools/build/Makefile.build:97: util/env.o] Error 1
make[4]: *** Waiting for unfinished jobs....
CC tests/hists_output.o
CC tests/hists_cumulate.o
make[3]: *** [/mnt/mmcblk0p2/compile/source_code/Kernel/linux-5.4.51/tools/build/Makefile.build:139: util] Error 2
CC tests/python-use.o
CC tests/bp_signal.o
CC tests/bp_signal_overflow.o
CC tests/bp_account.o
CC tests/wp.o
CC tests/task-exit.o
CC tests/sw-clock.o
CC tests/mmap-thread-lookup.o
CC tests/thread-mg-share.o
CC tests/switch-tracking.o
CC tests/keep-tracking.o
CC tests/code-reading.o
CC tests/sample-parsing.o
CC tests/parse-no-sample-id-all.o
CC tests/kmod-path.o
CC tests/thread-map.o
CC tests/llvm.o
CC tests/llvm-src-base.o
CC tests/llvm-src-kbuild.o
CC tests/llvm-src-prologue.o
CC tests/llvm-src-relocation.o
CC tests/bpf.o
CC tests/topology.o
CC tests/mem.o
CC tests/cpumap.o
CC tests/stat.o
CC tests/event_update.o
CC tests/event-times.o
CC tests/expr.o
CC tests/backward-ring-buffer.o
CC tests/sdt.o
CC tests/is_printable_array.o
CC tests/bitmap.o
CC tests/perf-hooks.o
CC tests/clang.o
CC tests/unit_number__scnprintf.o
CC tests/mem2node.o
CC tests/map_groups.o
CC tests/time-utils-test.o
LD tests/perf-in.o
ld: tests/bp_account.o:/mnt/mmcblk0p2/compile/source_code/Kernel/linux-5.4.51/tools/perf/tests/bp_account.c:26: multiple definition of `the_var'; tests/bp_signal.o:/mnt/mmcblk0p2/compile/source_code/Kernel/linux-5.4.51/tools/perf/tests/bp_signal.c:38: first defined here
make[4]: *** [/mnt/mmcblk0p2/compile/source_code/Kernel/linux-5.4.51/tools/build/Makefile.build:145: tests/perf-in.o] Error 1
make[3]: *** [/mnt/mmcblk0p2/compile/source_code/Kernel/linux-5.4.51/tools/build/Makefile.build:139: tests] Error 2
make[2]: *** [Makefile.perf:597: perf-in.o] Error 2
make[1]: *** [Makefile.perf:221: sub-make] Error 2
make: *** [Makefile:70: all] Error 2
make: Leaving directory '/mnt/mmcblk0p2/compile/source_code/Kernel/linux-5.4.51/tools/perf'
--- End code ---
My tce-status:
--- Code: ---tc@box:~$ tce-status -i
Xlibs
Xorg
Xorg-fonts
Xprogs
adwaita-icon-theme
alsa
alsa-modules-5.4.51-piCore-v8
alsa-utils
at-spi2-atk
at-spi2-core
aterm
atk
bash
bash-locale
binutils
binutils-locale
bison
bison-locale
bzip2
bzip2-dev
bzip2-lib
ca-certificates
cairo
compiletc
coreutils
coreutils-locale
dbus
dbus-glib
diffutils
diffutils-locale
e2fsprogs_base-dev
expat2
file
findutils
findutils-locale
firefox
flex
flex-locale
fltk-1.3
fontconfig
freetype
fribidi
gamin
gamin-dev
gawk
gawk-locale
gcc
gcc-locale
gcc_base-dev
gcc_libs
gcc_libs-dev
gdbm
gdbm-locale
gdk-pixbuf
gettext
gettext-locale
glib2
glib2-dev
glib2-python
glibc_add_lib
glibc_apps
glibc_base-dev
glibc_gconv
gmp
gmp-dev
graphite2
grep
grep-locale
gtk3
harfbuzz
hicolor-icon-theme
icu
imlib2
imlib2-bin
isl
libEGL
libGLES
libICE
libSM
libX11
libXau
libXcomposite
libXcursor
libXdamage
libXdmcp
libXext
libXfixes
libXfont2
libXft
libXi
libXinerama
libXmu
libXrandr
libXrender
libXt
libXtst
libXxf86vm
libacl
libasound
libattr
libcap
libcap-dev
libdrm
libelf
libelf-dev
libepoxy
libevdev
libevent
libffi_base-dev
libfontenc
libinput
libjpeg-turbo
liblz4
liblzma
liblzma-dev
libpciaccess
libpng
librsvg
libtiff
libudev
libudev-dev
libvncserver
libwebp
libxcb
libxkbcommon
libxkbfile
libxml2
libxshmfence
linux-5.4.y_api_headers
m4
make
make-locale
mesa
mpc
mpc-dev
mpfr
mpfr-dev
mtdev
mylocale
ncurses
ncurses-dev
nspr
nss
openbox
openbox-config
openbox-locale
openssh
openssl
openssl-dev
pango
patch
pcre
pcre-dev
perl5
pixman
pkg-config
python3.8
readline
rsync
sed
sed-locale
shared-mime-info
sqlite3
tce-tools
texinfo
unifont
util-linux_base-dev
wayland
wayland-protocols
wbar
x11vnc
xf86-input-libinput
xf86-video-fbdev
xkbcomp
xkeyboard-config
xorg-server
zlib_base-dev
zstd
zstd-dev
--- End code ---
Perhaps I should force disable the parallel build ?
Navigation
[0] Message Index
[#] Next page
Go to full version