summaryrefslogtreecommitdiffstats
path: root/services/audioflinger/FastThreadDumpState.h
diff options
context:
space:
mode:
Diffstat (limited to 'services/audioflinger/FastThreadDumpState.h')
-rw-r--r--services/audioflinger/FastThreadDumpState.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/services/audioflinger/FastThreadDumpState.h b/services/audioflinger/FastThreadDumpState.h
index 17afbe5..bbca7da 100644
--- a/services/audioflinger/FastThreadDumpState.h
+++ b/services/audioflinger/FastThreadDumpState.h
@@ -33,12 +33,15 @@ struct FastThreadDumpState {
struct timespec mMeasuredWarmupTs; // measured warmup time
uint32_t mWarmupCycles; // number of loop cycles required to warmup
-#ifdef FAST_MIXER_STATISTICS
+#ifdef FAST_THREAD_STATISTICS
// Recently collected samples of per-cycle monotonic time, thread CPU time, and CPU frequency.
// kSamplingN is max size of sampling frame (statistics), and must be a power of 2 <= 0x8000.
// The sample arrays are virtually allocated based on this compile-time constant,
// but are only initialized and used based on the runtime parameter mSamplingN.
static const uint32_t kSamplingN = 0x8000;
+ // Compile-time constant for a "low RAM device", must be a power of 2 <= kSamplingN.
+ // This value was chosen such that each array uses 1 small page (4 Kbytes).
+ static const uint32_t kSamplingNforLowRamDevice = 0x400;
// Corresponding runtime maximum size of sample arrays, must be a power of 2 <= kSamplingN.
uint32_t mSamplingN;
// The bounds define the interval of valid samples, and are represented as follows:
@@ -52,6 +55,9 @@ struct FastThreadDumpState {
#ifdef CPU_FREQUENCY_STATISTICS
uint32_t mCpukHz[kSamplingN]; // absolute CPU clock frequency in kHz, bits 0-3 are CPU#
#endif
+
+ // Increase sampling window after construction, must be a power of 2 <= kSamplingN
+ void increaseSamplingN(uint32_t samplingN);
#endif
}; // struct FastThreadDumpState