Arthas generate flame diagram command
profiler start
Error message
Perf events unavailable. See stderr of the target process.
reason:
Officials listed the following reasons:
/proc/sys/kernel/perf_event_Paranoid is set to restricted mode (>= 2) (usually for this reason)
seccomp disables perf_event_Open API in a container (seccomp disables perf_event_open API in the container.)
OS runs under a hypervisor that does not virtualize performance counters
perf_event_Open API is not supported on this system, e.g. WSL
Solution:
Docker
Modify docker-compose.yml and add
cap_add:
- SYS_ADMIN
For example:
version: '1'
services:
xxx:
container_name: xxx
hostname: xxx
image: xxx
...
# Make it possible to print flame maps in arthas
cap_add:
- SYS_ADMIN
k8s
Modify SVC configuration file and add
securityContext:
capabilities:
add:
- SYS_ADMIN
For example:
metadata:
labels:
service: hello-world
spec:
containers:
- image: "alpine:3.4"
command: ["/bin/echo", "hello", "world"]
# Make it possible to print flame maps in arthas
securityContext:
capabilities:
add:
- SYS_ADMIN
Similar Posts:
- docker: Error response from daemon: Conflict. The container name “/xx” is already in use
- [Solved] Ubuntu 18.04 installation perf error: WARNING: perf not found for kernel 4.15.0-39
- How to Solve Mysql missing ERROR 1265: Data truncated for
- Go build cannot find package Error [How to Solve]
- jhsdb jmap –heap –pid 1 Command Error [How to Solve]
- Docker: import container snapshot, execute and report an error: docker: error response from daemon: no command specified
- Request object error ASP 0104:80004005 operation not allowed
- Docker OCI runtime exec failed: exec failed: container_linux.go:344: starting container process caus
- [Solved] Gitlab can clone via SSH, cannot clone via HTTP, and cannot pipeline. Prompt port 80: connection rejected
- Solution to pod error “back off restarting failed container”