jstack.stp should work with -XX:+UseCompressedOops

Mark Wielaard mjw at redhat.com
Thu Aug 2 13:15:47 PDT 2012


On Thu, Aug 02, 2012 at 05:30:11PM +0900, Yasumasa Suenaga wrote:
> I've made a patch for Icedtea7 which is attached this email, and
> it works fine on my environment on above.

Thanks. At first glance it looks OK.
Small comment below about the systemtap_v >= "1.8" placement.

None of our testcases caught this (but we only have two).
Do you happen to have an example where compressed oops is
triggered and jstack() gives a wrong stack? I couldn't get
it to trigger with a simple test.

> +  /**
> +   * Does target process use CompressedOops ?
> +   */
> +  if(@var("UseCompressedOops at globals.cpp")){
> +    NarrowOopStruct[pid()] = %( systemtap_v >= "1.8"
> +                               %? &@var("_narrow_oop at universe.cpp")
> +                               %: $_narrow_oop %);
> +  }
> +  else{
> +    NarrowOopStruct[pid()] = 0;
> +  }

Since @var only works with systemtap_v >= 1.8 the whole check should
be inside the version check:

  %( systemtap_v >= "1.8"
    %? if (@var("UseCompressedOops at globals.cpp")) {
         NarrowOopStruct[pid()] = &@var("_narrow_oop at universe.cpp");
       } else {
         NarrowOopStruct[pid()] = 0;
       }
    %: NarrowOopStruct[pid()] = 0;
  %)

That means CompressedOops detection doesn't work against older systemtap
versions, but people having such a new hotspot version will normally
also have a new systemtap version.

Cheers,

Mark



More information about the distro-pkg-dev mailing list