hotspot/src/share/vm/gc_implementation/shared/gcTrace.cpp
author brutisso
Thu, 19 Jun 2014 13:31:14 +0200
changeset 25350 6423a57e5451
parent 23470 ff2a7ea4225d
child 27684 e0391b2bf625
permissions -rw-r--r--
8043607: Add a GC id as a log decoration similar to PrintGCTimeStamps Reviewed-by: jwilhelm, ehelin, tschatzl
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
18025
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
     1
/*
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
     2
 * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
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"
18704
226ce98e75e6 8015972: Refactor the sending of the object count after GC event
ehelin
parents: 18025
diff changeset
    26
#include "gc_implementation/shared/copyFailedInfo.hpp"
18025
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    27
#include "gc_implementation/shared/gcHeapSummary.hpp"
25350
6423a57e5451 8043607: Add a GC id as a log decoration similar to PrintGCTimeStamps
brutisso
parents: 23470
diff changeset
    28
#include "gc_implementation/shared/gcId.hpp"
18025
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    29
#include "gc_implementation/shared/gcTimer.hpp"
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    30
#include "gc_implementation/shared/gcTrace.hpp"
18704
226ce98e75e6 8015972: Refactor the sending of the object count after GC event
ehelin
parents: 18025
diff changeset
    31
#include "gc_implementation/shared/objectCountEventSender.hpp"
18025
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    32
#include "memory/heapInspection.hpp"
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    33
#include "memory/referenceProcessorStats.hpp"
18706
2d278f82253d 8015683: object_count_after_gc should have the same timestamp for all events
ehelin
parents: 18705
diff changeset
    34
#include "runtime/os.hpp"
18025
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    35
#include "utilities/globalDefinitions.hpp"
21767
41eaa9a17059 8028128: Add a type safe alternative for working with counter based data
mgronlun
parents: 18706
diff changeset
    36
#include "utilities/ticks.inline.hpp"
18025
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    37
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    38
#if INCLUDE_ALL_GCS
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    39
#include "gc_implementation/g1/evacuationInfo.hpp"
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    40
#endif
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    41
25350
6423a57e5451 8043607: Add a GC id as a log decoration similar to PrintGCTimeStamps
brutisso
parents: 23470
diff changeset
    42
#define assert_unset_gc_id() assert(_shared_gc_info.gc_id().is_undefined(), "GC already started?")
6423a57e5451 8043607: Add a GC id as a log decoration similar to PrintGCTimeStamps
brutisso
parents: 23470
diff changeset
    43
#define assert_set_gc_id() assert(!_shared_gc_info.gc_id().is_undefined(), "GC not started?")
18025
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    44
21767
41eaa9a17059 8028128: Add a type safe alternative for working with counter based data
mgronlun
parents: 18706
diff changeset
    45
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
    46
  assert_unset_gc_id();
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    47
25350
6423a57e5451 8043607: Add a GC id as a log decoration similar to PrintGCTimeStamps
brutisso
parents: 23470
diff changeset
    48
  GCId gc_id = GCId::create();
6423a57e5451 8043607: Add a GC id as a log decoration similar to PrintGCTimeStamps
brutisso
parents: 23470
diff changeset
    49
  _shared_gc_info.set_gc_id(gc_id);
18025
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    50
  _shared_gc_info.set_cause(cause);
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    51
  _shared_gc_info.set_start_timestamp(timestamp);
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    52
}
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    53
21767
41eaa9a17059 8028128: Add a type safe alternative for working with counter based data
mgronlun
parents: 18706
diff changeset
    54
void GCTracer::report_gc_start(GCCause::Cause cause, const Ticks& timestamp) {
18025
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    55
  assert_unset_gc_id();
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
  report_gc_start_impl(cause, timestamp);
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    58
}
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
bool GCTracer::has_reported_gc_start() const {
25350
6423a57e5451 8043607: Add a GC id as a log decoration similar to PrintGCTimeStamps
brutisso
parents: 23470
diff changeset
    61
  return !_shared_gc_info.gc_id().is_undefined();
18025
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    62
}
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    63
21767
41eaa9a17059 8028128: Add a type safe alternative for working with counter based data
mgronlun
parents: 18706
diff changeset
    64
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
    65
  assert_set_gc_id();
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    66
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    67
  _shared_gc_info.set_sum_of_pauses(time_partitions->sum_of_pauses());
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    68
  _shared_gc_info.set_longest_pause(time_partitions->longest_pause());
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    69
  _shared_gc_info.set_end_timestamp(timestamp);
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
  send_phase_events(time_partitions);
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    72
  send_garbage_collection_event();
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    73
}
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    74
21767
41eaa9a17059 8028128: Add a type safe alternative for working with counter based data
mgronlun
parents: 18706
diff changeset
    75
void GCTracer::report_gc_end(const Ticks& timestamp, TimePartitions* time_partitions) {
18025
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    76
  assert_set_gc_id();
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    77
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    78
  report_gc_end_impl(timestamp, time_partitions);
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    79
25350
6423a57e5451 8043607: Add a GC id as a log decoration similar to PrintGCTimeStamps
brutisso
parents: 23470
diff changeset
    80
  _shared_gc_info.set_gc_id(GCId::undefined());
18025
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    81
}
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    82
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    83
void GCTracer::report_gc_reference_stats(const ReferenceProcessorStats& rps) const {
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    84
  assert_set_gc_id();
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    85
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    86
  send_reference_stats_event(REF_SOFT, rps.soft_count());
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    87
  send_reference_stats_event(REF_WEAK, rps.weak_count());
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    88
  send_reference_stats_event(REF_FINAL, rps.final_count());
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    89
  send_reference_stats_event(REF_PHANTOM, rps.phantom_count());
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    90
}
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    91
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    92
#if INCLUDE_SERVICES
18704
226ce98e75e6 8015972: Refactor the sending of the object count after GC event
ehelin
parents: 18025
diff changeset
    93
class ObjectCountEventSenderClosure : public KlassInfoClosure {
226ce98e75e6 8015972: Refactor the sending of the object count after GC event
ehelin
parents: 18025
diff changeset
    94
  const GCId _gc_id;
226ce98e75e6 8015972: Refactor the sending of the object count after GC event
ehelin
parents: 18025
diff changeset
    95
  const double _size_threshold_percentage;
226ce98e75e6 8015972: Refactor the sending of the object count after GC event
ehelin
parents: 18025
diff changeset
    96
  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
    97
  const Ticks _timestamp;
18704
226ce98e75e6 8015972: Refactor the sending of the object count after GC event
ehelin
parents: 18025
diff changeset
    98
226ce98e75e6 8015972: Refactor the sending of the object count after GC event
ehelin
parents: 18025
diff changeset
    99
 public:
21767
41eaa9a17059 8028128: Add a type safe alternative for working with counter based data
mgronlun
parents: 18706
diff changeset
   100
  ObjectCountEventSenderClosure(GCId gc_id, 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
   101
    _gc_id(gc_id),
226ce98e75e6 8015972: Refactor the sending of the object count after GC event
ehelin
parents: 18025
diff changeset
   102
    _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
   103
    _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
   104
    _timestamp(timestamp)
18704
226ce98e75e6 8015972: Refactor the sending of the object count after GC event
ehelin
parents: 18025
diff changeset
   105
  {}
18025
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   106
18704
226ce98e75e6 8015972: Refactor the sending of the object count after GC event
ehelin
parents: 18025
diff changeset
   107
  virtual void do_cinfo(KlassInfoEntry* entry) {
226ce98e75e6 8015972: Refactor the sending of the object count after GC event
ehelin
parents: 18025
diff changeset
   108
    if (should_send_event(entry)) {
18706
2d278f82253d 8015683: object_count_after_gc should have the same timestamp for all events
ehelin
parents: 18705
diff changeset
   109
      ObjectCountEventSender::send(entry, _gc_id, _timestamp);
18704
226ce98e75e6 8015972: Refactor the sending of the object count after GC event
ehelin
parents: 18025
diff changeset
   110
    }
226ce98e75e6 8015972: Refactor the sending of the object count after GC event
ehelin
parents: 18025
diff changeset
   111
  }
18025
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
 private:
226ce98e75e6 8015972: Refactor the sending of the object count after GC event
ehelin
parents: 18025
diff changeset
   114
  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
   115
    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
   116
    return percentage_of_heap >= _size_threshold_percentage;
226ce98e75e6 8015972: Refactor the sending of the object count after GC event
ehelin
parents: 18025
diff changeset
   117
  }
226ce98e75e6 8015972: Refactor the sending of the object count after GC event
ehelin
parents: 18025
diff changeset
   118
};
18025
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   119
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   120
void GCTracer::report_object_count_after_gc(BoolObjectClosure* is_alive_cl) {
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   121
  assert_set_gc_id();
18704
226ce98e75e6 8015972: Refactor the sending of the object count after GC event
ehelin
parents: 18025
diff changeset
   122
  assert(is_alive_cl != NULL, "Must supply function to check liveness");
18025
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   123
18704
226ce98e75e6 8015972: Refactor the sending of the object count after GC event
ehelin
parents: 18025
diff changeset
   124
  if (ObjectCountEventSender::should_send_event()) {
18025
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   125
    ResourceMark rm;
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
    KlassInfoTable cit(false);
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   128
    if (!cit.allocation_failed()) {
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   129
      HeapInspection hi(false, false, false, NULL);
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   130
      hi.populate_table(&cit, is_alive_cl);
25350
6423a57e5451 8043607: Add a GC id as a log decoration similar to PrintGCTimeStamps
brutisso
parents: 23470
diff changeset
   131
      ObjectCountEventSenderClosure event_sender(_shared_gc_info.gc_id(), cit.size_of_instances_in_words(), Ticks::now());
18025
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   132
      cit.iterate(&event_sender);
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
  }
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   135
}
18704
226ce98e75e6 8015972: Refactor the sending of the object count after GC event
ehelin
parents: 18025
diff changeset
   136
#endif // INCLUDE_SERVICES
18025
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   137
23470
ff2a7ea4225d 8036703: Add trace event with statistics for the metaspace chunk free lists
ehelin
parents: 21767
diff changeset
   138
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
   139
  assert_set_gc_id();
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
  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
   142
}
ff2a7ea4225d 8036703: Add trace event with statistics for the metaspace chunk free lists
ehelin
parents: 21767
diff changeset
   143
ff2a7ea4225d 8036703: Add trace event with statistics for the metaspace chunk free lists
ehelin
parents: 21767
diff changeset
   144
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
   145
  assert_set_gc_id();
ff2a7ea4225d 8036703: Add trace event with statistics for the metaspace chunk free lists
ehelin
parents: 21767
diff changeset
   146
ff2a7ea4225d 8036703: Add trace event with statistics for the metaspace chunk free lists
ehelin
parents: 21767
diff changeset
   147
  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
   148
ff2a7ea4225d 8036703: Add trace event with statistics for the metaspace chunk free lists
ehelin
parents: 21767
diff changeset
   149
  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
   150
  if (UseCompressedClassPointers) {
ff2a7ea4225d 8036703: Add trace event with statistics for the metaspace chunk free lists
ehelin
parents: 21767
diff changeset
   151
    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
   152
  }
18025
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   153
}
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   154
21767
41eaa9a17059 8028128: Add a type safe alternative for working with counter based data
mgronlun
parents: 18706
diff changeset
   155
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
   156
  assert_set_gc_id();
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   157
  assert(_tenuring_threshold != UNSET_TENURING_THRESHOLD, "Tenuring threshold has not been reported");
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   158
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   159
  GCTracer::report_gc_end_impl(timestamp, time_partitions);
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   160
  send_young_gc_event();
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   161
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   162
  _tenuring_threshold = UNSET_TENURING_THRESHOLD;
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   163
}
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   164
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   165
void YoungGCTracer::report_promotion_failed(const PromotionFailedInfo& pf_info) {
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   166
  assert_set_gc_id();
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   167
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   168
  send_promotion_failed_event(pf_info);
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   169
}
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   170
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   171
void YoungGCTracer::report_tenuring_threshold(const uint tenuring_threshold) {
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   172
  _tenuring_threshold = tenuring_threshold;
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   173
}
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   174
21767
41eaa9a17059 8028128: Add a type safe alternative for working with counter based data
mgronlun
parents: 18706
diff changeset
   175
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
   176
  assert_set_gc_id();
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
  GCTracer::report_gc_end_impl(timestamp, time_partitions);
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   179
  send_old_gc_event();
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   180
}
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   181
21767
41eaa9a17059 8028128: Add a type safe alternative for working with counter based data
mgronlun
parents: 18706
diff changeset
   182
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
   183
  assert_set_gc_id();
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   184
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   185
  OldGCTracer::report_gc_end_impl(timestamp, time_partitions);
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   186
  send_parallel_old_event();
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   187
}
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   188
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   189
void ParallelOldTracer::report_dense_prefix(void* dense_prefix) {
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   190
  assert_set_gc_id();
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   191
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   192
  _parallel_old_gc_info.report_dense_prefix(dense_prefix);
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   193
}
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   194
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   195
void OldGCTracer::report_concurrent_mode_failure() {
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   196
  assert_set_gc_id();
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   197
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   198
  send_concurrent_mode_failure_event();
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   199
}
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   200
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   201
#if INCLUDE_ALL_GCS
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   202
void G1NewTracer::report_yc_type(G1YCType type) {
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   203
  assert_set_gc_id();
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   204
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   205
  _g1_young_gc_info.set_type(type);
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
21767
41eaa9a17059 8028128: Add a type safe alternative for working with counter based data
mgronlun
parents: 18706
diff changeset
   208
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
   209
  assert_set_gc_id();
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   210
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   211
  YoungGCTracer::report_gc_end_impl(timestamp, time_partitions);
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   212
  send_g1_young_gc_event();
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   213
}
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   214
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   215
void G1NewTracer::report_evacuation_info(EvacuationInfo* info) {
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   216
  assert_set_gc_id();
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   217
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   218
  send_evacuation_info_event(info);
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   219
}
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   220
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   221
void G1NewTracer::report_evacuation_failed(EvacuationFailedInfo& ef_info) {
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   222
  assert_set_gc_id();
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   223
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   224
  send_evacuation_failed_event(ef_info);
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   225
  ef_info.reset();
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   226
}
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   227
#endif