Skip to content

Native Lock Profiling #1547

Closed
Closed

Description

@Baraa-Hasheesh

Describe the feature

Currently the async-profilers offers profiling of java locks for java applications via the lock feature, this is indeed useful when checking for contended resources in the java layers

However it's not enough as the contention may happen on native resource guarded by a pthread_mutex_t, these kind of contentions won't be as viewable as the java locks

Use Case

This feature will be quite useful for

  • Native developers that use native locks
  • System developers, such as Java developers profiling the contension on JVM startup which happens using native locks

Proposed Solution

I'm proposing adding a new profiling engine nativelock that is similar to the mallocTracer
This new engine will use GOT patching as currently done for memory allocations.

This engine will intercept calls to pthread_mutex_lock, pthread_rwlock_rdlock & pthread_rwlock_wrlock & checks for the time it took to acquire the lock for sampling contended locks

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

Activity

  1. added a commit that references this issue on Oct 23, 2025
  2. Baraa-Hasheesh commented on Oct 24, 2025

    @Baraa-Hasheesh
    ContributorAuthor

    Supported in #1549

  3. added a commit that references this issue on Apr 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions