user2442235
user2442235

Reputation: 41

How to improve JProfiler accounting for natives

Background: We build a product which adds various features (transactions, shared memory based object persistence, indexing and queries, cluster based high availability and replication) to Java via annotations and a custom class loader. The bulk of the implementation for these features is in C++ libraries which are accessed via native calls inserted by our class loader. Our natives can be characterized as using CPU, blocking via mutex or condvar acquisition, blocking on network I/O, or some combination of all three. The native entry points themselves do not know whether or not they will block.

Question: JProfiler reports time spent in our natives as CPU time, and shows any thread inside our natives as running. Is there someway to make JProfiler aware of the actual combination of running and blocking that occurs?

Upvotes: 3

Views: 147

Answers (1)

Ingo Kegel
Ingo Kegel

Reputation: 48090

Add a method trigger for all native methods that should be excluded from the "Runnable" thread state. On the "Actions" step of the trigger configuration, add a "Override thread status for current method" trigger action. You can set the thread status to "Waiting", "Blocking" or "Net I/O".

Upvotes: 1

Related Questions