--------------ms020203040908090301040308
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Mauricio,

> ... and found what is causing the problem. rcov's tests do something like:
> 
> batsman@tux-chan:~/mess/current$ cat ruby-prof-bomb.rb 
> str  {module Foo; class Bar; def foo; end end end}
> eval str
> Foo::Bar.new.foo
> Object.class_eval{ remove_const :Foo }
> eval str
> Foo::Bar.new.foo

Interesting, I never would have thought of that.  Your patch looks fine 
- I've applied it with a slight modification.  Results will now be 
output like this:

Foo::Bar#foo
Foo::Bar#foo_1
Foo::Bar#foo_2
Foo::Bar#foo_3
etc...

So you can tell the different calls apart.

> ruby_prof seems to work now, and there are two separate entries in the call
> graph for Foo::Bar#foo (see the attached ruby-prof-out-ok.txt). I think
> keeping them that way, as opposed to consolidating them, makes sense, since
> they could have been entirely different methods.

Yeah, agreed, and now you can tell the apart with the naming scheme.

> Before I forget, a minor nitpick }:)
> Could you release a tarball through Rubyforge, in addition to the RubyGems
> packages? Some systems like FreeBSD's ports are happier when there's an
> online accessible tarball. Other repackagers will appreciate too.

Done.

gem update to get ruby-prof-0.4.1.

There is also a new RubyProf.running? method requested by David Schmidt.

Thanks for the feedback and patch,

Charlie

P.S. Sent you a separate email yesterday, not sure if you received it?


> 
> 
> 
> ------------------------------------------------------------------------
> 
> $ cat ruby-prof-bomb2.rb 
> str  {module Foo; class Bar; def foo; end end end}
> eval str
> Foo::Bar.new.foo
> Object.class_eval{ remove_const :Foo }
> eval str
> Foo::Bar.new.foo
> Foo::Bar.new.foo
> 
> $ ruby-prof -p graph ruby-prof-bomb2.rb 
> Thread ID: -605342748
>   %total   %self     total      self    children             calls   Name
> --------------------------------------------------------------------------------
>    0.00%   0.00%      0.00      0.00      0.00                   1     #toplevel
>                       0.00      0.00      0.00                 1/1     Kernel#load
> --------------------------------------------------------------------------------
>                       0.00      0.00      0.00                 2/2     Kernel#load
>    0.00%   0.00%      0.00      0.00      0.00                   2     Foo::Bar#foo
> --------------------------------------------------------------------------------
>                       0.00      0.00      0.00                 3/3     Class#new
>    0.00%   0.00%      0.00      0.00      0.00                   3     Object#initialize
> --------------------------------------------------------------------------------
>                       0.00      0.00      0.00                 1/1     Kernel#load
>    0.00%   0.00%      0.00      0.00      0.00                   1     Module#class_eval
>                       0.00      0.00      0.00                 1/1     Module#remove_const
> --------------------------------------------------------------------------------
>                       0.00      0.00      0.00                 2/2     Kernel#load
>    0.00%   0.00%      0.00      0.00      0.00                   2     Kernel#eval
>                       0.00      0.00      0.00                 2/2     Module#method_added
>                       0.00      0.00      0.00                 2/2     Class#inherited
> --------------------------------------------------------------------------------
>                       0.00      0.00      0.00                 1/1     Module#class_eval
>    0.00%   0.00%      0.00      0.00      0.00                   1     Module#remove_const
> --------------------------------------------------------------------------------
>                       0.00      0.00      0.00                 2/2     Kernel#eval
>    0.00%   0.00%      0.00      0.00      0.00                   2     Class#inherited
> --------------------------------------------------------------------------------
>                       0.00      0.00      0.00                 2/2     Kernel#eval
>    0.00%   0.00%      0.00      0.00      0.00                   2     Module#method_added
> --------------------------------------------------------------------------------
>                       0.00      0.00      0.00                 1/1     Kernel#load
>    0.00%   0.00%      0.00      0.00      0.00                   1     Foo::Bar#foo
> --------------------------------------------------------------------------------
>                       0.00      0.00      0.00                 1/1     #toplevel
>    0.00%   0.00%      0.00      0.00      0.00                   1     Kernel#load
>                       0.00      0.00      0.00                 1/2     Foo::Bar#foo
>                       0.00      0.00      0.00                 2/2     Kernel#eval
>                       0.00      0.00      0.00                 1/1     Module#class_eval
>                       0.00      0.00      0.00                 3/3     Class#new
> --------------------------------------------------------------------------------
>                       0.00      0.00      0.00                 3/3     Kernel#load
>    0.00%   0.00%      0.00      0.00      0.00                   3     Class#new
>                       0.00      0.00      0.00                 3/3     <Class::Object>#allocate
>                       0.00      0.00      0.00                 3/3     Object#initialize
> --------------------------------------------------------------------------------
>                       0.00      0.00      0.00                 3/3     Class#new
>    0.00%   0.00%      0.00      0.00      0.00                   3     <Class::Object>#allocate

--------------ms020203040908090301040308
Content-Type: application/x-pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7s"
Content-Description: S/MIME Cryptographic Signature

MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIJAzCC
AtwwggJFoAMCAQICEFby1ChIT+pmYLkFBWX20TIwDQYJKoZIhvcNAQEEBQAwYjELMAkGA1UE
BhMCWkExJTAjBgNVBAoTHFRoYXd0ZSBDb25zdWx0aW5nIChQdHkpIEx0ZC4xLDAqBgNVBAMT
I1RoYXd0ZSBQZXJzb25hbCBGcmVlbWFpbCBJc3N1aW5nIENBMB4XDTA2MDUxMzIyNTQyM1oX
DTA3MDUxMzIyNTQyM1owQzEfMB0GA1UEAxMWVGhhd3RlIEZyZWVtYWlsIE1lbWJlcjEgMB4G
CSqGSIb3DQEJARYRY2Zpc0BzYXZhZ2V4aS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw
ggEKAoIBAQDDPyi9Z2s8673fAOxX6/EhWhAo2bb8/BcU7xiV49a9TWExEAufzQuAKvKdRWlm
MKuTwdU/QKgrZ1bCcb3cIznHjFI5AmG4nkqUMzqzgzPDDwbiE6AXYXzdd+efDF1mVUQJF/nm
N26xC576KC3e+T1jK2n4DosnIxqQlTVH02huREgMrnPDR82susVvtKa3BV1xx1Fm1+8qkISp
4Ym8LaBQ72nH879OFLHeH/1oP4FAp7qfZAWtlse8mSajhHN6mAH+wFUOG1yrNsM2mKVVAhIv
ByolY+VTa9RBWXgvOhdmJyQd56fag85/zaUjQfUChiYBmx4IWVbc9TKtcx6btDxrAgMBAAGj
LjAsMBwGA1UdEQQVMBOBEWNmaXNAc2F2YWdleGkuY29tMAwGA1UdEwEB/wQCMAAwDQYJKoZI
hvcNAQEEBQADgYEAeCTsNZ/SvrF8JPbFBychryTZlDzu415g2JQDaPa9+gBFaMpWvsE/rzNO
2nBhz4nXayb8QQMA5+RjTav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