All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Detlev Casanova" <detlev.casanova@collabora.com>
Cc: linux-trace-kernel@vger.kernel.org, media-ci@linuxtv.org
Subject: Re: [PATCH v3 6/9] media: Trace the stateless controls when set in v4l2-ctrls-core.c
Date: Wed, 25 Nov 2026 19:00:25 +0000	[thread overview]
Message-ID: <sashiko-outbox-234027@kernel.org> (raw)
In-Reply-To: <20261125-v4l2-add-ftrace-v3-6-1d1db48372ed@collabora.com>

Thank you for your contribution! Sashiko AI review found 3 potential
issues to consider:
- [High] media: v4l2-ctrls: trace_ext_ctrl() traces stale p_cur instead
  of p_new
- [Medium] media: v4l2-ctrls: trace_ext_ctrl() called on error in
  try_set_ext_ctrls_common()
- [Medium] media: v4l2-ctrls: missing HEVC RPS cases in
  v4l2_ctrl_type_op_trace()
--

commit f76da63b5503cac75415a06f2f5c14ded049c6e5
Author: Detlev Casanova <detlev.casanova@collabora.com>

media: Trace the stateless controls when set in v4l2-ctrls-core.c

This commit adds a trace callback to struct v4l2_ctrl_type_ops to trace
stateless codec controls when set in try_set_ext_ctrls_common(), and
removes the driver-specific control tracing from visl.

[Severity: High]
In drivers/media/v4l2-core/v4l2-ctrls-api.c, should trace_ext_ctrl() pass
ctrl->p_new instead of ctrl->p_cur to ctrl->type_ops->trace()?

When stateless controls are set through a request (hdl->req_obj.req is
non-NULL), try_set_ext_ctrls_common() calls try_or_set_cluster() with its
set argument false and copies ctrl->p_new into ref->p_req via new_to_req().
Because new_to_cur() is not called until the request is later applied by
v4l2_ctrl_request_setup(), ctrl->p_cur still holds the previous or initial
default value when trace_ext_ctrl() runs, so request-based control updates
trace stale data.

[Severity: Medium]
In drivers/media/v4l2-core/v4l2-ctrls-api.c, inside
try_set_ext_ctrls_common(), should the trace_ext_ctrl(fh, master) call be
guarded by if (!ret && set) instead of only if (set)?

Without checking !ret, trace_ext_ctrl() still fires when user_to_new(),
validate_new(), try_or_set_cluster(), or new_to_user() fails earlier in the
loop iteration.

[Severity: Medium]
In drivers/media/v4l2-core/v4l2-ctrls-core.c, does
v4l2_ctrl_type_op_trace() drop tracing for
V4L2_CTRL_TYPE_HEVC_EXT_SPS_LT_RPS and V4L2_CTRL_TYPE_HEVC_EXT_SPS_ST_RPS?

visl_trace_ctrls() in drivers/media/test-drivers/visl/visl-dec.c previously
called trace_v4l2_ctrl_hevc_ext_sps_lt_rps() and
trace_v4l2_ctrl_hevc_ext_sps_st_rps(), but removing visl_trace_ctrls()
without adding those two types to v4l2_ctrl_type_op_trace() leaves those
tracepoints unused.  Also, for dynamic-array stateless controls (such as
V4L2_CTRL_TYPE_HEVC_SLICE_PARAMS, V4L2_CTRL_TYPE_AV1_TILE_GROUP_ENTRY, and
the two HEVC RPS controls), v4l2_ctrl_type_op_trace() only traces the first
element instead of iterating over ctrl->new_elems.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261125-v4l2-add-ftrace-v3-0-1d1db48372ed@collabora.com?part=6

  reply	other threads:[~2026-11-25 19:00 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-25 18:33 [PATCH v3 0/9] v4l2: Add tracing for stateless codecs Detlev Casanova
2026-11-25 18:33 ` Detlev Casanova
2026-11-25 18:33 ` [PATCH v3 1/9] media: Move visl traces to v4l2-core Detlev Casanova
2026-11-25 18:33   ` Detlev Casanova
2026-11-25 18:58   ` sashiko-bot
2026-11-25 18:33 ` [PATCH v3 2/9] media: Map each struct field to its own trace field Detlev Casanova
2026-11-25 18:33   ` Detlev Casanova
2026-11-25 18:33 ` [PATCH v3 3/9] media: Add tgid and fd fields in v4l2_fh struct Detlev Casanova
2026-11-25 18:33   ` Detlev Casanova
2026-11-25 18:59   ` sashiko-bot
2026-11-25 18:33 ` [PATCH v3 4/9] media: Add tgid and fd to the v4l2-requests trace fields Detlev Casanova
2026-11-25 18:33   ` Detlev Casanova
2026-11-25 18:56   ` sashiko-bot
2026-11-25 18:33 ` [PATCH v3 5/9] media: Add missing types to v4l2_ctrl_ptr Detlev Casanova
2026-11-25 18:33   ` Detlev Casanova
2026-11-25 18:33 ` [PATCH v3 6/9] media: Trace the stateless controls when set in v4l2-ctrls-core.c Detlev Casanova
2026-11-25 18:33   ` Detlev Casanova
2026-11-25 19:00   ` sashiko-bot [this message]
2026-11-25 18:33 ` [PATCH v3 7/9] media: Add stream on/off traces and run them in the ioctl Detlev Casanova
2026-11-25 18:33   ` Detlev Casanova
2026-11-25 18:57   ` sashiko-bot
2026-11-25 18:33 ` [PATCH v3 8/9] media: Add HW run/done trace events Detlev Casanova
2026-11-25 18:33   ` Detlev Casanova
2026-11-25 18:33 ` [PATCH v3 9/9] media: hantro: Add v4l2_hw run/done traces Detlev Casanova
2026-11-25 18:33   ` Detlev Casanova
2026-11-25 19:01   ` sashiko-bot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=sashiko-outbox-234027@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=detlev.casanova@collabora.com \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=media-ci@linuxtv.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.