src/hotspot/share/gc/shared/gcTrace.cpp
author stefank
Thu, 22 Feb 2018 18:36:07 +0100
changeset 49047 8f004146e407
parent 47216 71c04702a3d5
child 49982 9042ffe5b7fe
permissions -rw-r--r--
8198515: Extract SoftReferencePolicy code out of CollectorPolicy Reviewed-by: pliden, sjohanss
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
18025
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
     1
/*
37137
62fd3fb4b1b1 8151085: Change G1 concurrent timer and tracer measuring time
sangheki
parents: 34300
diff changeset
     2
 * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
18025
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
     4
 *
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
     7
 * published by the Free Software Foundation.
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
     8
 *
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    13
 * accompanied this code).
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    14
 *
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    18
 *
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    21
 * questions.
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    22
 *
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    23
 */
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    24
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    25
#include "precompiled.hpp"
30764
fec48bf5a827 8079792: GC directory structure cleanup
pliden
parents: 29081
diff changeset
    26
#include "gc/shared/copyFailedInfo.hpp"
fec48bf5a827 8079792: GC directory structure cleanup
pliden
parents: 29081
diff changeset
    27
#include "gc/shared/gcHeapSummary.hpp"
fec48bf5a827 8079792: GC directory structure cleanup
pliden
parents: 29081
diff changeset
    28
#include "gc/shared/gcId.hpp"
fec48bf5a827 8079792: GC directory structure cleanup
pliden
parents: 29081
diff changeset
    29
#include "gc/shared/gcTimer.hpp"
fec48bf5a827 8079792: GC directory structure cleanup
pliden
parents: 29081
diff changeset
    30
#include "gc/shared/gcTrace.hpp"
fec48bf5a827 8079792: GC directory structure cleanup
pliden
parents: 29081
diff changeset
    31
#include "gc/shared/objectCountEventSender.hpp"
fec48bf5a827 8079792: GC directory structure cleanup
pliden
parents: 29081
diff changeset
    32
#include "gc/shared/referenceProcessorStats.hpp"
18025
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    33
#include "memory/heapInspection.hpp"
29081
c61eb4914428 8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents: 28940
diff changeset
    34
#include "memory/resourceArea.hpp"
18706
2d278f82253d 8015683: object_count_after_gc should have the same timestamp for all events
ehelin
parents: 18705
diff changeset
    35
#include "runtime/os.hpp"
18025
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    36
#include "utilities/globalDefinitions.hpp"
27684
e0391b2bf625 8064581: Move INCLUDE_ALL_GCS include section to the end of the include list
stefank
parents: 25350
diff changeset
    37
#include "utilities/macros.hpp"
21767
41eaa9a17059 8028128: Add a type safe alternative for working with counter based data
mgronlun
parents: 18706
diff changeset
    38
#include "utilities/ticks.inline.hpp"
18025
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    39
#if INCLUDE_ALL_GCS
30764
fec48bf5a827 8079792: GC directory structure cleanup
pliden
parents: 29081
diff changeset
    40
#include "gc/g1/evacuationInfo.hpp"
18025
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    41
#endif
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    42
21767
41eaa9a17059 8028128: Add a type safe alternative for working with counter based data
mgronlun
parents: 18706
diff changeset
    43
void GCTracer::report_gc_start_impl(GCCause::Cause cause, const Ticks& timestamp) {
18025
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    44
  _shared_gc_info.set_cause(cause);
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    45
  _shared_gc_info.set_start_timestamp(timestamp);
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    46
}
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    47
21767
41eaa9a17059 8028128: Add a type safe alternative for working with counter based data
mgronlun
parents: 18706
diff changeset
    48
void GCTracer::report_gc_start(GCCause::Cause cause, const Ticks& timestamp) {
18025
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    49
  report_gc_start_impl(cause, timestamp);
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    50
}
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    51
21767
41eaa9a17059 8028128: Add a type safe alternative for working with counter based data
mgronlun
parents: 18706
diff changeset
    52
