Bug #7586

Useless sourceline in DTrace parse__begin and parse__end probes

Added by Vit Ondruch over 1 year ago. Updated over 1 year ago.

[ruby-core:50964]
Status:Closed
Priority:Normal
Assignee:Aaron Patterson
Category:-
Target version:-
ruby -v:ruby 2.0.0dev (2012-12-17 trunk 38422) [x86_64-linux] Backport:

Description

I am not 100% sure, but isn't the 'parser->parserrubysourceline' at https://github.com/ruby/ruby/blob/trunk/parse.y#L5322 always '1'? Does it make sense to pass this information to DTrace parsebegin(const char *, int) and parseend(const char *, int) probes?

History

#1 Updated by Nobuyoshi Nakada over 1 year ago

  • Status changed from Open to Closed

It can be other than 1 if the line number is given to eval.

#2 Updated by Vit Ondruch over 1 year ago

Thank you for explanation.

#3 Updated by Motohiro KOSAKI over 1 year ago

I think we don't pass 1 when no line information. 0 or -1 is better. and need to be documented when such special line number is happen.

#4 Updated by Motohiro KOSAKI over 1 year ago

s/don't pass/souldn't pass/

#5 Updated by Vit Ondruch over 1 year ago

kosaki (Motohiro KOSAKI) wrote:

I think we don't pass 1 when no line information. 0 or -1 is better. and need to be documented when such special line number is happen.

May be it could be worth of own issue?

#6 Updated by Vit Ondruch over 1 year ago

=begin
Just FYI, this is the output I get testing with SystemTap:

# stap -e 'probe ruby.parse.begin { printf("*** file: %s line: %d\n", parsedfile, parsedline) }' -c 'ruby --disable-gems -e "eval \"puts 1234\", nil, \"foo\", 8"'
1234
*** file: internal:prelude line: 1
*** file: internal:enc/prelude line: 1
*** file: internal:gem_prelude line: 1
*** file: -e line: 1
*** file: foo line: 8

=end

Also available in: Atom PDF