Skip to content

Add a DTrace probe for string capacity resizes #110

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

tenderlove
Copy link

@tenderlove tenderlove commented Jan 11, 2019

Adds a DTrace probe that fires when a string is resized.

Example:

$ cat resize.d 
#pragma D option quiet

ruby*:::string-capa-resize
{
  printf("string resize from %d to %d (%s:%d)\n", arg0, arg1, copyinstr(arg2), arg3)
}
$ cat my_test.rb
require 'test_helper'

class UsersControllerTest < ActionDispatch::IntegrationTest
  def test_get_new
    get new_user_url
    assert_response :success
  end
end

puts "#" * 90

20.times do
  Minitest.run_one_method UsersControllerTest, :test_get_new
end

exit!

Run the test:

$ sudo dtrace -q -s resize.d -c'/Users/aaron/.rbenv/versions/ruby-trunk/bin/ruby -I lib:test my_test.rb'

jhawthorn pushed a commit that referenced this pull request Jul 20, 2020
…ngth with anchors (#110)

* Do not loop forever when skip_lines regexp matches zero length with anchors

* Remove needless white spaces

* Add missing eos check in skip_needless_lines

* Simplify test

ruby/csv@3b15d4a3e8
jhawthorn pushed a commit that referenced this pull request May 12, 2021
YJIT: pass argument types to callees
@jhawthorn jhawthorn closed this May 17, 2021
jhawthorn pushed a commit that referenced this pull request Aug 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants