public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: Nicolas Dufresne <nicolas.dufresne@collabora.com>
To: Detlev Casanova <detlev.casanova@collabora.com>,
	 linux-kernel@vger.kernel.org
Cc: Benjamin Gaignard <benjamin.gaignard@collabora.com>,
	Philipp Zabel	 <p.zabel@pengutronix.de>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Heiko Stuebner <heiko@sntech.de>,
	Daniel Almeida <daniel.almeida@collabora.com>,
	Steven Rostedt	 <rostedt@goodmis.org>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
	Hans Verkuil <hverkuil@kernel.org>,
	Laurent Pinchart	 <laurent.pinchart+renesas@ideasonboard.com>,
	Ricardo Ribalda	 <ribalda@chromium.org>,
	Yunke Cao <yunkec@google.com>,
	Sakari Ailus	 <sakari.ailus@linux.intel.com>,
	Pavan Bobba <opensource206@gmail.com>,
	James Cowgill <james.cowgill@blaize.com>,
	Ma Ke <make24@iscas.ac.cn>,
	Jacopo Mondi	 <jacopo.mondi@ideasonboard.com>,
	Daniel Scally <dan.scally@ideasonboard.com>,
		linux-media@vger.kernel.org, linux-rockchip@lists.infradead.org,
		linux-arm-kernel@lists.infradead.org,
	linux-trace-kernel@vger.kernel.org, 	kernel@collabora.com
Subject: Re: [PATCH 00/11] v4l2: Add tracing for stateless codecs
Date: Tue, 28 Apr 2026 15:52:14 -0400	[thread overview]
Message-ID: <4c216c195d237e71188dfbdd54bbc1e234eff434.camel@collabora.com> (raw)
In-Reply-To: <20260212162328.192217-1-detlev.casanova@collabora.com>