void GCTracer::report_gc_end_impl(const Ticks& timestamp, TimePartitions* time_partitions) {
18025
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    53
  _shared_gc_info.set_sum_of_pauses(time_partitions->sum_of_pauses());
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    54
  _shared_gc_info.set_longest_pause(time_partitions->longest_pause());
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    55
  _shared_gc_info.set_end_timestamp(timestamp);
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    56
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    57
  send_phase_events(time_partitions);
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    58
  send_garbage_collection_event();
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    59
}
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    60
21767
41eaa9a17059 8028128: Add a type safe alternative for working with counter based data
mgronlun
parents: 18706
diff changeset
    61
void GCTracer::report_gc_end(const Ticks& timestamp, TimePartitions* time_partitions) {
18025
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    62
  report_gc_end_impl(timestamp, time_partitions);
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    63
}
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    64
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    65
void GCTracer::report_gc_reference_stats(const ReferenceProcessorStats& rps) const {
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    66
  send_reference_stats_event(REF_SOFT, rps.soft_count());
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    67
  send_reference_stats_event(REF_WEAK, rps.weak_count());
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    68
  send_reference_stats_event(REF_FINAL, rps.final_count());
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    69
  send_reference_stats_event(REF_PHANTOM, rps.phantom_count());
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    70
}
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    71
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    72
#if INCLUDE_SERVICES
18704
226ce98e75e6 8015972: Refactor the sending of the object count after GC event
ehelin
parents: 18025
diff changeset
    73
class ObjectCountEventSenderClosure : public KlassInfoClosure {
226ce98e75e6 8015972: Refactor the sending of the object count after GC event
ehelin
parents: 18025
diff changeset
    74
  const double _size_threshold_percentage;
226ce98e75e6 8015972: Refactor the sending of the object count after GC event
ehelin
parents: 18025
diff changeset
    75
  const size_t _total_size_in_words;
21767
41eaa9a17059 8028128: Add a type safe alternative for working with counter based data
mgronlun
parents: 18706
diff changeset
    76
  const Ticks _timestamp;
18704
226ce98e75e6 8015972: Refactor the sending of the object count after GC event
ehelin
parents: 18025
diff changeset
    77
226ce98e75e6 8015972: Refactor the sending of the object count after GC event
ehelin
parents: 18025
diff changeset
    78
 public:
33107
77bf0d2069a3 8134953: Make the GC ID available in a central place
brutisso
parents: 32817
diff changeset
    79
  ObjectCountEventSenderClosure(size_t total_size_in_words, const Ticks& timestamp) :
18704
226ce98e75e6 8015972: Refactor the sending of the object count after GC event
ehelin
parents: 18025
diff changeset
    80
    _size_threshold_percentage(ObjectCountCutOffPercent / 100),
18706
2d278f82253d 8015683: object_count_after_gc should have the same timestamp for all events
ehelin
parents: 18705
diff changeset
    81
    _total_size_in_words(total_size_in_words),
2d278f82253d 8015683: object_count_after_gc should have the same timestamp for all events
ehelin
parents: 18705
diff changeset
    82
    _timestamp(timestamp)
18704
226ce98e75e6 8015972: Refactor the sending of the object count after GC event
ehelin
parents: 18025
diff changeset
    83
  {}
18025
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    84
18704
226ce98e75e6 8015972: Refactor the sending of the object count after GC event
ehelin
parents: 18025
diff changeset
    85
  virtual void do_cinfo(KlassInfoEntry* entry) {
226ce98e75e6 8015972: Refactor the sending of the object count after GC event
ehelin
parents: 18025
diff changeset
    86
    if (should_send_event(entry)) {
33107
77bf0d2069a3 8134953: Make the GC ID available in a central place
brutisso
parents: 32817
diff changeset
    87
      ObjectCountEventSender::send(entry, _timestamp);
18704
226ce98e75e6 8015972: Refactor the sending of the object count after GC event
ehelin
parents: 18025
diff changeset
    88
    }
226ce98e75e6 8015972: Refactor the sending of the object count after GC event
ehelin
parents: 18025
diff changeset
    89
  }
18025
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    90
18704
226ce98e75e6 8015972: Refactor the sending of the object count after GC event
ehelin
parents: 18025
diff changeset
    91
 private:
226ce98e75e6 8015972: Refactor the sending of the object count after GC event
ehelin
parents: 18025
diff changeset
    92
  bool should_send_event(const KlassInfoEntry* entry) const {
226ce98e75e6 8015972: Refactor the sending of the object count after GC event
ehelin
parents: 18025
diff changeset
    93
    double percentage_of_heap = ((double) entry->words()) / _total_size_in_words;
226ce98e75e6 8015972: Refactor the sending of the object count after GC event
ehelin
parents: 18025
diff changeset
    94
    return percentage_of_heap >= _size_threshold_percentage;
226ce98e75e6 8015972: Refactor the sending of the object count after GC event
ehelin
parents: 18025
diff changeset
    95
  }
226ce98e75e6 8015972: Refactor the sending of the object count after GC event
ehelin
parents: 18025
diff changeset
    96
};
18025
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    97
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    98
void GCTracer::report_object_count_after_gc(BoolObjectClosure* is_alive_cl) {
18704
226ce98e75e6 8015972: Refactor the sending of the object count after GC event
ehelin
parents: 18025
diff changeset
    99
  assert(is_alive_cl != NULL, "Must supply function to check liveness");
18025
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   100
18704
226ce98e75e6 8015972: Refactor the sending of the object count after GC event
ehelin
parents: 18025
diff changeset
   101
  if (ObjectCountEventSender::should_send_event()) {
18025
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   102
    ResourceMark rm;
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   103
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   104
    KlassInfoTable cit(false);
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   105
    if (!cit.allocation_failed()) {
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   106
      HeapInspection hi(false, false, false, NULL);
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   107
      hi.populate_table(&cit, is_alive_cl);
33107
77bf0d2069a3 8134953: Make the GC ID available in a central place
brutisso
parents: 32817
diff changeset
   108
      ObjectCountEventSenderClosure event_sender(cit.size_of_instances_in_words(), Ticks::now());
18025
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   109
      cit.iterate(&event_sender);
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   110
    }
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   111
  }
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   112
}
18704
226ce98e75e6 8015972: Refactor the sending of the object count after GC event
ehelin
parents: 18025
diff changeset
   113
