Closed SevereOverfl0w closed 4 years ago
I can't reproduce this. Which Leiningen version are you using?
Here's what I get (2.8.3):
user@hostname:~$ lein update-in :dependencies conj "[com.clojure-goes-fast/clj-async-profiler \"0.3.0\"]" -- repl
nREPL server started on port 46348 on host 127.0.0.1 - nrepl://127.0.0.1:46348
REPL-y 0.4.3, nREPL 0.5.3
Clojure 1.8.0
OpenJDK 64-Bit Server VM 1.8.0_181-8u181-b13-1ubuntu0.16.04.1-b13
...
user=> (require '[clj-async-profiler.core :as prof])
nil
user=> (prof/list-event-types)
Basic events:
cpu
alloc
lock
wall
itimer
Perf events:
page-faults
context-switches
cycles
instructions
cache-references
cache-misses
branches
branch-misses
bus-cycles
L1-dcache-load-misses
LLC-load-misses
dTLB-load-misses
mem:breakpoint
trace:tracepoint
nil
I tried with Clojure 1.10 too and it works.
My JVM output isn't too useful apparently. I've switched to Oracle-JDK (I think I was using Oracle JRE before) and it now seems to work.
It was an accident that I had the jre.
Is using the Oracle JDK is a requirement? Or one merely needs to somehow point the profiler to libasyncProfiler-linux.so
as mentioned in https://github.com/jvm-profiling-tools/async-profiler#profiling-java-in-a-container:
Also make sure that the target container can access libasyncProfiler.so by the same absolute path as on the host.
what is needed in order for a project that depends on this clj-async-profiler
to profile correctly given:
Asking in another way- maybe the docs missing the recommended way to package the vendor/
files?
A specific JDK vendor is not a requirement (it should work with Oracle JDK, OpenJDK, J9, whatever), but it has to be a JDK, not just a JRE distribution.
The .so
file is unpacked automatically by the library, you don't have to do it yourself, regardless of whether it runs on the host machine or inside a container.
To run inside a container, you have to make sure that seccomp option is provided, like the link you posted says. You also need to set perf_event_paranoid on the host machine.
Can you first try to figure things out on a host machine and then try to reproduce it under Docker? I think this would be easier.
from docker:
bash-4.4$ cat /proc/sys/kernel/perf_event_paranoid
1
from the host:
$ grep CONFIG_SECCOMP= /boot/config-$(uname -r)
CONFIG_SECCOMP=y
from docker:
bash-4.4$ cat /proc/1/status | grep Seccomp
Seccomp: 0
So, what do you think? Should this be enough? What else is required from the JDK?
Can you describe what happens, what exactly doesn't work?
I haven't seen this in a long time, I suspect it was the JRE/JDK thing.
OS: Linux x64
0.2.0+ gives me: