Project

General

Profile

Actions

Bug #7586

closed

Useless sourceline in DTrace parse__begin and parse__end probes

Bug #7586: Useless sourceline in DTrace parse__begin and parse__end probes

Added by vo.x (Vit Ondruch) almost 13 years ago. Updated almost 13 years ago.

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

Description

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

Updated by nobu (Nobuyoshi Nakada) almost 13 years ago Actions #1 [ruby-core:50975]

  • Status changed from Open to Closed

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

Updated by vo.x (Vit Ondruch) almost 13 years ago Actions #2 [ruby-core:50976]

Thank you for explanation.

Updated by kosaki (Motohiro KOSAKI) almost 13 years ago Actions #3 [ruby-core:50977]

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.

Updated by kosaki (Motohiro KOSAKI) almost 13 years ago Actions #4 [ruby-core:50979]

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

Updated by vo.x (Vit Ondruch) almost 13 years ago Actions #5 [ruby-core:50984]

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?

Updated by vo.x (Vit Ondruch) almost 13 years ago Actions #6 [ruby-core:50985]

=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

Actions

Also available in: PDF Atom