#endif // INCLUDE_SERVICES
18025
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   114
23470
ff2a7ea4225d 8036703: Add trace event with statistics for the metaspace chunk free lists
ehelin
parents: 21767
diff changeset
   115
void GCTracer::report_gc_heap_summary(GCWhen::Type when, const GCHeapSummary& heap_summary) const {
18025
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   116
  send_gc_heap_summary_event(when, heap_summary);
23470
ff2a7ea4225d 8036703: Add trace event with statistics for the metaspace chunk free lists
ehelin
parents: 21767
diff changeset
   117
}
ff2a7ea4225d 8036703: Add trace event with statistics for the metaspace chunk free lists
ehelin
parents: 21767
diff changeset
   118
ff2a7ea4225d 8036703: Add trace event with statistics for the metaspace chunk free lists
ehelin
parents: 21767
diff changeset
   119
void GCTracer::report_metaspace_summary(GCWhen::Type when, const MetaspaceSummary& summary) const {
ff2a7ea4225d 8036703: Add trace event with statistics for the metaspace chunk free lists
ehelin
parents: 21767
diff changeset
   120
  send_meta_space_summary_event(when, summary);
ff2a7ea4225d 8036703: Add trace event with statistics for the metaspace chunk free lists
ehelin
parents: 21767
diff changeset
   121
ff2a7ea4225d 8036703: Add trace event with statistics for the metaspace chunk free lists
ehelin
parents: 21767
diff changeset
   122
  send_metaspace_chunk_free_list_summary(when, Metaspace::NonClassType, summary.metaspace_chunk_free_list_summary());
ff2a7ea4225d 8036703: Add trace event with statistics for the metaspace chunk free lists
ehelin
parents: 21767
diff changeset
   123
  if (UseCompressedClassPointers) {
ff2a7ea4225d 8036703: Add trace event with statistics for the metaspace chunk free lists
ehelin
parents: 21767
diff changeset
   124
    send_metaspace_chunk_free_list_summary(when, Metaspace::ClassType, summary.class_chunk_free_list_summary());
ff2a7ea4225d 8036703: Add trace event with statistics for the metaspace chunk free lists
ehelin
parents: 21767
diff changeset
   125
  }
18025
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   126
}
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   127
21767
41eaa9a17059 8028128: Add a type safe alternative for working with counter based data
mgronlun
parents: 18706
diff changeset
   128
