Merge "audioserver: log system event for binder timeouts"

gugelfrei
TreeHugger Robot 6 years ago committed by Android (Google) Code Review
commit c3fd2a4396

@ -0,0 +1 @@
../../media/utils/include/mediautils/EventLog.h

@ -1 +1 @@
../../media/libmedia/include/media/TimeCheck.h
../../media/utils/include/mediautils/TimeCheck.h

@ -949,7 +949,8 @@ status_t BnAudioFlinger::onTransact(
break;
}
TimeCheck check("IAudioFlinger");
std::string tag("IAudioFlinger command " + std::to_string(code));
TimeCheck check(tag.c_str());
switch (code) {
case CREATE_TRACK: {

@ -935,7 +935,8 @@ status_t BnAudioPolicyService::onTransact(
break;
}
TimeCheck check("IAudioPolicyService");
std::string tag("IAudioPolicyService command " + std::to_string(code));
TimeCheck check(tag.c_str());
switch (code) {
case SET_DEVICE_CONNECTION_STATE: {

@ -20,7 +20,7 @@ cc_library {
vndk: {
enabled: true,
},
srcs: ["AudioParameter.cpp", "TypeConverter.cpp", "TimeCheck.cpp"],
srcs: ["AudioParameter.cpp", "TypeConverter.cpp"],
cflags: [
"-Werror",
"-Wno-error=deprecated-declarations",

@ -22,6 +22,7 @@ cc_library {
"ProcessInfo.cpp",
"SchedulingPolicyService.cpp",
"ServiceUtilities.cpp",
"TimeCheck.cpp",
],
shared_libs: [
"libbinder",
@ -31,6 +32,8 @@ cc_library {
"libmemunreachable",
],
logtags: ["EventLogTags.logtags"],
cflags: [
"-Wall",
"-Wextra",

@ -0,0 +1,41 @@
# The entries in this file map a sparse set of log tag numbers to tag names.
# This is installed on the device, in /system/etc, and parsed by logcat.
#
# Tag numbers are decimal integers, from 0 to 2^31. (Let's leave the
# negative values alone for now.)
#
# Tag names are one or more ASCII letters and numbers or underscores, i.e.
# "[A-Z][a-z][0-9]_". Do not include spaces or punctuation (the former
# impacts log readability, the latter makes regex searches more annoying).
#
# Tag numbers and names are separated by whitespace. Blank lines and lines
# starting with '#' are ignored.
#
# Optionally, after the tag names can be put a description for the value(s)
# of the tag. Description are in the format
# (<name>|data type[|data unit])
# Multiple values are separated by commas.
#
# The data type is a number from the following values:
# 1: int
# 2: long
# 3: string
# 4: list
#
# The data unit is a number taken from the following list:
# 1: Number of objects
# 2: Number of bytes
# 3: Number of milliseconds
# 4: Number of allocations
# 5: Id
# 6: Percent
# Default value for data of type int/long is 2 (bytes).
#
# See system/core/logcat/event.logtags for the master copy of the tags.
# 61000 - 61199 reserved for audioserver
61000 audioserver_binder_timeout (command|3)
# NOTE - the range 1000000-2000000 is reserved for partners and others who
# want to define their own log tags without conflicting with the core platform.

@ -15,7 +15,9 @@
*/
#include <utils/Log.h>
#include <media/TimeCheck.h>
#include <media/EventLog.h>
namespace android {
@ -81,7 +83,10 @@ bool TimeCheck::TimeCheckThread::threadLoop()
status = mCond.waitRelative(mMutex, waitTimeNs);
}
}
LOG_ALWAYS_FATAL_IF(status != NO_ERROR, "TimeCheck timeout for %s", tag);
if (status != NO_ERROR) {
LOG_EVENT_STRING(LOGTAG_AUDIO_BINDER_TIMEOUT, tag);
LOG_ALWAYS_FATAL("TimeCheck timeout for %s", tag);
}
return true;
}

@ -0,0 +1,28 @@
/*
* Copyright (C) 2018 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef ANDROID_AUDIO_EVENT_LOG_H_
#define ANDROID_AUDIO_EVENT_LOG_H_
namespace android {
// keep values in sync with frameworks/av/media/utils/EventLogTags.logtags
enum {
LOGTAG_AUDIO_BINDER_TIMEOUT = 61000,
};
} // namespace android
#endif // ANDROID_AUDIO_EVENT_LOG_H_
Loading…
Cancel
Save