WebLogic profiling problems

Help
2009-03-04
2013-04-17
  • Randy Shaffer
    Randy Shaffer
    2009-03-04

    Hi,

    I wrote a JIP class loader filter for WebLogic and built a profiler.jar that included it.

    I wasn't getting any profiler output, so I ran the profiler with debug=on.

    Below is output that seems to verify that I got the correct class loader.  Also some simple exception output that I assume is coming from JIP.  Do you know what the problem might be, or how I can get you more info to make a determination?

    Thanks, Randy

    INST    com/taw/cca/messageprovider/interactionsmessages/ParamExtension
    [weblogic.utils.classloaders.ChangeAwareClassLoader]
    Catch: java/lang/Exception
    Catch: java/lang/Exception
    Catch: java/lang/Exception
    Catch: java/lang/Exception
    Catch: java/lang/Exception
    INST    com/taw/cca/messageprovider/interactionsmessages/ParamExtensionData
       [weblogic.utils.classloaders.ChangeAwareClassLoader]
    Catch: java/lang/Exception
    Catch: java/lang/Exception

     
    • Andrew Wilcox
      Andrew Wilcox
      2009-03-05

      Hi Randy,

      The exceptions aren't related to you no seeing output. Many containers, like WebLogic, execute code at startup to gauge the capabilities of the runtime environment. It's not unusual for this code to generate "expected" exceptions. This is probably why you're seeing exceptions with debug on. JIP handles these exceptions, so they don't impact profiling.

      When you start exercising code, you should see output whenever a method is called. Something like this:

      (Bar:baz)
      ...

      If not, check the profile properties file to make sure profiler=on or profiler=off and remote=on (which I assume is already the case -- but I have to ask anyway) If you're still having problems, post your profile properties file here and I look for any gotchas.

      Andrew.

       
    • Randy Shaffer
      Randy Shaffer
      2009-03-05

      Hi Andrew,

      Below is my profiler properties.  I didn't make many modifications to your generic webapp.profile.properties file.

      I know that I executed operations that should have produced profile output - I can see them in the log.  I also see the telltale "start" and "finish" in the log for the remote profiler invocation.

      Thanks.

      webapp.profile.properties:

      #
      # Is the profiler on or off when the app starts?
      # (on | off)
      # default = on
      #
      profiler=off
      #
      # Can the profiler be controlled remotely ?
      # (on | off)
      # default = off
      #
      remote=on
      #
      # TCP listen port for remote control
      # default =15599
      #
      port=15599
      #
      # Class Loader filters for different runtine environments
      # (The system will cycle through these until it finds one that
      # can filter in the current environment)
      #
      ClassLoaderFilter.1=com.mentorgen.tools.profile.instrument.clfilter.WebLogicClassLoaderFilter
      ClassLoaderFilter.2=com.mentorgen.tools.profile.instrument.clfilter.WebAppClassLoaderFilter
      ClassLoaderFilter.3=com.mentorgen.tools.profile.instrument.clfilter.StandardClassLoaderFilter
      #
      # What is the maximum depth for thread dumps
      # (-1 means no limit)
      # default = -1
      # (you may also use 'compact')
      #
      thread-depth=compact
      #
      # When compacting thread dumps, what in the minimum total time you want
      # to show
      # default = 10 (ms)
      #
      thread.compact.threshold.ms=1
      #
      # What is the maximum number of methods to show in the method dump
      # (-1 means no limit)
      # default = -1
      # (you may also use 'compact')
      #
      max-method-count=compact
      #
      # defaults to 10
      #
      method.compact.threshold.ms=1
      #
      # What is the default file name for the profile information
      # default=./profile.txt
      #
      #file=profile.txt
      #
      # What packages are excluded from the display
      # (comma separated)
      # Note: com.mentorgen.tools.profile is always excluded
      #
      exclude=org.apache.xalan.xsltc
      #debug=on
      track.object.alloc=on 
      output=xml
      #profiler-class=net.sourceforge.jiprof.timeline.TimeLineProfiler

       
    • Andrew Wilcox
      Andrew Wilcox
      2009-03-09

      Hi Randy,

      You profile.properties file looks great, so I'm stumped!
      App servers all have different classloader hierarchies, which sometimes change from release to release! So it's often quite hard to figure out exactly what's going on.

      If you discovered which classloader was being used by doing this:

      Thread.currentThread().getContextClassLoader().getClass().getName();

      You should try doing this to make sure that the classloader names agree:

      this.getClass().getClassLoader().getClass().getName();

      If not, try using the other classname.

      Andrew.

       
    • Randy Shaffer
      Randy Shaffer
      2009-03-09

      Hi Andrew,

      Thanks for looking at this.  I discovered the problem was my specification of a relative path for the profiler output directory in the 'file' command.  When I changed web servers, the location of the profiler output changed.  Doh!  Looks like everything is working fine :)

      Randy