void YoungGCTracer::report_gc_end_impl(const Ticks& timestamp, TimePartitions* time_partitions) {
18025
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   129
  assert(_tenuring_threshold != UNSET_TENURING_THRESHOLD, "Tenuring threshold has not been reported");
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   130
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   131
  GCTracer::report_gc_end_impl(timestamp, time_partitions);
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   132
  send_young_gc_event();
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   133
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   134
  _tenuring_threshold = UNSET_TENURING_THRESHOLD;
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   135
}
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   136
28940
c314cf1db3fa 8066566: Refactor ParNewGeneration to contain ParNewTracer
mlarsson
parents: 28024
diff changeset
   137
void YoungGCTracer::report_promotion_failed(const PromotionFailedInfo& pf_info) const {
18025
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   138
  send_promotion_failed_event(pf_info);
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   139
}
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   140
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   141
void YoungGCTracer::report_tenuring_threshold(const uint tenuring_threshold) {
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   142
  _tenuring_threshold = tenuring_threshold;
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   143
}
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   144
32608
ef2ec6fac731 8066443: Add G1 support for promotion event
sfriberg
parents: 32380
diff changeset
   145
bool YoungGCTracer::should_report_promotion_events() const {
ef2ec6fac731 8066443: Add G1 support for promotion event
sfriberg
parents: 32380
diff changeset
   146
  return should_report_promotion_in_new_plab_event() ||
ef2ec6fac731 8066443: Add G1 support for promotion event
sfriberg
parents: 32380
diff changeset
   147
          should_report_promotion_outside_plab_event();
ef2ec6fac731 8066443: Add G1 support for promotion event
sfriberg
parents: 32380
diff changeset
   148
}
ef2ec6fac731 8066443: Add G1 support for promotion event
sfriberg
parents: 32380
diff changeset
   149
28024
33102d6e1f06 8066441: Add PLAB trace event
sfriberg
parents: 27684
diff changeset
   150
bool YoungGCTracer::should_report_promotion_in_new_plab_event() const {
33102d6e1f06 8066441: Add PLAB trace event
sfriberg
parents: 27684
diff changeset
   151
  return should_send_promotion_in_new_plab_event();
33102d6e1f06 8066441: Add PLAB trace event
sfriberg
parents: 27684
diff changeset
   152
}
33102d6e1f06 8066441: Add PLAB trace event
sfriberg
parents: 27684
diff changeset
   153
33102d6e1f06 8066441: Add PLAB trace event
sfriberg
parents: 27684
diff changeset
   154
bool YoungGCTracer::should_report_promotion_outside_plab_event() const {
33102d6e1f06 8066441: Add PLAB trace event
sfriberg
parents: 27684
diff changeset
   155
  return should_send_promotion_outside_plab_event();
33102d6e1f06 8066441: Add PLAB trace event
sfriberg
parents: 27684
diff changeset
   156
}
33102d6e1f06 8066441: Add PLAB trace event
sfriberg
parents: 27684
diff changeset
   157
33102d6e1f06 8066441: Add PLAB trace event
sfriberg
parents: 27684
diff changeset
   158
