src/hotspot/share/jfr/leakprofiler/sampling/objectSampler.cpp
author coleenp
Thu, 10 Jan 2019 15:13:51 -0500
changeset 53244 9807daeb47c4
parent 52850 f527b24990d7
child 55571 49102ba8cf14
child 57870 00860d9caf4d
child 58678 9cf78a70fa4f
permissions -rw-r--r--
8216167: Update include guards to reflect correct directories Summary: Use script and some manual fixup to fix directores names in include guards. Reviewed-by: lfoltan, eosterlund, kbarrett
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
50113
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
     1
/*
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
     2
 * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
     4
 *
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
     7
 * published by the Free Software Foundation.
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
     8
 *
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    13
 * accompanied this code).
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    14
 *
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    18
 *
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    21
 * questions.
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    22
 *
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    23
 */
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    24
#include "precompiled.hpp"
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    25
#include "jfr/jfrEvents.hpp"
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    26
#include "jfr/leakprofiler/sampling/objectSample.hpp"
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    27
#include "jfr/leakprofiler/sampling/objectSampler.hpp"
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    28
#include "jfr/leakprofiler/sampling/sampleList.hpp"
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    29
#include "jfr/leakprofiler/sampling/samplePriorityQueue.hpp"
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    30
#include "jfr/recorder/jfrEventSetting.inline.hpp"
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    31
#include "jfr/recorder/checkpoint/jfrCheckpointManager.hpp"
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    32
#include "jfr/recorder/stacktrace/jfrStackTraceRepository.hpp"
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    33
#include "jfr/support/jfrThreadLocal.hpp"
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    34
#include "jfr/utilities/jfrTryLock.hpp"
50880
e1117321adaf 8197425: Liveset information for Old Object sample event
egahlin
parents: 50113
diff changeset
    35
#include "logging/log.hpp"
e1117321adaf 8197425: Liveset information for Old Object sample event
egahlin
parents: 50113
diff changeset
    36
#include "memory/universe.hpp"
50113
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    37
#include "oops/oop.inline.hpp"
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    38
#include "runtime/thread.hpp"
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    39
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    40
ObjectSampler::ObjectSampler(size_t size) :
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    41
  _priority_queue(new SamplePriorityQueue(size)),
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    42
  _list(new SampleList(size)),
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    43
  _last_sweep(JfrTicks::now()),
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    44
  _total_allocated(0),
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    45
  _threshold(0),
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    46
  _size(size),
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    47
  _tryLock(0),
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    48
  _dead_samples(false) {}
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    49
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    50
ObjectSampler::~ObjectSampler() {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    51
  delete _priority_queue;
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    52
  _priority_queue = NULL;
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    53
  delete _list;
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    54
  _list = NULL;
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    55
}
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    56
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    57
void ObjectSampler::add(HeapWord* obj, size_t allocated, JavaThread* thread) {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    58
  assert(thread != NULL, "invariant");
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    59
  const traceid thread_id = thread->threadObj() != NULL ? thread->jfr_thread_local()->thread_id() : 0;
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    60
  if (thread_id == 0) {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    61
    return;
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    62
  }
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    63
  assert(thread_id != 0, "invariant");
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    64
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    65
  if (!thread->jfr_thread_local()->has_thread_checkpoint()) {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    66
    JfrCheckpointManager::create_thread_checkpoint(thread);
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    67
    assert(thread->jfr_thread_local()->has_thread_checkpoint(), "invariant");
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    68
  }
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    69
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    70
  traceid stack_trace_id = 0;
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    71
  unsigned int stack_trace_hash = 0;
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    72
  if (JfrEventSetting::has_stacktrace(EventOldObjectSample::eventId)) {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    73
    stack_trace_id = JfrStackTraceRepository::record(thread, 0, &stack_trace_hash);
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    74
    thread->jfr_thread_local()->set_cached_stack_trace_id(stack_trace_id, stack_trace_hash);
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    75
  }
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    76
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    77
  JfrTryLock tryLock(&_tryLock);
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    78
  if (!tryLock.has_lock()) {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    79
    log_trace(jfr, oldobject, sampling)("Skipping old object sample due to lock contention");
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    80
    return;
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    81
  }
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    82
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    83
  if (_dead_samples) {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    84
    scavenge();
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    85
    assert(!_dead_samples, "invariant");
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    86
  }
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    87
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    88
  _total_allocated += allocated;
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    89
  const size_t span = _total_allocated - _priority_queue->total();
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    90
  ObjectSample* sample;
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    91
  if ((size_t)_priority_queue->count() == _size) {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    92
    assert(_list->count() == _size, "invariant");
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    93
    const ObjectSample* peek = _priority_queue->peek();
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    94
    if (peek->span() > span) {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    95
      // quick reject, will not fit
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    96
      return;
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    97
    }
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    98
    sample = _list->reuse(_priority_queue->pop());
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    99
  } else {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   100
    sample = _list->get();
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   101
  }
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   102
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   103
  assert(sample != NULL, "invariant");
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   104
  assert(thread_id != 0, "invariant");
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   105
  sample->set_thread_id(thread_id);
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   106
  sample->set_thread_checkpoint(thread->jfr_thread_local()->thread_checkpoint());
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   107
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   108
  if (stack_trace_id != 0) {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   109
    sample->set_stack_trace_id(stack_trace_id);
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   110
    sample->set_stack_trace_hash(stack_trace_hash);
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   111
  }
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   112
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   113
  sample->set_span(allocated);
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   114
  sample->set_object((oop)obj);
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   115
  sample->set_allocated(allocated);
50880
e1117321adaf 8197425: Liveset information for Old Object sample event
egahlin
parents: 50113
diff changeset
   116
  sample->set_allocation_time(JfrTicks::now());
e1117321adaf 8197425: Liveset information for Old Object sample event
egahlin
parents: 50113
diff changeset
   117
  sample->set_heap_used_at_last_gc(Universe::get_heap_used_at_last_gc());
50113
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   118
  _priority_queue->push(sample);
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   119
}
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   120
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   121
const ObjectSample* ObjectSampler::last() const {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   122
  return _list->last();
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   123
}
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   124
52850
f527b24990d7 8205516: JFR tool
egahlin
parents: 50880
diff changeset
   125
