[libcamera-devel,1/4] tracepoints: request: Add private pointer to request_construct
diff mbox series

Message ID 20221209081937.598303-2-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
Since some Request tracepoints print the public pointer and some print
the private pointer, print both pointers in the constructor tracepoint
so that they can be used to associate with the other request
tracepoints.

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

Comments

Laurent Pinchart Dec. 11, 2022, 8:20 p.m. UTC | #1
Hi Paul,

Thank you for the patch.

On Fri, Dec 09, 2022 at 05:19:34PM +0900, Paul Elder via libcamera-devel wrote:
> Since some Request tracepoints print the public pointer and some print
> the private pointer, print both pointers in the constructor tracepoint
> so that they can be used to associate with the other request
> tracepoints.

Wouldn't it be easier to standardize on printing the same pointer in all
request trace points ?

> Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
> ---
>  include/libcamera/internal/tracepoints/request.tp | 13 ++++++++++---
>  src/libcamera/request.cpp                         |  2 +-
>  2 files changed, 11 insertions(+), 4 deletions(-)
> 
> diff --git a/include/libcamera/internal/tracepoints/request.tp b/include/libcamera/internal/tracepoints/request.tp
> index f1e54497..491c7705 100644
> --- a/include/libcamera/internal/tracepoints/request.tp
> +++ b/include/libcamera/internal/tracepoints/request.tp
> @@ -8,6 +8,7 @@
>  #include <libcamera/internal/request.h>
>  
>  #include <libcamera/framebuffer.h>
> +#include <libcamera/request.h>
>  
>  TRACEPOINT_EVENT_CLASS(
>  	libcamera,
> @@ -22,12 +23,18 @@ TRACEPOINT_EVENT_CLASS(
>  	)
>  )
>  
> -TRACEPOINT_EVENT_INSTANCE(
> +TRACEPOINT_EVENT(
>  	libcamera,
> -	request,
>  	request_construct,
>  	TP_ARGS(
> -		libcamera::Request *, req
> +		libcamera::Request *, req,
> +		libcamera::Request::Private *, priv
> +	),
> +	TP_FIELDS(
> +		ctf_integer_hex(uintptr_t, request, reinterpret_cast<uintptr_t>(req))
> +		ctf_integer_hex(uintptr_t, priv, reinterpret_cast<uintptr_t>(priv))
> +		ctf_integer(uint64_t, cookie, req->cookie())
> +		ctf_enum(libcamera, request_status, uint32_t, status, req->status())
>  	)
>  )
>  
> diff --git a/src/libcamera/request.cpp b/src/libcamera/request.cpp
> index 949c556f..b9fb17d6 100644
> --- a/src/libcamera/request.cpp
> +++ b/src/libcamera/request.cpp
> @@ -356,7 +356,7 @@ Request::Request(Camera *camera, uint64_t cookie)
>  	 */
>  	metadata_ = new ControlList(controls::controls);
>  
> -	LIBCAMERA_TRACEPOINT(request_construct, this);
> +	LIBCAMERA_TRACEPOINT(request_construct, this, _d());
>  
>  	LOG(Request, Debug) << "Created request - cookie: " << cookie_;
>  }

Patch
diff mbox series

diff --git a/include/libcamera/internal/tracepoints/request.tp b/include/libcamera/internal/tracepoints/request.tp
index f1e54497..491c7705 100644
--- a/include/libcamera/internal/tracepoints/request.tp
+++ b/include/libcamera/internal/tracepoints/request.tp
@@ -8,6 +8,7 @@ 
 #include <libcamera/internal/request.h>
 
 #include <libcamera/framebuffer.h>
+#include <libcamera/request.h>
 
 TRACEPOINT_EVENT_CLASS(
 	libcamera,
@@ -22,12 +23,18 @@  TRACEPOINT_EVENT_CLASS(
 	)
 )
 
-TRACEPOINT_EVENT_INSTANCE(
+TRACEPOINT_EVENT(
 	libcamera,
-	request,
 	request_construct,
 	TP_ARGS(
-		libcamera::Request *, req
+		libcamera::Request *, req,
+		libcamera::Request::Private *, priv
+	),
+	TP_FIELDS(
+		ctf_integer_hex(uintptr_t, request, reinterpret_cast<uintptr_t>(req))
+		ctf_integer_hex(uintptr_t, priv, reinterpret_cast<uintptr_t>(priv))
+		ctf_integer(uint64_t, cookie, req->cookie())
+		ctf_enum(libcamera, request_status, uint32_t, status, req->status())
 	)
 )
 
diff --git a/src/libcamera/request.cpp b/src/libcamera/request.cpp
index 949c556f..b9fb17d6 100644
--- a/src/libcamera/request.cpp
+++ b/src/libcamera/request.cpp
@@ -356,7 +356,7 @@  Request::Request(Camera *camera, uint64_t cookie)
 	 */
 	metadata_ = new ControlList(controls::controls);
 
-	LIBCAMERA_TRACEPOINT(request_construct, this);
+	LIBCAMERA_TRACEPOINT(request_construct, this, _d());
 
 	LOG(Request, Debug) << "Created request - cookie: " << cookie_;
 }