void YoungGCTracer::report_promotion_in_new_plab_event(Klass* klass, size_t obj_size,
33102d6e1f06 8066441: Add PLAB trace event
sfriberg
parents: 27684
diff changeset
   159
                                                       uint age, bool tenured,
33102d6e1f06 8066441: Add PLAB trace event
sfriberg
parents: 27684
diff changeset
   160
                                                       size_t plab_size) const {
33102d6e1f06 8066441: Add PLAB trace event
sfriberg
parents: 27684
diff changeset
   161
  send_promotion_in_new_plab_event(klass, obj_size, age, tenured, plab_size);
33102d6e1f06 8066441: Add PLAB trace event
sfriberg
parents: 27684
diff changeset
   162
}
33102d6e1f06 8066441: Add PLAB trace event
sfriberg
parents: 27684
diff changeset
   163
33102d6e1f06 8066441: Add PLAB trace event
sfriberg
parents: 27684
diff changeset
   164
void YoungGCTracer::report_promotion_outside_plab_event(Klass* klass, size_t obj_size,
33102d6e1f06 8066441: Add PLAB trace event
sfriberg
parents: 27684
diff changeset
   165
                                                        uint age, bool tenured) const {
33102d6e1f06 8066441: Add PLAB trace event
sfriberg
parents: 27684
diff changeset
   166
  send_promotion_outside_plab_event(klass, obj_size, age, tenured);
33102d6e1f06 8066441: Add PLAB trace event
sfriberg
parents: 27684
diff changeset
   167
}
33102d6e1f06 8066441: Add PLAB trace event
sfriberg
parents: 27684
diff changeset
   168
21767
41eaa9a17059 8028128: Add a type safe alternative for working with counter based data
mgronlun
parents: 18706
diff changeset
   169
void OldGCTracer::report_gc_end_impl(const Ticks& timestamp, TimePartitions* time_partitions) {
18025
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   170
  GCTracer::report_gc_end_impl(timestamp, time_partitions);
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   171
  send_old_gc_event();
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   172
}
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   173
21767
41eaa9a17059 8028128: Add a type safe alternative for working with counter based data
mgronlun
parents: 18706
diff changeset
   174
void ParallelOldTracer::report_gc_end_impl(const Ticks& timestamp, TimePartitions* time_partitions) {
18025
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   175
  OldGCTracer::report_gc_end_impl(timestamp, time_partitions);
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   176
  send_parallel_old_event();
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   177
}
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   178
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   179
void ParallelOldTracer::report_dense_prefix(void* dense_prefix) {
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   180
  _parallel_old_gc_info.report_dense_prefix(dense_prefix);
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   181
}
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   182
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   183
void OldGCTracer::report_concurrent_mode_failure() {
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   184
  send_concurrent_mode_failure_event();
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   185
}
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   186
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   187
#if INCLUDE_ALL_GCS
41076
8c6aa0873dd1 8165455: Tracing events for G1 have incorrect metadata
ehelin
parents: 37137
diff changeset
   188
void G1MMUTracer::report_mmu(double time_slice_sec, double gc_time_sec, double max_time_sec) {
8c6aa0873dd1 8165455: Tracing events for G1 have incorrect metadata
ehelin
parents: 37137
diff changeset
   189
  send_g1_mmu_event(time_slice_sec * MILLIUNITS,
8c6aa0873dd1 8165455: Tracing events for G1 have incorrect metadata
ehelin
parents: 37137
diff changeset
   190
                    gc_time_sec * MILLIUNITS,
8c6aa0873dd1 8165455: Tracing events for G1 have incorrect metadata
ehelin
parents: 37137
diff changeset
   191
                    max_time_sec * MILLIUNITS);
31619
f27b8fcf4018 8078901: Add trace event for G1 MMU information
sjohanss
parents: 30764
diff changeset
   192
}
f27b8fcf4018 8078901: Add trace event for G1 MMU information
sjohanss
parents: 30764
diff changeset
   193
18025
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   194
void G1NewTracer::report_yc_type(G1YCType type) {
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   195
  _g1_young_gc_info.set_type(type);
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   196
}
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   197
21767
41eaa9a17059 8028128: Add a type safe alternative for working with counter based data
mgronlun
parents: 18706
diff changeset
   198
