src/share/vm/jfr/leakprofiler/startOperation.hpp

changeset 9885
8e875c964f41
parent 9858
b985cbb00e68
     1.1 --- a/src/share/vm/jfr/leakprofiler/startOperation.hpp	Fri Sep 27 13:23:32 2019 +0800
     1.2 +++ b/src/share/vm/jfr/leakprofiler/startOperation.hpp	Wed Oct 09 16:11:58 2019 +0800
     1.3 @@ -25,34 +25,17 @@
     1.4  #ifndef SHARE_VM_LEAKPROFILER_STARTOPERATION_HPP
     1.5  #define SHARE_VM_LEAKPROFILER_STARTOPERATION_HPP
     1.6  
     1.7 -#include "jfr/recorder/jfrRecorder.hpp"
     1.8 -#include "jfr/leakprofiler/leakProfiler.hpp"
     1.9  #include "jfr/leakprofiler/sampling/objectSampler.hpp"
    1.10 -#include "jfr/recorder/service/jfrOptionSet.hpp"
    1.11 -#include "runtime/vm_operations.hpp"
    1.12 +#include "jfr/leakprofiler/utilities/vmOperation.hpp"
    1.13  
    1.14 -// Safepoint operation for starting leak profiler object sampler
    1.15 -class StartOperation : public VM_Operation {
    1.16 +// Safepoint operation for creating and starting the leak profiler object sampler
    1.17 +class StartOperation : public OldObjectVMOperation {
    1.18   private:
    1.19 -  jlong _sample_count;
    1.20 +  int _sample_count;
    1.21   public:
    1.22 -  StartOperation(jlong sample_count) :
    1.23 -    _sample_count(sample_count) {
    1.24 -  }
    1.25 -
    1.26 -  Mode evaluation_mode() const {
    1.27 -    return _safepoint;
    1.28 -  }
    1.29 -
    1.30 -  VMOp_Type type() const {
    1.31 -    return VMOp_GC_HeapInspection;
    1.32 -  }
    1.33 -
    1.34 +  StartOperation(int sample_count) : _sample_count(sample_count) {}
    1.35    virtual void doit() {
    1.36 -    assert(!LeakProfiler::is_running(), "invariant");
    1.37 -    jint queue_size = JfrOptionSet::old_object_queue_size();
    1.38 -    LeakProfiler::set_object_sampler(new ObjectSampler(queue_size));
    1.39 -    if (LogJFR && Verbose) tty->print_cr( "Object sampling started");
    1.40 +    ObjectSampler::create(_sample_count);
    1.41    }
    1.42  };
    1.43  

mercurial