<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/test/-ext-/debug/test_profile_frames.rb, branch v3_4_9</title>
<subtitle>The Ruby Programming Language</subtitle>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/'/>
<entry>
<title>Move Array#map to Ruby</title>
<updated>2024-11-13T20:27:26+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2024-11-13T04:47:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=01db456196e17eb067f70eb1d4fceba143a51c01'/>
<id>01db456196e17eb067f70eb1d4fceba143a51c01</id>
<content type='text'>
Co-Authored-By: Aaron Patterson &lt;tenderlove@ruby-lang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Co-Authored-By: Aaron Patterson &lt;tenderlove@ruby-lang.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix use of the rb_profile_frames start parameter</title>
<updated>2023-12-28T16:58:21+00:00</updated>
<author>
<name>Dylan Thacker-Smith</name>
<email>Dylan.Smith@shopify.com</email>
</author>
<published>2019-09-27T05:10:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=2b96737636e1c96fedda83895ef32e19a914e310'/>
<id>2b96737636e1c96fedda83895ef32e19a914e310</id>
<content type='text'>
Previously, it was decrementing the start argument until it reached
zero without actually changing the control frame pointer.

[Bug #14607]
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Previously, it was decrementing the start argument until it reached
zero without actually changing the control frame pointer.

[Bug #14607]
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix thread leakage</title>
<updated>2023-11-03T00:32:32+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2023-11-03T00:32:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=8b02de8f41296d1a2449ecaeb24726f088ce899c'/>
<id>8b02de8f41296d1a2449ecaeb24726f088ce899c</id>
<content type='text'>
Wait for the worker thread to finish.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Wait for the worker thread to finish.
</pre>
</div>
</content>
</entry>
<entry>
<title>[Feature #10602] Add new API rb_profile_thread_frames()</title>
<updated>2023-10-31T02:16:18+00:00</updated>
<author>
<name>Daisuke Aritomo</name>
<email>osyoyu@osyoyu.com</email>
</author>
<published>2023-09-29T06:35:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=4adf418be963b3554962b2f27057be81486c57d9'/>
<id>4adf418be963b3554962b2f27057be81486c57d9</id>
<content type='text'>
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 &lt;mike@perham.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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 &lt;mike@perham.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Show backtraces when failed</title>
<updated>2023-10-18T09:10:24+00:00</updated>
<author>
<name>Koichi Sasada</name>
<email>ko1@atdot.net</email>
</author>
<published>2023-10-18T01:28:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=46b8846b5c40cf4053f678dae1684f1c6eb52673'/>
<id>46b8846b5c40cf4053f678dae1684f1c6eb52673</id>
<content type='text'>
If `assert_equal(backtrace_locations.size, profile_frames.size)` in
`TestProfileFrames#test_matches_backtrace_locations_main_thread`
failed, we do not have enough information about it like that:

```
    1) Failure:
  TestProfileFrames#test_matches_backtrace_locations_main_thread [/home/runner/work/ruby/ruby/src/test/-ext-/debug/test_profile_frames.rb:148]:
  &lt;31&gt; expected but was
  &lt;30&gt;.
```

This patch shows both `backtrace_locations` and `profile_frames`
if failed.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If `assert_equal(backtrace_locations.size, profile_frames.size)` in
`TestProfileFrames#test_matches_backtrace_locations_main_thread`
failed, we do not have enough information about it like that:

```
    1) Failure:
  TestProfileFrames#test_matches_backtrace_locations_main_thread [/home/runner/work/ruby/ruby/src/test/-ext-/debug/test_profile_frames.rb:148]:
  &lt;31&gt; expected but was
  &lt;30&gt;.
```

This patch shows both `backtrace_locations` and `profile_frames`
if failed.
</pre>
</div>
</content>
</entry>
<entry>
<title>Use the caller location as default filename for eval family of methods</title>
<updated>2023-07-24T12:51:20+00:00</updated>
<author>
<name>Jean Boussier</name>
<email>byroot@ruby-lang.org</email>
</author>
<published>2023-07-13T09:49:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=43a5c191358699fe8b19314763998cb8ca77ed90'/>
<id>43a5c191358699fe8b19314763998cb8ca77ed90</id>
<content type='text'>
[Feature #19755]

Before (in /tmp/test.rb):

```ruby
Object.class_eval("p __FILE__") # =&gt; "(eval)"
```

After:

```ruby
Object.class_eval("p __FILE__") # =&gt; "(eval at /tmp/test.rb:1)"
```

This makes it much easier to track down generated code in case
the author forgot to provide a filename argument.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[Feature #19755]

Before (in /tmp/test.rb):

```ruby
Object.class_eval("p __FILE__") # =&gt; "(eval)"
```

After:

```ruby
Object.class_eval("p __FILE__") # =&gt; "(eval at /tmp/test.rb:1)"
```

This makes it much easier to track down generated code in case
the author forgot to provide a filename argument.
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix `rb_profile_frames` output includes dummy main thread frame</title>
<updated>2022-07-26T01:43:44+00:00</updated>
<author>
<name>Ivo Anjo</name>
<email>ivo.anjo@datadoghq.com</email>
</author>
<published>2022-07-11T13:51:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=649bfbe00d8032fa2c0536e596a284f69926e87f'/>
<id>649bfbe00d8032fa2c0536e596a284f69926e87f</id>
<content type='text'>
The `rb_profile_frames` API did not skip the two dummy frames that
each thread has at its beginning. This was unlike `backtrace_each` and
`rb_ec_parcial_backtrace_object`, which do skip them.

This does not seem to be a problem for non-main thread frames,
because both `VM_FRAME_RUBYFRAME_P(cfp)` and
`rb_vm_frame_method_entry(cfp)` are NULL for them.

BUT, on the main thread `VM_FRAME_RUBYFRAME_P(cfp)` was true
and thus the dummy thread was still included in the output of
`rb_profile_frames`.

I've now made `rb_profile_frames` skip this extra frame (like
`backtrace_each` and friends), as well as add a test that asserts
the size and contents of `rb_profile_frames`.

Fixes [Bug #18907] (&lt;https://bugs.ruby-lang.org/issues/18907&gt;)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The `rb_profile_frames` API did not skip the two dummy frames that
each thread has at its beginning. This was unlike `backtrace_each` and
`rb_ec_parcial_backtrace_object`, which do skip them.

This does not seem to be a problem for non-main thread frames,
because both `VM_FRAME_RUBYFRAME_P(cfp)` and
`rb_vm_frame_method_entry(cfp)` are NULL for them.

BUT, on the main thread `VM_FRAME_RUBYFRAME_P(cfp)` was true
and thus the dummy thread was still included in the output of
`rb_profile_frames`.

I've now made `rb_profile_frames` skip this extra frame (like
`backtrace_each` and friends), as well as add a test that asserts
the size and contents of `rb_profile_frames`.

Fixes [Bug #18907] (&lt;https://bugs.ruby-lang.org/issues/18907&gt;)
</pre>
</div>
</content>
</entry>
<entry>
<title>vm_backtrace.c: let rb_profile_frames show cfunc frames</title>
<updated>2020-07-28T04:18:08+00:00</updated>
<author>
<name>Yusuke Endoh</name>
<email>mame@ruby-lang.org</email>
</author>
<published>2020-07-08T08:32:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=da31900d9d9e4e9dcd6381a23dd863b18fe65e3d'/>
<id>da31900d9d9e4e9dcd6381a23dd863b18fe65e3d</id>
<content type='text'>
... in addition to normal iseq frames.
It is sometimes useful to point the bottleneck more precisely.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
... in addition to normal iseq frames.
It is sometimes useful to point the bottleneck more precisely.
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix rb_profile_frame_classpath to handle module singletons</title>
<updated>2020-05-07T15:46:36+00:00</updated>
<author>
<name>Jean Boussier</name>
<email>jean.boussier@gmail.com</email>
</author>
<published>2020-05-06T16:49:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=cbe4f75ef802f13d05f94e42274b65a062bd3666'/>
<id>cbe4f75ef802f13d05f94e42274b65a062bd3666</id>
<content type='text'>
Right now `SomeClass.method` is properly named, but `SomeModule.method`
is displayed as `#&lt;Module:0x000055eb5d95adc8&gt;.method` which makes
profiling annoying.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Right now `SomeClass.method` is properly named, but `SomeModule.method`
is displayed as `#&lt;Module:0x000055eb5d95adc8&gt;.method` which makes
profiling annoying.
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "Fix use of `rb_profile_frames` start parameter"</title>
<updated>2018-04-27T00:13:51+00:00</updated>
<author>
<name>tenderlove</name>
<email>tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e</email>
</author>
<published>2018-04-27T00:13:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=c03f86b389d00cf45edf133c9aa23479e6efc06e'/>
<id>c03f86b389d00cf45edf133c9aa23479e6efc06e</id>
<content type='text'>
This reverts commit r63265.

ko1 said I should not have committed this! I'm sorry!

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63267 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit r63265.

ko1 said I should not have committed this! I'm sorry!

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63267 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
</pre>
</div>
</content>
</entry>
</feed>
