Project

General

Profile

Actions

Bug #3660

closed

Trace events seem to be missing

Added by rogerdpack (Roger Pack) over 14 years ago. Updated over 12 years ago.

Status:
Rejected
Target version:
ruby -v:
ruby 1.9.3dev (2010-07-22 trunk 28717) [i386-mingw32]
Backport:
[ruby-core:31633]

Description

=begin
When tracing this code:

a = [1,2,3]
a.each{|n|
p n
}

with 1.9.1 I get "expected output" list this:

http://gist.github.com/506859

However, with 1.9.2+ I get almost no output:

C:\dev\ruby\ruby-prof>ruby -vrtracer test_array.rb
ruby 1.9.2dev (2010-07-02) [i386-mingw32]
#0:test_array.rb:1::-: a = [1,2,3]
#0:test_array.rb:2::-: a.each{|n|
#0:test_array.rb:3::-: p n
1
#0:test_array.rb:3::-: p n
2
#0:test_array.rb:3::-: p n
3

This on windows and Linux.
Unless it's expected, in which case it's just missing the return statement.
Thanks.
-r
=end

Actions #1

Updated by rogerdpack (Roger Pack) over 14 years ago

=begin
still the case with ruby 1.9.3dev (2010-08-26 trunk 29104) [i386-mingw32]
=end

Actions #2

Updated by shyouhei (Shyouhei Urabe) over 14 years ago

  • Status changed from Open to Assigned
  • Assignee set to ko1 (Koichi Sasada)

=begin

=end

Actions #3

Updated by wanabe (_ wanabe) over 14 years ago

  • Assignee changed from ko1 (Koichi Sasada) to keiju (Keiju Ishitsuka)

=begin
It is intended. see r24226.
But I don't know the reason of this change.

Keiju, I would appreciate it if you could explain why.
=end

Actions #4

Updated by rocky (Rocky Bernstein) almost 14 years ago

=begin
I think this was fixed by r29914 which changes

elsif caller.size <= 1

to:

elsif caller.count {|bt| /\A<internal:[^<>]+>:/ !~ bt} <= 1

=end

Actions #5

Updated by headius (Charles Nutter) almost 14 years ago

=begin
It's worth mentioning that tracer is broken in JRuby for the same reason. Depending on caller to be the same all the time is a bit fragile. Ideally there'd be a better marker for whether tracer should be started up right away or not.
=end

Actions #6

Updated by rogerdpack (Roger Pack) almost 14 years ago

=begin
This isn't actually a problem with "-rtracer" not turning Tracer.on, it's that it does output, but outputs far fewer symbols (mostly missing tons of returns).
Cheers!
-r
=end

Actions #7

Updated by rogerdpack (Roger Pack) over 13 years ago

=begin
Keiju was this expected? I'm thinking it wasn't...
=end

Actions #8

Updated by nahi (Hiroshi Nakamura) over 13 years ago

  • Target version set to 1.9.3

Updated by keiju (Keiju Ishitsuka) over 13 years ago

  • Status changed from Assigned to Rejected

These trace messages is spec that ignore c-func and c-return event, now.

If you want to print c-func and c-return event, please set:

Tracer::display_c_call = true

Updated by Anonymous over 12 years ago

If you want to print c-func and c-return event, please set:

 Tracer::display_c_call = true
...
 However, with 1.9.2+ I get almost no output:

 C:\dev\ruby\ruby-prof>ruby -vrtracer test_array.rb
 ruby 1.9.2dev (2010-07-02) [i386-mingw32]
 #0:test_array.rb:1::-: a = [1,2,3]
 #0:test_array.rb:2::-: a.each{|n|
 #0:test_array.rb:3::-:   p n
 1
 #0:test_array.rb:3::-:   p n
 2
 #0:test_array.rb:3::-:   p n
 3

It works.
Still seems a bit odd to me that it doesn't appear to log a "return"
call from the #each method unless you have display_c_call turned on
[?]

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0