Camera2: Debug and logging fixes.
- Fix LOG_TAGs to work with standard logcat filtering.
- Add ATRACE to Camera2Device
- Shorten thread names to fit in 16 characters
- Remove some ATRACEs to avoid flooding trace unnecessarily
Bug: 7220520
Change-Id: Ief8d677b5c8bb35d94e0f21b11b86505e83169ea
diff --git a/services/camera/libcameraservice/camera2/CaptureSequencer.cpp b/services/camera/libcameraservice/camera2/CaptureSequencer.cpp
index 6d7c54f..c9498c2 100644
--- a/services/camera/libcameraservice/camera2/CaptureSequencer.cpp
+++ b/services/camera/libcameraservice/camera2/CaptureSequencer.cpp
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#define LOG_TAG "Camera2Client::CaptureSequencer"
+#define LOG_TAG "Camera2-CaptureSequencer"
#define ATRACE_TAG ATRACE_TAG_CAMERA
//#define LOG_NDEBUG 0
@@ -169,7 +169,11 @@
if (client == 0) return false;
if (mCaptureState < ERROR) {
+ CaptureState oldState = mCaptureState;
mCaptureState = (this->*kStateManagers[mCaptureState])(client);
+ if (ATRACE_ENABLED() && oldState != mCaptureState) {
+ ATRACE_INT("cam2_capt_state", mCaptureState);
+ }
} else {
ALOGE("%s: Bad capture state: %s",
__FUNCTION__, kStateNames[mCaptureState]);
@@ -181,7 +185,6 @@
CaptureSequencer::CaptureState CaptureSequencer::manageIdle(sp<Camera2Client> &client) {
status_t res;
- ATRACE_CALL();
Mutex::Autolock l(mInputMutex);
while (!mStartCapture) {
res = mStartCaptureSignal.waitRelative(mInputMutex,