void G1NewTracer::report_gc_end_impl(const Ticks& timestamp, TimePartitions* time_partitions) {
18025
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   199
  YoungGCTracer::report_gc_end_impl(timestamp, time_partitions);
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   200
  send_g1_young_gc_event();
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   201
}
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   202
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   203
void G1NewTracer::report_evacuation_info(EvacuationInfo* info) {
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   204
  send_evacuation_info_event(info);
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   205
}
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   206
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   207
void G1NewTracer::report_evacuation_failed(EvacuationFailedInfo& ef_info) {
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   208
  send_evacuation_failed_event(ef_info);
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   209
  ef_info.reset();
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   210
}
32380
1dcdb686f0cb 8133530: Add JFR event for evacuation statistics
tschatzl
parents: 31619
diff changeset
   211
1dcdb686f0cb 8133530: Add JFR event for evacuation statistics
tschatzl
parents: 31619
diff changeset
   212
void G1NewTracer::report_evacuation_statistics(const G1EvacSummary& young_summary, const G1EvacSummary& old_summary) const {
1dcdb686f0cb 8133530: Add JFR event for evacuation statistics
tschatzl
parents: 31619
diff changeset
   213
  send_young_evacuation_statistics(young_summary);
1dcdb686f0cb 8133530: Add JFR event for evacuation statistics
tschatzl
parents: 31619
diff changeset
   214
  send_old_evacuation_statistics(old_summary);
1dcdb686f0cb 8133530: Add JFR event for evacuation statistics
tschatzl
parents: 31619
diff changeset
   215
}
1dcdb686f0cb 8133530: Add JFR event for evacuation statistics
tschatzl
parents: 31619
diff changeset
   216
34300
6075c1e0e913 8136679: JFR event for adaptive IHOP
tschatzl
parents: 33107
diff changeset
   217
void G1NewTracer::report_basic_ihop_statistics(size_t threshold,
6075c1e0e913 8136679: JFR event for adaptive IHOP
tschatzl
parents: 33107
diff changeset
   218
                                               size_t target_ccupancy,
6075c1e0e913 8136679: JFR event for adaptive IHOP
tschatzl
parents: 33107
diff changeset
   219
                                               size_t current_occupancy,
6075c1e0e913 8136679: JFR event for adaptive IHOP
tschatzl
parents: 33107
diff changeset
   220
                                               size_t last_allocation_size,
6075c1e0e913 8136679: JFR event for adaptive IHOP
tschatzl
parents: 33107
diff changeset
   221
                                               double last_allocation_duration,
6075c1e0e913 8136679: JFR event for adaptive IHOP
tschatzl
parents: 33107
diff changeset
   222
                                               double last_marking_length) {
6075c1e0e913 8136679: JFR event for adaptive IHOP
tschatzl
parents: 33107
diff changeset
   223
  send_basic_ihop_statistics(threshold,
6075c1e0e913 8136679: JFR event for adaptive IHOP
tschatzl
parents: 33107
diff changeset
   224
                             target_ccupancy,
6075c1e0e913 8136679: JFR event for adaptive IHOP
tschatzl
parents: 33107
diff changeset
   225
                             current_occupancy,
6075c1e0e913 8136679: JFR event for adaptive IHOP
tschatzl
parents: 33107
diff changeset
   226
                             last_allocation_size,
6075c1e0e913 8136679: JFR event for adaptive IHOP
tschatzl
parents: 33107
diff changeset
   227
                             last_allocation_duration,
6075c1e0e913 8136679: JFR event for adaptive IHOP
tschatzl
parents: 33107
diff changeset
   228
                             last_marking_length);
6075c1e0e913 8136679: JFR event for adaptive IHOP
tschatzl
parents: 33107
diff changeset
   229
}
6075c1e0e913 8136679: JFR event for adaptive IHOP
tschatzl
parents: 33107
diff changeset
   230
