diff options
author | Daisuke Aritomo <[email protected]> | 2023-09-29 15:35:36 +0900 |
---|---|---|
committer | Koichi Sasada <[email protected]> | 2023-10-31 11:16:18 +0900 |
commit | 4adf418be963b3554962b2f27057be81486c57d9 () | |
tree | d43c3006925aaacdf522b58b752b860f6b94875a /ext/-test-/debug/profile_frames.c | |
parent | 02ecc3c8550af1aab7916975e7019b2a3ffe8591 (diff) |
[Feature #10602] Add new API rb_profile_thread_frames()
Add a new API rb_profile_thread_frames(), which is essentialy a per-thread version of rb_profile_frames(). While the original rb_profile_frames() always returns results about the current active thread obtained by GET_EC(), this new API takes a Thread to be profiled as an argument. This should come in handy when profiling I/O-bound programs such as webapps, since this new API allows us to learn about Threads performing I/O (which do not have the GVL). Profiling worker threads (such as Sidekiq workers) may be another application. Implements [Feature #10602] Co-authored-by: Mike Perham <[email protected]>
-rw-r--r-- | ext/-test-/debug/profile_frames.c | 21 |
1 files changed, 21 insertions, 0 deletions
@@ -37,8 +37,29 @@ profile_frames(VALUE self, VALUE start_v, VALUE num_v) return result; } void Init_profile_frames(VALUE klass) { rb_define_module_function(klass, "profile_frames", profile_frames, 2); } |