egahlin@50662
|
1 /*
|
coleenp@54304
|
2 * Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved.
|
egahlin@50662
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
egahlin@50662
|
4 *
|
egahlin@50662
|
5 * This code is free software; you can redistribute it and/or modify it
|
egahlin@50662
|
6 * under the terms of the GNU General Public License version 2 only, as
|
egahlin@50662
|
7 * published by the Free Software Foundation.
|
egahlin@50662
|
8 *
|
egahlin@50662
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT
|
egahlin@50662
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
egahlin@50662
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
egahlin@50662
|
12 * version 2 for more details (a copy is included in the LICENSE file that
|
egahlin@50662
|
13 * accompanied this code).
|
egahlin@50662
|
14 *
|
egahlin@50662
|
15 * You should have received a copy of the GNU General Public License version
|
egahlin@50662
|
16 * 2 along with this work; if not, write to the Free Software Foundation,
|
egahlin@50662
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
egahlin@50662
|
18 *
|
egahlin@50662
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
egahlin@50662
|
20 * or visit www.oracle.com if you need additional information or have any
|
egahlin@50662
|
21 * questions.
|
egahlin@50662
|
22 *
|
egahlin@50662
|
23 */
|
egahlin@50662
|
24
|
coleenp@54304
|
25 #ifndef SHARE_JFR_LEAKPROFILER_STOPOPERATION_HPP
|
coleenp@54304
|
26 #define SHARE_JFR_LEAKPROFILER_STOPOPERATION_HPP
|
egahlin@50662
|
27
|
egahlin@50662
|
28 #include "jfr/leakprofiler/leakProfiler.hpp"
|
egahlin@50662
|
29 #include "jfr/leakprofiler/sampling/objectSampler.hpp"
|
egahlin@50662
|
30 #include "jfr/recorder/service/jfrOptionSet.hpp"
|
egahlin@50662
|
31 #include "logging/log.hpp"
|
tschatzl@53914
|
32 #include "runtime/vmOperations.hpp"
|
egahlin@50662
|
33
|
egahlin@50662
|
34 // Safepoint operation for stopping leak profiler object sampler
|
egahlin@50662
|
35 class StopOperation : public VM_Operation {
|
egahlin@50662
|
36 public:
|
egahlin@50662
|
37 StopOperation() {}
|
egahlin@50662
|
38
|
egahlin@50662
|
39 Mode evaluation_mode() const {
|
egahlin@50662
|
40 return _safepoint;
|
egahlin@50662
|
41 }
|
egahlin@50662
|
42
|
egahlin@50662
|
43 VMOp_Type type() const {
|
egahlin@50662
|
44 return VMOp_GC_HeapInspection;
|
egahlin@50662
|
45 }
|
egahlin@50662
|
46
|
egahlin@50662
|
47 virtual void doit() {
|
egahlin@50662
|
48 assert(LeakProfiler::is_running(), "invariant");
|
egahlin@50662
|
49 ObjectSampler* object_sampler = LeakProfiler::object_sampler();
|
egahlin@50662
|
50 delete object_sampler;
|
egahlin@50662
|
51 LeakProfiler::set_object_sampler(NULL);
|
egahlin@50662
|
52 log_trace(jfr, system)( "Object sampling stopped");
|
egahlin@50662
|
53 }
|
egahlin@50662
|
54 };
|
egahlin@50662
|
55
|
coleenp@54304
|
56 #endif // SHARE_JFR_LEAKPROFILER_STOPOPERATION_HPP
|