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

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

Commit Message

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

Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>

---
Changes in v2:
- Change arg from private to public Request pointer
---
 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 b295b44f..e0ac45ac 100644
--- a/include/libcamera/internal/tracepoints/request.tp
+++ b/include/libcamera/internal/tracepoints/request.tp
@@ -100,6 +100,16 @@  TRACEPOINT_EVENT_INSTANCE(
 	)
 )
 
+TRACEPOINT_EVENT_INSTANCE(
+	libcamera,
+	request_with_buffer,
+	request_add_buffer,
+	TP_ARGS(
+		libcamera::Request *, req,
+		libcamera::FrameBuffer *, buf
+	)
+)
+
 TRACEPOINT_EVENT_INSTANCE(
 	libcamera,
 	request_with_buffer,
diff --git a/src/libcamera/request.cpp b/src/libcamera/request.cpp
index 652b7b70..226c26b7 100644
--- a/src/libcamera/request.cpp
+++ b/src/libcamera/request.cpp
@@ -463,6 +463,8 @@  void Request::reuse(ReuseFlag flags)
 int Request::addBuffer(const Stream *stream, FrameBuffer *buffer,
 		       std::unique_ptr<Fence> fence)
 {
+	LIBCAMERA_TRACEPOINT(request_add_buffer, this, buffer);
+
 	if (!stream) {
 		LOG(Request, Error) << "Invalid stream reference";
 		return -EINVAL;