mirror of
https://git.libcamera.org/libcamera/libcamera.git
synced 2025-07-25 17:45:06 +03:00
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>
This commit is contained in:
parent
fcc6d4bd76
commit
27c9d6eceb
6 changed files with 130 additions and 0 deletions
9
include/libcamera/internal/tracepoints/buffer_enums.tp
Normal file
9
include/libcamera/internal/tracepoints/buffer_enums.tp
Normal file
|
@ -0,0 +1,9 @@
|
|||
TRACEPOINT_ENUM(
|
||||
libcamera,
|
||||
buffer_status,
|
||||
TP_ENUM_VALUES(
|
||||
ctf_enum_value("FrameSuccess", 0)
|
||||
ctf_enum_value("FrameError", 1)
|
||||
ctf_enum_value("FrameCancelled", 2)
|
||||
)
|
||||
)
|
|
@ -1,4 +1,12 @@
|
|||
# SPDX-License-Identifier: CC0-1.0
|
||||
|
||||
# enum files must go first
|
||||
tracepoint_files = files([
|
||||
'buffer_enums.tp',
|
||||
'request_enums.tp',
|
||||
])
|
||||
|
||||
tracepoint_files += files([
|
||||
'pipeline.tp',
|
||||
'request.tp',
|
||||
])
|
||||
|
|
25
include/libcamera/internal/tracepoints/pipeline.tp
Normal file
25
include/libcamera/internal/tracepoints/pipeline.tp
Normal file
|
@ -0,0 +1,25 @@
|
|||
TRACEPOINT_EVENT(
|
||||
libcamera,
|
||||
ipa_call_begin,
|
||||
TP_ARGS(
|
||||
const char *, pipe,
|
||||
const char *, func
|
||||
),
|
||||
TP_FIELDS(
|
||||
ctf_string(pipeline_name, pipe)
|
||||
ctf_string(function_name, func)
|
||||
)
|
||||
)
|
||||
|
||||
TRACEPOINT_EVENT(
|
||||
libcamera,
|
||||
ipa_call_end,
|
||||
TP_ARGS(
|
||||
const char *, pipe,
|
||||
const char *, func
|
||||
),
|
||||
TP_FIELDS(
|
||||
ctf_string(pipeline_name, pipe)
|
||||
ctf_string(function_name, func)
|
||||
)
|
||||
)
|
68
include/libcamera/internal/tracepoints/request.tp
Normal file
68
include/libcamera/internal/tracepoints/request.tp
Normal file
|
@ -0,0 +1,68 @@
|
|||
#include <libcamera/buffer.h>
|
||||
#include <libcamera/request.h>
|
||||
|
||||
TRACEPOINT_EVENT_CLASS(
|
||||
libcamera,
|
||||
request,
|
||||
TP_ARGS(
|
||||
libcamera::Request *, req
|
||||
),
|
||||
TP_FIELDS(
|
||||
ctf_integer_hex(uintptr_t, request, reinterpret_cast<uintptr_t>(req))
|
||||
ctf_integer(uint64_t, cookie, req->cookie())
|
||||
ctf_enum(libcamera, request_status, uint32_t, status, req->status())
|
||||
)
|
||||
)
|
||||
|
||||
TRACEPOINT_EVENT_INSTANCE(
|
||||
libcamera,
|
||||
request,
|
||||
request_construct,
|
||||
TP_ARGS(
|
||||
libcamera::Request *, req
|
||||
)
|
||||
)
|
||||
|
||||
TRACEPOINT_EVENT_INSTANCE(
|
||||
libcamera,
|
||||
request,
|
||||
request_destroy,
|
||||
TP_ARGS(
|
||||
libcamera::Request *, req
|
||||
)
|
||||
)
|
||||
|
||||
TRACEPOINT_EVENT_INSTANCE(
|
||||
libcamera,
|
||||
request,
|
||||
request_reuse,
|
||||
TP_ARGS(
|
||||
libcamera::Request *, req
|
||||
)
|
||||
)
|
||||
|
||||
TRACEPOINT_EVENT_INSTANCE(
|
||||
libcamera,
|
||||
request,
|
||||
request_complete,
|
||||
TP_ARGS(
|
||||
libcamera::Request *, req
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
TRACEPOINT_EVENT(
|
||||
libcamera,
|
||||
request_complete_buffer,
|
||||
TP_ARGS(
|
||||
libcamera::Request *, req,
|
||||
libcamera::FrameBuffer *, buf
|
||||
),
|
||||
TP_FIELDS(
|
||||
ctf_integer_hex(uintptr_t, request, reinterpret_cast<uintptr_t>(req))
|
||||
ctf_integer(uint64_t, cookie, req->cookie())
|
||||
ctf_integer(int, status, req->status())
|
||||
ctf_integer_hex(uintptr_t, buffer, reinterpret_cast<uintptr_t>(buf))
|
||||
ctf_enum(libcamera, buffer_status, uint32_t, buf_status, buf->metadata().status)
|
||||
)
|
||||
)
|
9
include/libcamera/internal/tracepoints/request_enums.tp
Normal file
9
include/libcamera/internal/tracepoints/request_enums.tp
Normal file
|
@ -0,0 +1,9 @@
|
|||
TRACEPOINT_ENUM(
|
||||
libcamera,
|
||||
request_status,
|
||||
TP_ENUM_VALUES(
|
||||
ctf_enum_value("RequestPending", 0)
|
||||
ctf_enum_value("RequestComplete", 1)
|
||||
ctf_enum_value("RequestCancelled", 2)
|
||||
)
|
||||
)
|
Loading…
Add table
Add a link
Reference in a new issue