This is a cache of https://discuss.96boards.org/t/intsalling-linux-perf4-14-on-debian-image-on-the-hikey960-board/4683. It is a snapshot of the page at 2024-09-19T11:29:25.632+0000.
Intsalling Linux_perf4.14 on <strong>debian</strong> image on the hikey960 board - HiKey 960 - 96Boards Forum

Intsalling Linux_perf4.14 on debian image on the hikey960 board

Can anyone provide the linux_perf 4.14 deb file to install on my hikey960 board. I cannot rnun the perf commands since it gives me an error

E:linux-perf-4.14 is not installed.

The command apt-get install linux-perf installs the version 4.9.

I have tried installing the linux-perf 4.14 tools available on the debian website, but the architecture they support is different from the architecture on the board which is arm-64.

Any help with this.

root@hikey960:/usr/bin# cd
root@hikey960:~# perf stat -p 1
/usr/bin/perf: line 13: exec: perf_4.14: not found
E: linux-perf-4.14 is not installed.
root@hikey960:~# apt-get install linux-perf
Reading package lists… Done
Building dependency tree
Reading state information… Done
linux-perf is already the newest version (4.9+80+deb9u4).
0 upgraded, 0 newly installed, 0 to remove and 26 not upgraded.
root@hikey960:~# apt-get install perf_4.14
Reading package lists… Done
Building dependency tree
Reading state information… Done
E: Unable to locate package perf_4.14
E: Couldn’t find any package by glob ‘perf_4.14’
E: Couldn’t find any package by regex ‘perf_4.14’
root@hikey960:~#

root@hikey960:/usr/bin# ls|grep perf
perf
perf_4.9
x11perf
x11perfcomp
root@hikey960:/usr/bin#

root@hikey960:/usr/bin# uname -a
Linux hikey960 4.14.0-rc7-linaro-hikey960 #1 SMP PREEMPT Wed Mar 14 17:54:05 IST 2018 aarch64 GNU/Linux
root@hikey960:/usr/bin# uname -r
4.14.0-rc7-linaro-hikey960
root@hikey960:/usr/bin# uname
Linux

I’m not able to install perf_4.14

You have multiple threads opened on the same topic. Please close this one as it will make it difficult for us to help you out!

I edited the question with regards to only installing perf tools on the debian image. I hope this should be clear. I think you suggested about cross-compiling, but I would like to do it in a different way to directly install the tools.

For debian stretch, perf is provided for 4.9 kernel version. But the kernel which is supported by linaro for Hikey boards is 4.15 revision, so you need to install perf 4.15 package, but sadly it is not available for Aarch64.

So I would suggest you to compile perf manually for the linaro kernel and use it.

Hope this helps!

Thanks,
Mani

It worked thank you.

root@hikey960:/home/shunya# perf --version
perf version 4.15.11
root@hikey960:/home/shunya# perf

usage: perf [–version] [–help] [OPTIONS] COMMAND [ARGS]

The most commonly used perf commands are:
annotate Read perf.data (created by perf record) and display annotated code
archive Create archive with object files with build-ids found in perf.data file
bench General framework for benchmark suites
buildid-cache Manage build-id cache.
buildid-list List the buildids in a perf.data file
c2c Shared Data C2C/HITM Analyzer.
config Get and set variables in a configuration file.
data Data file related processing
diff Read perf.data files and display the differential profile
evlist List the event names in a perf.data file
ftrace simple wrapper for kernel’s ftrace functionality
inject Filter to augment the events stream with additional information
kallsyms Searches running kernel for symbols
kmem Tool to trace/measure kernel memory properties
kvm Tool to trace/measure kvm guest os
list List all symbolic event types
lock Analyze lock events
mem Profile memory accesses
record Run a command and record its profile into perf.data
report Read perf.data (created by perf record) and display the profile
sched Tool to trace/measure scheduler properties (latencies)
script Read perf.data (created by perf record) and display trace output
stat Run a command and gather performance counter statistics
test Runs sanity tests.
timechart Tool to visualize total system behavior during a workload
top System profiling tool.
probe Define new dynamic tracepoints
trace strace inspired tool

See ‘perf help COMMAND’ for more information on a specific command.

root@hikey960:/home/shunya#

I’m facing same issue with my raspberry pi zero model. My kernel version is 4.14.79+ but my linux tool (perf) version installed is 4.9+80+deb9u4+rp1
Kindly let me know the solution?

How to manually compile perf for this kernel?
and use it? @Mani

On the board, you could directly build perf tool in the kernel source tree:

make -C tools/perf

If you want to cross compiling perf tool on x86 platform, could try below command:

export CROSS_COMPILE="aarch64-linux-gnu-"
make LDFLAGS=-static NO_LIBELF=1 NO_JVMTI=1 V=1 DEBUG=1 -C tools/perf/

First of all thank you so much for replying back.

I tried running

make -C tools/perf

but i got error

make: *** tools/perf: No such file or directory. Stop.

First of all thank you so much for replying back.

I tried running


make -C tools/perf

but i got error

make: *** tools/perf: No such file or directory. Stop.

Please check have downloaded the kernel source code; then ‘cd’ into the kernel source code, so for my case I need execute below commands:

cd /mnt/linux-kernel/linux-cs-dev
make -C tools/perf