[libcamera-devel,3/4] tracepoints: request: Add tracepoint for addBuffer
diff mbox series

Message ID 20221209081937.598303-4-paul.elder@ideasonboard.com
State New
Headers show
Series
  • tracepoints: request: Improve request tracepoints
Related show

Commit Message

Paul Elder Dec. 9, 2022, 8:19 a.m. UTC
Add a tracepoint event request_add_buffer for tracing
Request::addBuffer().

Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
---
 include/libcamera/internal/tracepoints/request.tp | 10 ++++++++++
 src/libcamera/request.cpp                         |  2 ++
 2 files changed, 12 insertions(+)

Patch
diff mbox series

diff --git a/include/libcamera/internal/tracepoints/request.tp b/include/libcamera/internal/tracepoints/request.tp
index 8e7cab5e..29aa3745 100644
--- a/include/libcamera/internal/tracepoints/request.tp
+++ b/include/libcamera/internal/tracepoints/request.tp
@@ -108,6 +108,16 @@  TRACEPOINT_EVENT_INSTANCE(
 	)
 )
 
+TRACEPOINT_EVENT_INSTANCE(
+	libcamera,
+	request_with_buffer,
+	request_add_buffer,
+	TP_ARGS(
+		libcamera::Request::Private *, req,
+		libcamera::FrameBuffer *, buf
+	)
+)
+
 TRACEPOINT_EVENT_INSTANCE(
 	libcamera,
 	request_with_buffer,
diff --git a/src/libcamera/request.cpp b/src/libcamera/request.cpp
index b9fb17d6..ecefba0b 100644
--- a/src/libcamera/request.cpp
+++ b/src/libcamera/request.cpp
@@ -462,6 +462,8 @@  void Request::reuse(ReuseFlag flags)
 int Request::addBuffer(const Stream *stream, FrameBuffer *buffer,
 		       std::unique_ptr<Fence> fence)
 {
+	LIBCAMERA_TRACEPOINT(request_add_buffer, _d(), buffer);
+
 	if (!stream) {
 		LOG(Request, Error) << "Invalid stream reference";
 		return -EINVAL;