Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c747c532 authored by Andy Hung's avatar Andy Hung
Browse files

AudioFlinger, AudioPolicy: Add binder time check statistics

Binder method count and execution time now in dumpsys.
Add method name to TimeCheck abort logs.
Add MethodStatistics utility class to accumulate values.

Test: atest libmediautils_test
Test: atest method_statistics
Test: atest timecheck_tests
Test: adb shell dumpsys media.audio_flinger
Test: adb shell dumpsys media.audio_policy
Test: adb shell dumpsys media.metrics
Bug: 219958414
Change-Id: I7398d706e475596af6ad491463e87e92b09026d8
parent 5c6d68ad
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -227,4 +227,9 @@ interface IAudioFlingerService {
    int getAAudioHardwareBurstMinUsec();

    void setDeviceConnectedState(in AudioPort devicePort, boolean connected);

    // When adding a new method, please review and update
    // IAudioFlinger.h AudioFlingerServerAdapter::Delegate::TransactionCode
    // AudioFlinger.cpp AudioFlinger::onTransactWrapper()
    // AudioFlinger.cpp IAUDIOFLINGER_BINDER_METHOD_MACRO_LIST
}
+4 −0
Original line number Diff line number Diff line
@@ -390,4 +390,8 @@ interface IAudioPolicyService {
     * for the specified audio attributes.
     */
    AudioProfile[] getDirectProfilesForAttributes(in AudioAttributesInternal attr);

    // When adding a new method, please review and update
    // AudioPolicyService.cpp AudioPolicyService::onTransact()
    // AudioPolicyService.cpp IAUDIOPOLICYSERVICE_BINDER_METHOD_MACRO_LIST
}
+4 −0
Original line number Diff line number Diff line
@@ -62,4 +62,8 @@ interface IEffect {
     * TODO(ytai): Explain how this should be used exactly.
     */
    SharedFileRegion getCblk();

    // When adding a new method, please review and update
    // Effects.cpp AudioFlinger::EffectHandle::onTransact()
    // Effects.cpp IEFFECT_BINDER_METHOD_MACRO_LIST
}
+3 −2
Original line number Diff line number Diff line
@@ -482,9 +482,9 @@ public:
     * Legacy server should implement this interface in order to be wrapped.
     */
    class Delegate : public IAudioFlinger {
    protected:
        friend class AudioFlingerServerAdapter;

    public:
        // expose the TransactionCode enum for TimeCheck purposes.
        enum class TransactionCode {
            CREATE_TRACK = media::BnAudioFlingerService::TRANSACTION_createTrack,
            CREATE_RECORD = media::BnAudioFlingerService::TRANSACTION_createRecord,
@@ -553,6 +553,7 @@ public:
            SET_DEVICE_CONNECTED_STATE = media::BnAudioFlingerService::TRANSACTION_setDeviceConnectedState,
        };

    protected:
        /**
         * And optional hook, called on every transaction, allowing additional operations to be
         * performed before/after the unparceling  ofthe data and dispatching to the respective
+3 −0
Original line number Diff line number Diff line
@@ -140,6 +140,8 @@
#define AMEDIAMETRICS_PROP_INTERVALCOUNT  "intervalCount"  // int32
#define AMEDIAMETRICS_PROP_LATENCYMS      "latencyMs"      // double value
#define AMEDIAMETRICS_PROP_LOGSESSIONID   "logSessionId"   // hex string, "" none
#define AMEDIAMETRICS_PROP_METHODCODE     "methodCode"     // int64_t an int indicating method
#define AMEDIAMETRICS_PROP_METHODNAME     "methodName"     // string method name
#define AMEDIAMETRICS_PROP_NAME           "name"           // string value
#define AMEDIAMETRICS_PROP_ORIGINALFLAGS  "originalFlags"  // int32
#define AMEDIAMETRICS_PROP_OUTPUTDEVICES  "outputDevices"  // string value
@@ -224,6 +226,7 @@
#define AMEDIAMETRICS_PROP_EVENT_VALUE_SETVOLUME  "setVolume"  // AudioTrack
#define AMEDIAMETRICS_PROP_EVENT_VALUE_START      "start"  // AudioTrack, AudioRecord
#define AMEDIAMETRICS_PROP_EVENT_VALUE_STOP       "stop"   // AudioTrack, AudioRecord
#define AMEDIAMETRICS_PROP_EVENT_VALUE_TIMEOUT    "timeout"  // AudioFlinger, AudioPolicy
#define AMEDIAMETRICS_PROP_EVENT_VALUE_UNDERRUN   "underrun" // from Thread

// Possible values for AMEDIAMETRICS_PROP_CALLERNAME
Loading