Skip to content

jruby.runtime.arguments#62

Merged
kares merged 1 commit intojruby:masterfrom
kares:runtime-arguments
Nov 1, 2011
Merged

jruby.runtime.arguments#62
kares merged 1 commit intojruby:masterfrom
kares:runtime-arguments

Conversation

@kares
Copy link
Member

@kares kares commented Oct 6, 2011

Hey once again,

I was trying to accomplish a goal of being able to --profile a runtime created by jruby-rack thus I added (generic) support for passing "command-line" arguments via a jruby.runtime.arguments parameter. e.g. :

<context-param>
    <param-name>jruby.runtime.arguments</param-name>
    <param-value>--profile</param-value>
</context-param>

Of course one can pass anything jruby accepts on the command-line, but my main motivation would be profiling within a container, it ain't perfect as it interferes with trapping signals (if the container such as trinidad does trap ^C).

Unfortunately it does not work as expected and I was hoping for some advice, if it's doable or I'm heading towards a dead-end.
I'm running jruby -J-Djruby.runtime.arguments=--profile -S trinidad the runtime ends up being profiled as expected but all method names are shown as <unknown> :

main thread profile results:
Total time: 10.43

     total        self    children       calls  method
----------------------------------------------------------------
     10.39        0.01       10.38        3293  <unknown>
     10.23        0.00       10.23        3594  <unknown>
     10.23        0.00       10.23           1  <unknown>
     10.23        0.00       10.23          14  <unknown>
     10.23        0.00       10.23           1  <unknown>
     10.23        0.00       10.23           1  <unknown>
     10.23        0.00       10.23           1  <unknown>
      ...

Is there anything I could do to make the method names "visible" ?

Appreciate any input ...

@kares
Copy link
Member Author

kares commented Oct 7, 2011

actually I did find out that JRuby uses the global Ruby runtime for method names while profiling.
i'll try to extend it and if it gets into jruby-master, merge this one if no one has objections against this "hack" of mine ...

@nicksieger
Copy link
Member

Ah, that makes sense. Go ahead and merge this when you feel like it after you get it working with JRuby-proper changes.

@calavera
Copy link
Contributor

👍

kares added a commit that referenced this pull request Nov 1, 2011
@kares kares merged commit 9696982 into jruby:master Nov 1, 2011
@kares
Copy link
Member Author

kares commented Nov 1, 2011

I do find being able to pass arguments useful even beyond profiling.
for the record here's the attempt to refactor profiling in JRuby jruby/jruby#96

@kares
Copy link
Member Author

kares commented Nov 1, 2011

and so the build failed after including this in --1.9 mode with a "stack level too deep"
http://travis-ci.org/#!/jruby/jruby-rack/builds/266593
I can not reproduce the failure locally :( any ideas ?

@nicksieger
Copy link
Member

Yeah, I don't see it on my machine either. I wouldn't worry about it for now.

@kares
Copy link
Member Author

kares commented Nov 4, 2011

I'm starting to get pretty sure that these CI failures in --1.9 mode are related to the jruby upgrade on travis (1.6.4 -> 1.6.5).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants