154 // presumably, users won't be enabling and disabling all the time.
155 init_log_table();
156 OrderAccess::release_store(&_enabled, 1);
157 }
158
159 int ThreadHeapSampler::enabled() {
160 return OrderAccess::load_acquire(&_enabled);
161 }
162
163 void ThreadHeapSampler::disable() {
164 OrderAccess::release_store(&_enabled, 0);
165 }
166
167 int ThreadHeapSampler::get_sampling_interval() {
168 return OrderAccess::load_acquire(&_sampling_interval);
169 }
170
171 void ThreadHeapSampler::set_sampling_interval(int sampling_interval) {
172 OrderAccess::release_store(&_sampling_interval, sampling_interval);
173 }
174
175 // Methods used in assertion mode to check if a collector is present or not at
176 // the moment of TLAB sampling, ie a slow allocation path.
177 bool ThreadHeapSampler::sampling_collector_present() const {
178 return _collectors_present > 0;
179 }
180
181 bool ThreadHeapSampler::remove_sampling_collector() {
182 assert(_collectors_present > 0, "Problem with collector counter.");
183 _collectors_present--;
184 return true;
185 }
186
187 bool ThreadHeapSampler::add_sampling_collector() {
188 _collectors_present++;
189 return true;
190 }
|
154 // presumably, users won't be enabling and disabling all the time.
155 init_log_table();
156 OrderAccess::release_store(&_enabled, 1);
157 }
158
159 int ThreadHeapSampler::enabled() {
160 return OrderAccess::load_acquire(&_enabled);
161 }
162
163 void ThreadHeapSampler::disable() {
164 OrderAccess::release_store(&_enabled, 0);
165 }
166
167 int ThreadHeapSampler::get_sampling_interval() {
168 return OrderAccess::load_acquire(&_sampling_interval);
169 }
170
171 void ThreadHeapSampler::set_sampling_interval(int sampling_interval) {
172 OrderAccess::release_store(&_sampling_interval, sampling_interval);
173 }
|