cameraserver: Make trace points in HFR code paths optional.
Per processCaptureResult save 4 trace point costs -> approximately 2%of 4ms budget.
Save 2 trace points per processCaptureRequest call.
[assuming each trace point costs around 10us]
Bug: 155910869
Test: Try HFR; record perfetto trace, make sure trace points opted out
don't appear
Change-Id: Ifcfec6e0d5a40958cd4f84734b6be094afaa4f17
Signed-off-by: Jayant Chowdhary <jchowdhary@google.com>
diff --git a/services/camera/libcameraservice/device3/Camera3OutputStream.cpp b/services/camera/libcameraservice/device3/Camera3OutputStream.cpp
index e1d35e8..01ca006 100644
--- a/services/camera/libcameraservice/device3/Camera3OutputStream.cpp
+++ b/services/camera/libcameraservice/device3/Camera3OutputStream.cpp
@@ -21,6 +21,7 @@
#include <utils/Log.h>
#include <utils/Trace.h>
#include "Camera3OutputStream.h"
+#include "utils/TraceHFR.h"
#ifndef container_of
#define container_of(ptr, type, member) \
@@ -160,7 +161,7 @@
status_t Camera3OutputStream::getBufferLocked(camera3_stream_buffer *buffer,
const std::vector<size_t>&) {
- ATRACE_CALL();
+ ATRACE_HFR_CALL();
ANativeWindowBuffer* anb;
int fenceFd = -1;
@@ -190,7 +191,7 @@
status_t Camera3OutputStream::returnBufferLocked(
const camera3_stream_buffer &buffer,
nsecs_t timestamp, const std::vector<size_t>& surface_ids) {
- ATRACE_CALL();
+ ATRACE_HFR_CALL();
status_t res = returnAnyBufferLocked(buffer, timestamp, /*output*/true, surface_ids);
@@ -516,7 +517,7 @@
}
status_t Camera3OutputStream::getBufferLockedCommon(ANativeWindowBuffer** anb, int* fenceFd) {
- ATRACE_CALL();
+ ATRACE_HFR_CALL();
status_t res;
if ((res = getBufferPreconditionCheckLocked()) != OK) {