15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #include "precompiled.hpp"
26 #include "jfr/leakprofiler/emitEventOperation.hpp"
27 #include "jfr/leakprofiler/leakProfiler.hpp"
28 #include "jfr/leakprofiler/startOperation.hpp"
29 #include "jfr/leakprofiler/stopOperation.hpp"
30 #include "jfr/leakprofiler/sampling/objectSampler.hpp"
31 #include "jfr/recorder/service/jfrOptionSet.hpp"
32 #include "memory/iterator.hpp"
33 #include "oops/oop.hpp"
34 #include "runtime/atomic.hpp"
35 #include "runtime/orderAccess.inline.hpp"
36 #include "runtime/thread.inline.hpp"
37 #include "runtime/vmThread.hpp"
38 #include "utilities/ostream.hpp"
39
40 // Only to be updated during safepoint
41 ObjectSampler* LeakProfiler::_object_sampler = NULL;
42
43 static volatile jbyte suspended = 0;
44 bool LeakProfiler::start(jint sample_count) {
45 if (_object_sampler != NULL) {
46 // already started
47 return true;
48 }
49 // Allows user to disable leak profiler on command line by setting queue size to zero.
50 if (sample_count > 0) {
51 StartOperation op(sample_count);
52 VMThread::execute(&op);
53 return _object_sampler != NULL;
54 }
55 return false;
|
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #include "precompiled.hpp"
26 #include "jfr/leakprofiler/emitEventOperation.hpp"
27 #include "jfr/leakprofiler/leakProfiler.hpp"
28 #include "jfr/leakprofiler/startOperation.hpp"
29 #include "jfr/leakprofiler/stopOperation.hpp"
30 #include "jfr/leakprofiler/sampling/objectSampler.hpp"
31 #include "jfr/recorder/service/jfrOptionSet.hpp"
32 #include "memory/iterator.hpp"
33 #include "oops/oop.hpp"
34 #include "runtime/atomic.hpp"
35 #include "runtime/orderAccess.hpp"
36 #include "runtime/thread.inline.hpp"
37 #include "runtime/vmThread.hpp"
38 #include "utilities/ostream.hpp"
39
40 // Only to be updated during safepoint
41 ObjectSampler* LeakProfiler::_object_sampler = NULL;
42
43 static volatile jbyte suspended = 0;
44 bool LeakProfiler::start(jint sample_count) {
45 if (_object_sampler != NULL) {
46 // already started
47 return true;
48 }
49 // Allows user to disable leak profiler on command line by setting queue size to zero.
50 if (sample_count > 0) {
51 StartOperation op(sample_count);
52 VMThread::execute(&op);
53 return _object_sampler != NULL;
54 }
55 return false;
|