summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPaul Elder <paul.elder@ideasonboard.com>2020-10-28 19:10:27 +0900
committerPaul Elder <paul.elder@ideasonboard.com>2020-11-03 11:30:09 +0900
commit27c9d6eceb15b8a4e400fd2b053fb84d0db10da4 (patch)
tree40f60fe2fcb7a8c0a0b3b5a48c0d8f22745c4268 /src
parentfcc6d4bd76874585336cb0bbbd369702b59515d2 (diff)
libcamera: request: Add tracepoints
Add and use tracepoints in Request. Requests are core to libcamera operation, thus detecting delays in their processing is important, and serves as a good usage example of tracepoints. Signed-off-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'src')
-rw-r--r--src/libcamera/request.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/libcamera/request.cpp b/src/libcamera/request.cpp
index ae8b1660..a68684ef 100644
--- a/src/libcamera/request.cpp
+++ b/src/libcamera/request.cpp
@@ -16,6 +16,7 @@
#include "libcamera/internal/camera_controls.h"
#include "libcamera/internal/log.h"
+#include "libcamera/internal/tracepoints.h"
/**
* \file request.h
@@ -85,10 +86,14 @@ Request::Request(Camera *camera, uint64_t cookie)
* \todo: Add a validator for metadata controls.
*/
metadata_ = new ControlList(controls::controls);
+
+ LIBCAMERA_TRACEPOINT(request_construct, this);
}
Request::~Request()
{
+ LIBCAMERA_TRACEPOINT(request_destroy, this);
+
delete metadata_;
delete controls_;
delete validator_;
@@ -106,6 +111,8 @@ Request::~Request()
*/
void Request::reuse(ReuseFlag flags)
{
+ LIBCAMERA_TRACEPOINT(request_reuse, this);
+
pending_.clear();
if (flags & ReuseBuffers) {
for (auto pair : bufferMap_) {
@@ -259,6 +266,8 @@ void Request::complete()
LOG(Request, Debug)
<< "Request has completed - cookie: " << cookie_
<< (cancelled_ ? " [Cancelled]" : "");
+
+ LIBCAMERA_TRACEPOINT(request_complete, this);
}
/**
@@ -276,6 +285,8 @@ void Request::complete()
*/
bool Request::completeBuffer(FrameBuffer *buffer)
{
+ LIBCAMERA_TRACEPOINT(request_complete_buffer, this, buffer);
+
int ret = pending_.erase(buffer);
ASSERT(ret == 1);