• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Any easy/recommended way for tracing all calls made from point A to B?

 
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Working strictly from the command line, unable to use a gui interface and would like to trace calls being made.
Have tried Thread.dumpStack() which isn't too bad, but it leaves out all those extra "side" calls which can be very important.
Adding System.out.println calls would be great but then I would potentially have to add 100s of these.
Is there any recommendations of any good ideas someone came up with that would make life easier when trying to trace (or step through) calls when a gui interface isn't available?
 
Bartender
Posts: 10780
71
Hibernate Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Tom Landry wrote:Adding System.out.println calls would be great but then I would potentially have to add 100s of these.


And what makes you think you won't have hundreds (or even thousands) anyway? Furthermore, what makes you think that a GUI will help?

I suspect there are path analysis (which I suspect is what you want) tools out there; but I'm afraid I'm not up on the latest and greatest.

I suggest you back up and tell us why you want to do this; ie - what's the actual problem you're trying to solve?

Winston
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This may help: http://www.slf4j.org/extensions.html#javaagent

You could also check out what Runtime.traceMethodCalls does on your platform.
 
Ranch Hand
Posts: 449
Scala IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think AspectJ might also helpful here, you can define your pointcut for any specific scenario to log.
 
Tom Landry
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Winston Gutkowski wrote:

Tom Landry wrote:Adding System.out.println calls would be great but then I would potentially have to add 100s of these.



And what makes you think you won't have hundreds (or even thousands) anyway?



Not sure if that is my only choice which is why I am asking.


Winston Gutkowski wrote:Furthermore, what makes you think that a GUI will help?



With a gui IDE one could produce a breakpoint on the entry and step through the code and see exactly the flow of the application.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic