Add timing info to audioflinger dumpsys
Print start time, current time and startup time in dumpsys.
Test: adb shell dumpsys media.audio_flinger
Flag: EXEMPT logs only
Bug: 372070273
Change-Id: I92d26db90b22a403d5681ac3cfe33cf3bb983dc0
diff --git a/services/audioflinger/AudioFlinger.cpp b/services/audioflinger/AudioFlinger.cpp
index b9dbbad..eb85420 100644
--- a/services/audioflinger/AudioFlinger.cpp
+++ b/services/audioflinger/AudioFlinger.cpp
@@ -905,6 +905,26 @@
// Unknown arg silently ignored
}
+ {
+ std::string res;
+ res.reserve(100);
+ res += "Start begin: ";
+ const auto startTimeStr = audio_utils_time_string_from_ns(mStartTime);
+ res += startTimeStr.time;
+ const auto startFinishedTime = getStartupFinishedTime();
+ if (startFinishedTime != 0) {
+ res += "\nStart end: ";
+ const auto startEndStr = audio_utils_time_string_from_ns(startFinishedTime);
+ res += startEndStr.time;
+ } else {
+ res += "\nStartup not yet finished!";
+ }
+ const auto nowTimeStr = audio_utils_time_string_from_ns(audio_utils_get_real_time_ns());
+ res += "\nNow: ";
+ res += nowTimeStr.time;
+ res += "\n";
+ writeStr(fd, res);
+ }
// get state of hardware lock
{
FallibleLockGuard l{hardwareMutex()};