Skip to content
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

Add a DTrace probe for string capacity resizes #110

Open
wants to merge 1 commit into
base: trunk
from

Conversation

@tenderlove
Copy link

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@3b15d4a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

1 participant
You can’t perform that action at this time.