Re: Providing users with thread type

2019-04-28 Thread Alex Bagehot
Hi Jc, Have you seen at the work of async profiler? It may provide the kind of visibility into VM work that you are after. https://github.com/jvm-profiling-tools/async-profiler As it can be driven from Linux perf events rather than SIGPROF it is able to observe more of the system and therefore prov

Re: Providing users with thread type

2019-04-20 Thread Thomas Stüfe
On Sun, Apr 21, 2019 at 3:01 AM Jean Christophe Beyler wrote: > Ahh there lies the problem of understanding then :) > > We can provide that for our users that can use a non-vanilla OpenJDK. > Vanilla OpenJDK cannot use that kind of thing since there is no "C" style > symbol you could dlsym to. I

Re: Providing users with thread type

2019-04-20 Thread David Holmes
Hi Jc, On 21/04/2019 8:15 am, Jean Christophe Beyler wrote: Hi David, Hopefully this gives more details :) Basically, in the Java agent, we set up a SIGPROF handler and we get a handler call at a set frequency rate (generally the profiling is for 30 seconds). The thread that is doing the sig

Re: Providing users with thread type

2019-04-19 Thread David Holmes
On 20/04/2019 10:29 am, Jean Christophe Beyler wrote: Hi David, On Fri, Apr 19, 2019 at 6:49 PM David Holmes > wrote: Hi Jc, On 20/04/2019 12:30 am, Jean Christophe Beyler wrote: > Problem is that if I don't have a jthread, I can't get the name it

Re: Providing users with thread type

2019-04-19 Thread David Holmes
Hi Jc, On 20/04/2019 12:30 am, Jean Christophe Beyler wrote: Problem is that if I don't have a jthread, I can't get the name it seems. Perhaps it could help if I gave more information: - In our JVM profiling mechanism, we have a SIGPROF (and maybe that's a wrong approach :-)) that gets cycled

Re: Providing users with thread type

2019-04-19 Thread Jean Christophe Beyler
Hi Florian and Thomas, @ both: apparently our internal jobs have a tendency to rename threads so all the naming is out the window (it is not clear to me why this happens) It looks like IF I could get that fixed this might work but does seem a bit "hacky" at best, is there no good solution to put

Re: Providing users with thread type

2019-04-19 Thread Florian Weimer
* Jean Christophe Beyler: > Is there any way we could provide that (not in JVMTI then)? On Linux, you can get truncated thread names from /proc/PID/task/*/comm. Maybe that's sufficient for your needs? Thanks, Florian

Re: Providing users with thread type

2019-04-19 Thread Thomas Stüfe
Hi JC, not sure if that helps, but we set - originally for debugging purposes - the thread name for platforms where that is possible. This is what you see in gdb when listing threads. On POSIX platforms this means we call some form of pthread_setname_np(), which can be queried from the outside wi

Re: Providing users with thread type

2019-04-19 Thread Jean Christophe Beyler
Problem is that if I don't have a jthread, I can't get the name it seems. Perhaps it could help if I gave more information: - In our JVM profiling mechanism, we have a SIGPROF (and maybe that's a wrong approach :-)) that gets cycled across threads (some Java threads, some are the other threads)

Re: Providing users with thread type

2019-04-19 Thread Alan Bateman
On 19/04/2019 00:12, David Holmes wrote: I think it would be difficult to put something like this in JVM TI given that the use of threads within the JVM are purely an implementation detail and not standardized in any way. And many of those threads are hidden from JVM TI anyway. The names of

Re: Providing users with thread type

2019-04-18 Thread David Holmes
Hi Jc, On 19/04/2019 12:18 am, Jean Christophe Beyler wrote: Hi all, When doing profiling, often users have a hard time determining what is happening inside libjvm.so. When doing profiling, the JVM seems like a black box and it is hard to differentiate between a thread doing GC/Compile/Actua