The [unknown] block in the perf report output refers to the name of the dynamic shared object (DSO). perf report could not resolve the DSO path and hence it prints [unknown]. Per the latest kernel source code tree (which is 5.3.9 at the time of writing), you can see this here.

It is important to know that the determination of the DSO symbols happen with the help of the sampled event address. The function thread__resolve is responsible for doing exactly that. In older kernels, the thread__resolve method had another name - perf_event__preprocess_sample_addr.

Given the snapshot of your output, it looks like the address of the event that was sampled during perf record, is 0. This means that the address could not be resolved at all. It is an address in the kernel space (looking at the symbol [k] 0000000000000000) and perf in your case, could not resolve it.

The comments highlight setting perf_event_paranoid to a suitable value so that you can probe both kernel and user-space events successfully. Setting perf_event_paranoid to a value that allows you to correctly probe events in the kernel space should "be a step" towards correctly resolving the address.

Answer from Arnabjyoti Kalita on Stack Overflow
🌐
GitHub
gist.github.com › user202729 › b6ea134715ddf851efd0047b3197fc33
perf record [unknown] frames · GitHub
This is quite inefficient (because it dumps the whole stack instead of just the addresses for each sample), but more importantly, if the stack is too deep (1024 bytes is insufficient) then the result is [unknown] frames.
Discussions

Missing stack symbols with perf_event's perf report, despite -fno-omit-frame-pointer compilation - Unix & Linux Stack Exchange
Only "[unknown]". ... This is an old topic but am sure it still happens to hundreds of people and because this StackExchange question still shows up high on Google results, am sharing answer found on StackOverflow that worked for me: https://stackoverflow.com/questions/33137543/linux-perf-top-... More on unix.stackexchange.com
🌐 unix.stackexchange.com
LINUX-KERNEL: Perf report shared objects showing unknown on ARM - Stack Overflow
There is an issue related to perf which I am facing since 15 days. Hoping that the great minds here will help me to solve this. I have a requirement to make perf tool work on a device having ARM More on stackoverflow.com
🌐 stackoverflow.com
April 26, 2017
perf profiling - unknown - C++ Forum
My program work fast, after changing is two times slower. I try profile with perf under CLion. Most time consuming method is [Unknown][Unknown] what it is? More on cplusplus.com
🌐 cplusplus.com
problem using perf for profiling under linux
Not directly answering your question, but I had much better time profiling with valgrind as desrbied here: https://jbendig.github.io/fix-rs/2017/01/24/how-to-optimize-rust-programs-on-linux/ . It is heavy and affects your program performance, but it's just so much easier to work with... I wouldn't worry about that unkown (might be just an artefact/glitch of release build that confused perf). The self time question is unclear to me too. More on reddit.com
🌐 r/rust
9
18
March 14, 2017
🌐
Narkive
linaro-dev.linaro.narkive.com › BPwbuJTY › urgent-perf-report-shared-objects-showing-unknown-on-arm
[URGENT] Perf report shared objects showing unknown on ARM
But, on recording the tracepoint events and then running ./perf report, it shows the shared objects name as [unknown] and Symbols as 00000, whereas for software and hardware events I do not experience this issue.I have cross compiled the perf tool available on mailine and ported it on a device ...
Top answer
1 of 2
8

I'm compiling using more debugging options:

-Og -ggdb3 -fno-omit-frame-pointer

Then, when I record I'm not using -a option (that should monitor all the system processes), I'm using

perf record -e cycles -g --call-graph fp -- ./your_app your_args

Finally, to show the result I'm using

perf report -g graph