6075c1e0e913 8136679: JFR event for adaptive IHOP
tschatzl
parents: 33107
diff changeset
   231
void G1NewTracer::report_adaptive_ihop_statistics(size_t threshold,
6075c1e0e913 8136679: JFR event for adaptive IHOP
tschatzl
parents: 33107
diff changeset
   232
                                                  size_t internal_target_occupancy,
6075c1e0e913 8136679: JFR event for adaptive IHOP
tschatzl
parents: 33107
diff changeset
   233
                                                  size_t current_occupancy,
6075c1e0e913 8136679: JFR event for adaptive IHOP
tschatzl
parents: 33107
diff changeset
   234
                                                  size_t additional_buffer_size,
6075c1e0e913 8136679: JFR event for adaptive IHOP
tschatzl
parents: 33107
diff changeset
   235
                                                  double predicted_allocation_rate,
6075c1e0e913 8136679: JFR event for adaptive IHOP
tschatzl
parents: 33107
diff changeset
   236
                                                  double predicted_marking_length,
6075c1e0e913 8136679: JFR event for adaptive IHOP
tschatzl
parents: 33107
diff changeset
   237
                                                  bool prediction_active) {
6075c1e0e913 8136679: JFR event for adaptive IHOP
tschatzl
parents: 33107
diff changeset
   238
  send_adaptive_ihop_statistics(threshold,
6075c1e0e913 8136679: JFR event for adaptive IHOP
tschatzl
parents: 33107
diff changeset
   239
                                internal_target_occupancy,
6075c1e0e913 8136679: JFR event for adaptive IHOP
tschatzl
parents: 33107
diff changeset
   240
                                additional_buffer_size,
6075c1e0e913 8136679: JFR event for adaptive IHOP
tschatzl
parents: 33107
diff changeset
   241
                                current_occupancy,
6075c1e0e913 8136679: JFR event for adaptive IHOP
tschatzl
parents: 33107
diff changeset
   242
                                predicted_allocation_rate,
6075c1e0e913 8136679: JFR event for adaptive IHOP
tschatzl
parents: 33107
diff changeset
   243
                                predicted_marking_length,
6075c1e0e913 8136679: JFR event for adaptive IHOP
tschatzl
parents: 33107
diff changeset
   244
                                prediction_active);
6075c1e0e913 8136679: JFR event for adaptive IHOP
tschatzl
parents: 33107
diff changeset
   245
}
6075c1e0e913 8136679: JFR event for adaptive IHOP
tschatzl
parents: 33107
diff changeset
   246
37137
62fd3fb4b1b1 8151085: Change G1 concurrent timer and tracer measuring time
sangheki
parents: 34300
diff changeset
   247
void G1OldTracer::report_gc_start_impl(GCCause::Cause cause, const Ticks& timestamp) {
62fd3fb4b1b1 8151085: Change G1 concurrent timer and tracer measuring time
sangheki
parents: 34300
diff changeset
   248
  _shared_gc_info.set_start_timestamp(timestamp);
62fd3fb4b1b1 8151085: Change G1 concurrent timer and tracer measuring time
sangheki
parents: 34300
diff changeset
   249
}
62fd3fb4b1b1 8151085: Change G1 concurrent timer and tracer measuring time
sangheki
parents: 34300
diff changeset
   250
62fd3fb4b1b1 8151085: Change G1 concurrent timer and tracer measuring time
sangheki
parents: 34300
diff changeset
   251
void G1OldTracer::set_gc_cause(GCCause::Cause cause) {
62fd3fb4b1b1 8151085: Change G1 concurrent timer and tracer measuring time
sangheki
parents: 34300
diff changeset
   252
  _shared_gc_info.set_cause(cause);
62fd3fb4b1b1 8151085: Change G1 concurrent timer and tracer measuring time
sangheki
parents: 34300
diff changeset
   253
}
62fd3fb4b1b1 8151085: Change G1 concurrent timer and tracer measuring time
sangheki
parents: 34300
diff changeset
   254
18025
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   255
#endif