const ObjectSample* ObjectSampler::first() const {
f527b24990d7 8205516: JFR tool
egahlin
parents: 50880
diff changeset
   126
  return _list->first();
f527b24990d7 8205516: JFR tool
egahlin
parents: 50880
diff changeset
   127
}
f527b24990d7 8205516: JFR tool
egahlin
parents: 50880
diff changeset
   128
50113
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   129
const ObjectSample* ObjectSampler::last_resolved() const {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   130
  return _list->last_resolved();
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   131
}
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   132
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   133
void ObjectSampler::set_last_resolved(const ObjectSample* sample) {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   134
  _list->set_last_resolved(sample);
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   135
}
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   136
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   137
void ObjectSampler::oops_do(BoolObjectClosure* is_alive, OopClosure* f) {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   138
  ObjectSample* current = _list->last();
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   139
  while (current != NULL) {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   140
    ObjectSample* next = current->next();
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   141
    if (!current->is_dead()) {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   142
      if (is_alive->do_object_b(current->object())) {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   143
        // The weakly referenced object is alive, update pointer
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   144
        f->do_oop(const_cast<oop*>(current->object_addr()));
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   145
      } else {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   146
        current->set_dead();
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   147
        _dead_samples = true;
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   148
      }
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   149
    }
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   150
    current = next;
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   151
  }
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   152
  _last_sweep = JfrTicks::now();
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   153
}
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   154
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   155
void ObjectSampler::remove_dead(ObjectSample* sample) {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   156
  assert(sample != NULL, "invariant");
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   157
  assert(sample->is_dead(), "invariant");
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   158
  ObjectSample* const previous = sample->prev();
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   159
  // push span on to previous
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   160
  if (previous != NULL) {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   161
    _priority_queue->remove(previous);
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   162
    previous->add_span(sample->span());
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   163
    _priority_queue->push(previous);
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   164
  }
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   165
  _priority_queue->remove(sample);
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   166
  _list->release(sample);
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   167
}
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   168
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   169
void ObjectSampler::scavenge() {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   170
  ObjectSample* current = _list->last();
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   171
  while (current != NULL) {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   172
    ObjectSample* next = current->next();
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   173
    if (current->is_dead()) {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   174
      remove_dead(current);
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   175
    }
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   176
    current = next;
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   177
  }
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   178
  _dead_samples = false;
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   179
}
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   180
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   181
int ObjectSampler::item_count() const {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   182
  return _priority_queue->count();
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   183
}
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   184
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   185
const ObjectSample* ObjectSampler::item_at(int index) const {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   186
  return _priority_queue->item_at(index);
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   187
}
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   188
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   189
ObjectSample* ObjectSampler::item_at(int index) {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   190
  return const_cast<ObjectSample*>(
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   191
    const_cast<const ObjectSampler*>(this)->item_at(index)
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   192
                                   );
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   193
}
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   194
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   195
const JfrTicks& ObjectSampler::last_sweep() const {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   196
  return _last_sweep;
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   197
}