and the output looks like expected (note, I'm using debian 9 and the perf report output is ncurses based)

-   92.18%     0.00%  stsm     stsm                  [.] main                                                                                                ◆
   - main                                                                                                                                                    ▒
      - 91.77% STSM::run                                                                                                                                     ▒
         + 56.86% STSM::generateCandidates                                                                                                                   ▒
         - 25.22% STSM::detectBlocksOfAllSolidSequences                                                                                                      ▒
            + 23.42% STSM::detectSolidSequenceBlocksFromSolidSequence                                                                                        ▒
              0.81% Segment::unify                                                                                                                           ▒
         + 5.25% STSM::updateKernelsOfAllCandidates                                                                                                          ▒
           1.80% RangedSequence::range                                                                                                                       ▒
         + 1.45% STSM::updateMatchingPositions                                                                                                               ▒
           0.99% Segment::intersects                                                                                                                         ▒
+   92.18%     0.00%  stsm     libc-2.24.so          [.] __libc_start_main                                                                                   ▒
+   92.18%     0.00%  stsm     [unknown]             [k] 0x4d96258d4c544155                                                                                  ▒
+   91.77%     0.00%  stsm     stsm                  [.] STSM::run                                                                                           ▒
+   56.86%     6.74%  stsm     stsm                  [.] STSM::generateCandidates                                                                            ▒
+   49.99%    49.99%  stsm     stsm                  [.] Segment::intersects                                                                                 ▒
+   25.22%     0.00%  stsm     stsm                  [.] STSM::detectBlocksOfAllSolidSequences 
2 of 2
5

This is an old topic but am sure it still happens to hundreds of people and because this StackExchange question still shows up high on Google results, am sharing answer found on StackOverflow that worked for me: https://stackoverflow.com/questions/33137543/linux-perf-top-kernel-symbol-not-found

Basically:

Before starting perf record

echo 0 > /proc/sys/kernel/kptr_restrict

Also it might be necessary to setup these

For RHEL/CentOS/Fedora/etc

yum install -y elfutils-libelf-devel libunwind-devel audit-libs-devel slang-devel

Or for Debian/Ubuntu/etc

apt-get install libelf-dev libunwind-dev libaudit-dev libslang-dev

🌐
Apple Music
music.apple.com › gh › album › unknown-single › 1576068187
Unknown - Single by Perf on Apple Music
October 25, 2021 - Listen to Unknown - Single by Perf on Apple Music. 2021. 1 Song. Duration: 3 minutes.
🌐
Stack Overflow
stackoverflow.com › questions › 23645948 › linux-kernel-perf-report-shared-objects-showing-unknown-on-arm
LINUX-KERNEL: Perf report shared objects showing unknown on ARM - Stack Overflow
April 26, 2017 - I have a requirement to make perf tool work on a device having ARM architecture. But, on recording the tracepoint events and then running ./perf report, it shows the shared objects name as [unknown] and Symbols as 00000, whereas for software and hardware events I do not experience this issue.
🌐
Cplusplus
cplusplus.com › forum › unices › 272514
perf profiling - unknown - C++ Forum
Can you get back to the original 'fast' version? If the answer is 'no' to either, then it's time you researched https://git-scm.com/ CLion is just a glossy editor, what matters is how you build the software. Unknown sounds like you tried to profile a stripped release build.
🌐
Reddit
reddit.com › r/rust › problem using perf for profiling under linux
r/rust on Reddit: problem using perf for profiling under linux
March 14, 2017 -

hi,

i've started profiling my rust code (under linux, using perf) and I'm running into troubles. i'm basically following this tutorial

so I compile my benchmark, and use perf to get some data.

~/c/J/r/jimn ❯❯❯ perf record -g --  ./target/release/jimn-9d2a6ca5c444e0ff --bench bench_slow

running 1 test
test bentley_ottmann::tests::bench_slow ... bench:  58,791,165 ns/iter (+/- 3,952,229)

test result: ok. 0 passed; 0 failed; 0 ignored; 1 measured

[ perf record: Woken up 20 times to write data ]
[ perf record: Captured and wrote 5.000 MB perf.data (69974 samples) ]

now, my output using perf report looks like this:

Samples: 69K of event 'cycles:u', Event count (approx.): 49428164411

Children Self Command Shared Object Symbol

  • 20,75% 20,74% jimn-9d2a6ca5c4 jimn-9d2a6ca5c444e0ff [.] <jimn::bentley_ottmann::KeyGenerator<'a, T> as jimn::

  • 9,52% 0,00% jimn-9d2a6ca5c4 [unknown] [.] 0x0000000000000001

  • 5,51% 5,51% jimn-9d2a6ca5c4 jimn-9d2a6ca5c444e0ff [.] <std::collections::hash::map::HashMap<K, V, S>>::make

  • 5,19% 5,19% jimn-9d2a6ca5c4 jimn-9d2a6ca5c444e0ff [.] <std::collections::hash::map::DefaultHasher as core::

  • 4,91% 4,91% jimn-9d2a6ca5c4 jimn-9d2a6ca5c444e0ff [.] <std::collections::hash::map::DefaultHasher as core::

  • 4,79% 0,54% jimn-9d2a6ca5c4 jimn-9d2a6ca5c444e0ff [.] jimn::utils::coordinates_hash::CoordinatesHash::hash_

  • 4,23% 0,19% jimn-9d2a6ca5c4 jimn-9d2a6ca5c444e0ff [.] collections::fmt::format

  • 4,09% 0,00% jimn-9d2a6ca5c4 [unknown] [.] 0000000000000000

  • 4,06% 4,04% jimn-9d2a6ca5c4 jimn-9d2a6ca5c444e0ff [.] jimn::bentley_ottmann::Cutter::run

so, I have two kinds of questions :

  1. what are these unknown ? (and how to get to some useful symbols)

  2. my main function is actually Cutter::run (last line). since it is the main function should'nt it have cumulatively 100% of all cycles and not just 4.06% ? if not, how to read the children and self percentages ?

thanks a lot for any hint.

Find elsewhere
🌐
GitHub
github.com › brendangregg › FlameGraph › issues › 92
[unknown] functions · Issue #92 · brendangregg/FlameGraph
June 2, 2016 - Then flame graph is occupied with a lot of [unknown] functions, even though some of unknowns have binary associated with them. Could you modify stackcollapse-perf.pl if it sees [unknown] but there's binary to show binary name, it could be like [/path/bin] for example.
Author   brendangregg
🌐
Brendan Gregg
brendangregg.com › perf.html
Linux perf Examples
These are some examples of using the perf Linux profiler, which has also been called Performance Counters for Linux (PCL), Linux perf events (LPE), or perf_events. Like Vince Weaver, I'll call it perf_events so that you can search on that term later. Searching for just "perf" finds sites on the police, petroleum, weed control, and a T-shirt.
🌐
Linux Man Pages
man7.org › linux › man-pages › man1 › perf-intel-pt.1.html
perf-intel-pt(1) - Linux manual page
In this case the CPU and time range have been to chosen to show interaction between guest and host when uname is starting to run on the guest machine: Notes: • the CPU displayed, [002] in this case, is always the host CPU • events happening in the virtual machine start with VM:13376 VCPU:003, which shows the hypervisor PID 13376 and the VCPU number • only calls and errors are displayed i.e. --itrace=ce • branches entering and exiting the virtual machine are split, and show as 2 branches to/from "0 [unknown] ([unknown])" $ perf script -i inj --itrace=ce -F+machine_pid,+vcpu,+addr,+pid,+
🌐
Medium
tungdam.medium.com › things-you-should-know-to-begin-playing-with-linux-tracing-tools-part-i-x-225aae1aaf13
Practical Linux tracing ( Part 1/5) : symbols, debug symbols and stack unwinding | by Tungdam | Medium
July 14, 2024 - Missing symbols is the root cause. It makes your profling result useless. It can’t tell you anything or very few things about your application / kernel. And it’s the very first problem that i met and have to solve while playing with perf or bpftrace, especially while tracing user-space program.
🌐
Opendlang
opendlang.org › library › core.sys.linux.perf_event.PERF_BR_UNKNOWN.html
PERF_BR_UNKNOWN (core.sys.linux.perf_event.PERF_BR_UNKNOWN)
PERF_RECORD_MISC_CPUMODE_UNKNOWN · PERF_RECORD_MISC_EXACT_IP · PERF_RECORD_MISC_EXT_RESERVED · PERF_RECORD_MISC_GUEST_KERNEL · PERF_RECORD_MISC_GUEST_USER · PERF_RECORD_MISC_HYPERVISOR · PERF_RECORD_MISC_KERNEL · PERF_RECORD_MISC_MMAP_DATA · PERF_RECORD_MISC_PROC_MAP_PARSE_TIMEOUT ·
🌐
Red Hat
access.redhat.com › solutions › 2021733
perf reliably crashes the system through spurious NMI or causes unknown NMI reports to be received - Red Hat Customer Portal
August 2, 2024 - perf record command reliably crashes HP DL Gen9 servers. You can see a trace similar to this on the kernel log after the crash: Kernel panic - not syncing: An NMI occurred, please see the Integrated Management Log for details. Pid: 7646, comm: java Not tainted 2.6.32-431.3.1.el6.x86_64 #1 Call ...
🌐
Spinics.net
spinics.net › lists › linux-perf-users › msg01347.html
Re: perf top shows [unknown] — Linux Perf Users
Am I missing a build flag? > > I specified vmlinux too. > > > > I can't find anything else about this, how would I go about > > discovering what that [unknown] is about? > > I often see this when I run perf top as non root. Fix: run as root. Yep that did it, no more [unknown]. perf groups all things "unknown" into [unknown] when run as non-root?
🌐
eopXD
eopxd.com › 2021 › 06 › 01 › if-your-perf-is-not-working
If your perf is not working…
March 8, 2022 - At the very first place I thought the mangle-ed function call names exist because of perf not recognizing the symbols. It turned out I was wrong. If perf does not recognize the symbol it would simply show Unknown. The mixed-up symbol names are ...
🌐
Wiredtiger
source.wiredtiger.com › develop › tool-perf-flamegraphs.html
CPU Flame Graphs - WiredTiger - MongoDB
Here is another FlameGraph for a full run of the many-stable-stress.wtperf job: Download the non-redacted interactive version here and open it in your web browser. If you see 'unknown' call stacks in your FlameGraph, this means that perf could not resolve the symbols.
🌐
Linux Man Pages
man7.org › linux › man-pages › man2 › perf_event_open.2.html
perf_event_open(2) - Linux manual page
For ease of reading, the fields with shorter descriptions are presented first. size This indicates the size of the record. misc The misc field contains additional information about the sample. The CPU mode can be determined from this value by masking with PERF_RECORD_MISC_CPUMODE_MASK and looking for one of the following (note these are not bit masks, only one can be set at a time): PERF_RECORD_MISC_CPUMODE_UNKNOWN Unknown CPU mode.