[-- Attachment #1: Type: text/plain, Size: 5527 bytes --]

Le jeudi 12 février 2026 à 11:23 -0500, Detlev Casanova a écrit :
> Hi !
> 
> This patchset aims to improve codec event tracing in v4l2.
> 
> The traces added in visl by Daniel Almeida are moved to the global trace
> events and slightly reworked to be printed in a more consistent format.
> 
> To each trace are also added a tgid and fd fields, helping userspace track
> different decoding sessions (contexts) based on the given file descriptor
> used by the given process id.
> 
> Also for better tracking, stream on and stream off events are added as
> well as HW run and HW done events to track decoder core usage.
> 
> Finally, add a show_fdinfo callback on video device files, allowing drivers
> to expose usage information.
> Currently only used for frame buffer memory usage.
> 
> The main focus is to be able to generate perfetto traces to show VPU usage,
> a perfetto producer using this can be found at [1].
> 
> [1]:
> https://gitlab.collabora.com/detlev/hantro-perf/-/tree/hantro-improved-info

I would recommend renaming this repo, as its not really evolving toward
something truly hantro specific anymore, same goes for the code below appart
from the run/done traces and the fdinfo that has to be opted in.

There is effectively a bit of an overlap with the v4l2-tracer, but there is also
advantages having it in the kernel, as you source all the event, for the entire
system, in one place, so I'm fine with that. Considering the possible large
overhead of the full trace, I'd like to see the ability to filter what we want
to trace, with some level of granularity. Maybe we only need decode_params for
specific use case to be debugged, and don't care about large scaling list/matrix
? I would also like to see some Documentation on the tracing, so that its usage
is not only explained in a tool.

To Hans, there is nice tools idea in there, the perfetto producer is simply C++,
and the v4l2top utility is Rust. Would you see these as tools v4l2-utils ? For
the rust part, we can either leave the build independent, and cargo would be
used to build and run, or we can implement a meson wrapper around cargo. But I
don't believe its a good idea to use native rustc support in meson for that one
because of the large number of third party crate needed.

I like the direction, hope the feedback suite you well.

Nicolas

> 
> Detlev Casanova (11):
>   media: Move visl traces to v4l2-core
>   media: Reformat v4l2-requests trace event printk
>   media: Add tgid and fd fields in v4l2_fh struct
>   media: Add tgid and fd to the v4l2-requests trace fields
>   media: Add missing types to v4l2_ctrl_ptr
>   media: Trace the stateless controls when set in v4l2-ctrls-core.c
>   media: Add stream on/off traces and run them in the ioctl
>   media: Add HW run/done trace events
>   media: hantro: Add v4l2_hw run/done traces
>   media: v4l2: Add callback for show_fdinfo
>   media: hantro: Add fdinfo callback
> 
>  drivers/media/platform/verisilicon/hantro.h   |    2 +
>  .../media/platform/verisilicon/hantro_drv.c   |   25 +
>  .../media/platform/verisilicon/hantro_v4l2.c  |   10 +-
>  .../verisilicon/rockchip_vpu981_regs.h        |    1 +
>  .../platform/verisilicon/rockchip_vpu_hw.c    |    4 +
>  drivers/media/test-drivers/visl/Makefile      |    2 +-
>  drivers/media/test-drivers/visl/visl-dec.c    |   76 -
>  .../media/test-drivers/visl/visl-trace-av1.h  |  314 ---
>  .../media/test-drivers/visl/visl-trace-fwht.h |   66 -
>  .../media/test-drivers/visl/visl-trace-h264.h |  349 ----
>  .../media/test-drivers/visl/visl-trace-hevc.h |  464 -----
>  .../test-drivers/visl/visl-trace-mpeg2.h      |   99 -
>  .../test-drivers/visl/visl-trace-points.c     |   11 -
>  .../media/test-drivers/visl/visl-trace-vp8.h  |  156 --
>  .../media/test-drivers/visl/visl-trace-vp9.h  |  292 ---
>  drivers/media/v4l2-core/v4l2-ctrls-api.c      |   10 +
>  drivers/media/v4l2-core/v4l2-ctrls-core.c     |  114 +
>  drivers/media/v4l2-core/v4l2-dev.c            |   10 +
>  drivers/media/v4l2-core/v4l2-fh.c             |    1 +
>  drivers/media/v4l2-core/v4l2-ioctl.c          |   37 +-
>  drivers/media/v4l2-core/v4l2-trace.c          |   48 +
>  include/media/v4l2-ctrls.h                    |   19 +
>  include/media/v4l2-dev.h                      |    1 +
>  include/media/v4l2-fh.h                       |    4 +
>  include/trace/events/v4l2.h                   |   58 +
>  include/trace/events/v4l2_requests.h          | 1836 +++++++++++++++++
>  26 files changed, 2178 insertions(+), 1831 deletions(-)
>  delete mode 100644 drivers/media/test-drivers/visl/visl-trace-av1.h
>  delete mode 100644 drivers/media/test-drivers/visl/visl-trace-fwht.h
>  delete mode 100644 drivers/media/test-drivers/visl/visl-trace-h264.h
>  delete mode 100644 drivers/media/test-drivers/visl/visl-trace-hevc.h
>  delete mode 100644 drivers/media/test-drivers/visl/visl-trace-mpeg2.h
>  delete mode 100644 drivers/media/test-drivers/visl/visl-trace-points.c
>  delete mode 100644 drivers/media/test-drivers/visl/visl-trace-vp8.h
>  delete mode 100644 drivers/media/test-drivers/visl/visl-trace-vp9.h
>  create mode 100644 include/trace/events/v4l2_requests.h

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

  parent reply	other threads:[~2026-04-28 19:52 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-12 16:23 [PATCH 00/11] v4l2: Add tracing for stateless codecs Detlev Casanova
2026-02-12 16:23 ` [PATCH 02/11] media: Reformat v4l2-requests trace event printk Detlev Casanova
2026-04-28 19:28   ` Nicolas Dufresne
2026-02-12 16:23 ` [PATCH 03/11] media: Add tgid and fd fields in v4l2_fh struct Detlev Casanova
2026-04-28 19:31   ` Nicolas Dufresne
2026-02-12 16:23 ` [PATCH 04/11] media: Add tgid and fd to the v4l2-requests trace fields Detlev Casanova
2026-04-28 19:32   ` Nicolas Dufresne
2026-02-12 16:23 ` [PATCH 05/11] media: Add missing types to v4l2_ctrl_ptr Detlev Casanova
2026-04-28 19:33   ` Nicolas Dufresne
2026-02-12 16:23 ` [PATCH 06/11] media: Trace the stateless controls when set in v4l2-ctrls-core.c Detlev Casanova
2026-04-28 19:37   ` Nicolas Dufresne
2026-02-12 16:23 ` [PATCH 07/11] media: Add stream on/off traces and run them in the ioctl Detlev Casanova
2026-02-12 16:23 ` [PATCH 08/11] media: Add HW run/done trace events Detlev Casanova
2026-02-12 16:23 ` [PATCH 09/11] media: hantro: Add v4l2_hw run/done traces Detlev Casanova
2026-02-12 16:23 ` [PATCH 10/11] media: v4l2: Add callback for show_fdinfo Detlev Casanova
2026-02-12 16:23 ` [PATCH 11/11] media: hantro: Add fdinfo callback Detlev Casanova
2026-04-28 19:41   ` Nicolas Dufresne
2026-04-28 19:52 ` Nicolas Dufresne [this message]
2026-05-01 18:07   ` [PATCH 00/11] v4l2: Add tracing for stateless codecs Detlev Casanova
     [not found] ` <20260212162328.192217-2-detlev.casanova@collabora.com>
2026-05-01 19:07   ` [PATCH 01/11] media: Move visl traces to v4l2-core Steven Rostedt

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=4c216c195d237e71188dfbdd54bbc1e234eff434.camel@collabora.com \
    --to=nicolas.dufresne@collabora.com \
    --cc=benjamin.gaignard@collabora.com \
    --cc=dan.scally@ideasonboard.com \
    --cc=daniel.almeida@collabora.com \
    --cc=detlev.casanova@collabora.com \
    --cc=heiko@sntech.de \
    --cc=hverkuil@kernel.org \
    --cc=jacopo.mondi@ideasonboard.com \
    --cc=james.cowgill@blaize.com \
    --cc=kernel@collabora.com \
    --cc=laurent.pinchart+renesas@ideasonboard.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=make24@iscas.ac.cn \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mchehab@kernel.org \
    --cc=mhiramat@kernel.org \
    --cc=opensource206@gmail.com \
    --cc=p.zabel@pengutronix.de \
    --cc=ribalda@chromium.org \
    --cc=rostedt@goodmis.org \
    --cc=sakari.ailus@linux.intel.com \
    --cc=yunkec@google.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox