RFR (S) 8211980: Remove ThreadHeapSampler enable/disable/enabled methods

JC Beyler jcbeyler at google.com
Wed Oct 10 03:57:45 UTC 2018


Hi all,

When talking with Serguei about JDK-8201655
<https://bugs.openjdk.java.net/browse/JDK-8201655>, we talked about why
ThreadHeapSampler has an enabled/disabled when we could have just used the
should_post_sampled_object_alloc to begin with.

Could I get a review for this:
Webrev: http://cr.openjdk.java.net/~jcbeyler/8211980/webrev.00/
Bug: https://bugs.openjdk.java.net/browse/JDK-8211980

This passed my testing on my dev machine in release and fastdebug.

The question I would like to raise here at the same time (in order to
reduce email spam and because it should be included in the review I
believe) is:
  - When I did the enable/disable, I used OrderAccess to do so after a
reviewer asked for it

  - From what I can tell, JVMTI_SUPPORT_FLAG does not use it and does
instead:

#define JVMTI_SUPPORT_FLAG(key)                                           \
  private:                                                                \
  static bool  _##key;                                                    \
  public:                                                                 \
  inline static void set_##key(bool on) {                                 \
    JVMTI_ONLY(_##key = (on != 0));                                       \
    NOT_JVMTI(report_unsupported(on));                                    \
  }                                                                       \
  inline static bool key() {                                              \
    JVMTI_ONLY(return _##key);                                            \
    NOT_JVMTI(return false);                                              \
  }

Should it (ie in a future bug/webrev)?

Thanks,
Jc
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/serviceability-dev/attachments/20181009/54ca97cc/attachment-0001.html>


More information about the serviceability-dev mailing list