1 Reply Latest reply on Jan 15, 2016 5:16 AM by adinn

    how can i make all method in a jar be traced and get its method name and execute time

    rjl493456442

      besides, how can i get the method's position in call stack?

      I'm not so familier in java programming,so with code or pseudo code will be much helpful. Thanks

        • 1. Re: how can i make all method in a jar be traced and get its method name and execute time
          adinn

          Hi,

           

          If you want to trace all methods in a jar then I recommend you find a different tool. Byteman is normally used to transform single methods or small groups of methods. Bulk method transformations are better done using a general purpose Aspect Oriented Programming tool (for example you might look at AspectJ).

           

          It is possible to use Byteman do what you want. You would have to write a standalone program to read each class in your jar, use reflection to identify the methods of the class and then generate a Byteman rule to track entry and exit times for each method, dumping the method name and elapsed time at exit. If you are not familiar with Java then I don't think you will find it easy to write this program.

           

          regards,

           

           

          Andrew Dinn