Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Error!!!] when using cache-misses event on Zing #882

Closed
rockingl opened this issue Jan 26, 2024 · 5 comments
Closed

[Error!!!] when using cache-misses event on Zing #882

rockingl opened this issue Jan 26, 2024 · 5 comments
Labels

Comments

@rockingl
Copy link

Hi, it's appear to a error when i use Zing jdk.
the host 1 can run cache-misses event(jdk version):
java 17.0.8.1.101 2023-10-11 LTS Java Runtime Environment Zing23.08.100.0+1 (build 17.0.8.1.101+1-LTS) Zing 64-Bit Tiered VM Zing23.08.100.0+1 (build 17.0.8.1.101-zing_23.08.100.0-b1-product-linux-X86_64, mixed mode)

but the host 2 can't run cache-misses event(jdk version):
java 17.0.9 2023-11-16 LTS Java Runtime Environment Zing23.08.200.0+3 (build 17.0.9+8-LTS) Zing 64-Bit Tiered VM Zing23.08.200.0+3 (build 17.0.9-zing_23.08.200.0-b3-product-linux-X86_64, mixed mode)

the error is:
sh -c "/home/async-profiler/profiler.sh -d 30 -i 20ms -e cache-misses -t -o flamegraph -f /xxx.html 3675508" [WARN] Kernel symbols are unavailable due to restrictions. Try sysctl kernel.perf_event_paranoid=1 sysctl kernel.kptr_restrict=0 [WARN] perf_event_open for TID 3675508 failed: No such file or directory [WARN] perf_event_open for TID 3675509 failed: No such file or directory [WARN] perf_event_open for TID 3675528 failed: No such file or directory [WARN] perf_event_open for TID 3675530 failed: No such file or directory [WARN] perf_event_open for TID 3675531 failed: No such file or directory [WARN] perf_event_open for TID 3675532 failed: No such file or directory [WARN] perf_event_open for TID 3675533 failed: No such file or directory [WARN] perf_event_open for TID 3675534 failed: No such file or directory [WARN] perf_event_open for TID 3675535 failed: No such file or directory [WARN] perf_event_open for TID 3675536 failed: No such file or directory [WARN] perf_event_open for TID 3675537 failed: No such file or directory [WARN] perf_event_open for TID 3675538 failed: No such file or directory [WARN] perf_event_open for TID 3675539 failed: No such file or directory [WARN] perf_event_open for TID 3675540 failed: No such file or directory [WARN] perf_event_open for TID 3675541 failed: No such file or directory [WARN] perf_event_open for TID 3675542 failed: No such file or directory [WARN] perf_event_open for TID 3675543 failed: No such file or directory [WARN] perf_event_open for TID 3675544 failed: No such file or directory [WARN] perf_event_open for TID 3675545 failed: No such file or directory

when i set:
sysctl kernel.perf_event_paranoid=1
sysctl kernel.kptr_restrict=0

it's appear to:
[WARN] Kernel symbols are unavailable due to restrictions. Try sysctl kernel.perf_event_paranoid=1 sysctl kernel.kptr_restrict=0 message disappoint.

so, it's why. any help will be appreciate. thank you!

@apangin
Copy link
Collaborator

apangin commented Jan 26, 2024

cache-misses event is provided by hardware performance counters. Virtualized systems often restrict access to these counters. For example, AWS instances (unless they run on a dedicated server) do not allow access to hardware performance counters, and therefore you cannot use these systems to profile events such as cache-misses.

Does CPU profiling (-e cpu) work on that host?

@rockingl
Copy link
Author

cache-misses event is provided by hardware performance counters. Virtualized systems often restrict access to these counters. For example, AWS instances (unless they run on a dedicated server) do not allow access to hardware performance counters, and therefore you cannot use these systems to profile events such as cache-misses.

Does CPU profiling (-e cpu) work on that host?

Thanks! it's work fine in cpu、lock、alloc event. but cache-misses can't run.

@rockingl
Copy link
Author

my host kern version:
-- Linux hostname 5.10.134-12.al8.x86_64 #1 SMP Tue Sep 6 14:59:57 CST 2022 x86_64 x86_64 x86_64 GNU/Linux

How can I check whether the virtual system is supported?

@apangin
Copy link
Collaborator

apangin commented Jan 27, 2024

Run cpuid -1 and look for "Architecture Performance Monitoring Features" in the output.

If hardware perf counters are supported, the output will look like

   Architecture Performance Monitoring Features (0xa/eax):
      version ID                               = 0x2 (2)
      number of counters per logical processor = 0x4 (4)
      bit width of counter                     = 0x30 (48)
      length of EBX bit vector                 = 0x7 (7)
...
   Architecture Performance Monitoring Features (0xa/edx):
      number of fixed counters    = 0x3 (3)
      bit width of fixed counters = 0x30 (48)
      anythread deprecation       = false

If they are not supported, you will see zeros instead:

   Architecture Performance Monitoring Features (0xa/eax):
      version ID                               = 0x0 (0)
      number of counters per logical processor = 0x0 (0)
      bit width of counter                     = 0x0 (0)
      length of EBX bit vector                 = 0x0 (0)
...
   Architecture Performance Monitoring Features (0xa/edx):
      number of fixed counters    = 0x0 (0)
      bit width of fixed counters = 0x0 (0)

Alternatively, check dmesg for "Performance Events":

When supported:

[    0.577362] Performance Events: IvyBridge events, full-width counters, Intel PMU driver.
[    0.578189] ... version:                2
[    0.578556] ... bit width:              48
[    0.578932] ... generic registers:      4

When not supported:

[    0.067039] Performance Events: unsupported p6 CPU model 154 no PMU driver, software events only.

@rockingl
Copy link
Author

Run cpuid -1 and look for "Architecture Performance Monitoring Features" in the output.

If hardware perf counters are supported, the output will look like

   Architecture Performance Monitoring Features (0xa/eax):
      version ID                               = 0x2 (2)
      number of counters per logical processor = 0x4 (4)
      bit width of counter                     = 0x30 (48)
      length of EBX bit vector                 = 0x7 (7)
...
   Architecture Performance Monitoring Features (0xa/edx):
      number of fixed counters    = 0x3 (3)
      bit width of fixed counters = 0x30 (48)
      anythread deprecation       = false

If they are not supported, you will see zeros instead:

   Architecture Performance Monitoring Features (0xa/eax):
      version ID                               = 0x0 (0)
      number of counters per logical processor = 0x0 (0)
      bit width of counter                     = 0x0 (0)
      length of EBX bit vector                 = 0x0 (0)
...
   Architecture Performance Monitoring Features (0xa/edx):
      number of fixed counters    = 0x0 (0)
      bit width of fixed counters = 0x0 (0)

Alternatively, check dmesg for "Performance Events":

When supported:

[    0.577362] Performance Events: IvyBridge events, full-width counters, Intel PMU driver.
[    0.578189] ... version:                2
[    0.578556] ... bit width:              48
[    0.578932] ... generic registers:      4

When not supported:

[    0.067039] Performance Events: unsupported p6 CPU model 154 no PMU driver, software events only.

i will check my host soon. thank you very much for your help!

@apangin apangin closed this as completed Feb 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants