summaryrefslogtreecommitdiff
path: root/runtime/javaheapprof/javaheapsampler.h
diff options
context:
space:
mode:
authorNicolas Geoffray <ngeoffray@google.com>2021-03-09 08:59:55 +0000
committerNicolas Geoffray <ngeoffray@google.com>2021-03-09 08:59:55 +0000
commit2291439187b06d995bb298683246416c75d92740 (patch)
tree8ae6ebb82f270ff7065e24105e57c79b8e7d83af /runtime/javaheapprof/javaheapsampler.h
parent08e44f1a6289695530fcae887312fe69079ddf9a (diff)
Revert "Add API to ART/Perfetto Java Heap Profiler"
This reverts commit 08e44f1a6289695530fcae887312fe69079ddf9a. Bug: 160214819 Reason for revert: Tests breakage on target: +CANNOT LINK EXECUTABLE "/apex/com.android.art/bin/dex2oatd32": library "heapprofd_client_api.so" not found: needed by /apex/com.android.art/lib/libartd.so in namespace com_android_art Change-Id: I9509cc1e3c85ed4b1ec3347317c0e33fc1f96dea
Diffstat (limited to 'runtime/javaheapprof/javaheapsampler.h')
-rw-r--r--runtime/javaheapprof/javaheapsampler.h18
1 files changed, 8 insertions, 10 deletions
diff --git a/runtime/javaheapprof/javaheapsampler.h b/runtime/javaheapprof/javaheapsampler.h
index 618893cad0..02cb7b7f9b 100644
--- a/runtime/javaheapprof/javaheapsampler.h
+++ b/runtime/javaheapprof/javaheapsampler.h
@@ -42,15 +42,6 @@ class HeapSampler {
thread_local size_t bytes_until_sample = 0;
return &bytes_until_sample;
}
- void SetHeapID(uint32_t heap_id) {
- perfetto_heap_id_ = heap_id;
- }
- void EnableHeapSampler() {
- enabled_.store(true, std::memory_order_release);
- }
- void DisableHeapSampler() {
- enabled_.store(false, std::memory_order_release);
- }
// Report a sample to Perfetto.
void ReportSample(art::mirror::Object* obj, size_t allocation_size);
// Check whether we should take a sample or not at this allocation, and return the
@@ -69,10 +60,16 @@ class HeapSampler {
void AdjustSampleOffset(size_t adjustment);
// Is heap sampler enabled?
bool IsEnabled();
+ void EnableHeapSampler(void* enable_ptr, const void* enable_info_ptr);
+ void DisableHeapSampler(void* disable_ptr, const void* disable_info_ptr);
// Set the sampling interval.
- void SetSamplingInterval(int sampling_interval) REQUIRES(!geo_dist_rng_lock_);
+ void SetSamplingInterval(int sampling_interval) REQUIRES(geo_dist_rng_lock_);
// Return the sampling interval.
int GetSamplingInterval();
+ // Set the Perfetto Session Info.
+ void SetSessionInfo(void* info);
+ // Get the Perfetto Session Info.
+ void* GetSessionInfo();
private:
size_t NextGeoDistRandSample() REQUIRES(!geo_dist_rng_lock_);
@@ -84,6 +81,7 @@ class HeapSampler {
// Default sampling interval is 4kb.
// Writes guarded by geo_dist_rng_lock_.
std::atomic<int> p_sampling_interval_{4 * 1024};
+ void* perfetto_session_info_;
uint32_t perfetto_heap_id_ = 0;
// std random number generator.
std::minstd_rand rng_ GUARDED_BY(geo_dist_rng_lock_); // Holds the state