Linux Media Controller development
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Detlev Casanova <detlev.casanova@collabora.com>
Cc: linux-kernel@vger.kernel.org,
	Nicolas Dufresne <nicolas.dufresne@collabora.com>,
	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>,
	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 01/11] media: Move visl traces to v4l2-core
Date: Fri, 1 May 2026 15:07:44 -0400	[thread overview]
Message-ID: <20260501150744.065081ac@gandalf.local.home> (raw)
In-Reply-To: <20260212162328.192217-2-detlev.casanova@collabora.com>


Sorry, I didn't look at these patches at the time they were posted, but
when I saw you reply recently with:

 "On the userspace side, each trace events can be enabled separately and 
  even filtered (although I'm not sure filtering is good for performance, 
  has it has to match each event with a regex)."

I had to see what you meant by regex, because no tracer should be using
regex for filtering.

On Thu, 12 Feb 2026 11:23:18 -0500
Detlev Casanova <detlev.casanova@collabora.com> wrote:

> +
> +DECLARE_EVENT_CLASS(v4l2_ctrl_mpeg2_seq_tmpl,
> +	TP_PROTO(const struct v4l2_ctrl_mpeg2_sequence *s),
> +	TP_ARGS(s),
> +	TP_STRUCT__entry(__field_struct(struct v4l2_ctrl_mpeg2_sequence, s)),
> +	TP_fast_assign(__entry->s = *s;),

What the heck! You are copying an entire structure onto the ring buffer to
print just a portion of it? This is really a waste of ring buffer, and also
prevents you from doing any real filtering.

You do realize that you can filter on fields (if they are defined as normal
fields).

 For example, 

  # cd /sys/kernel/tracing
  # echo 'height > 20 && width > 30' > events/visl_fwht_controls/v4l2_ctrl_fwht_params/filter
  # echo 1 > events/visl_fwht_controls/v4l2_ctrl_fwht_params/enable

And that will only trace that event where the height field is greater than
20 and the width field is greater than 30. It's converted into a fast array
to do the filtering. No regex involved.

Also, there's a library to read the raw events from the ring buffers where
you can do filtering on the read side too:

  https://trace-cmd.org/Documentation/libtracefs/
  https://trace-cmd.org/Documentation/libtraceevent/

-- Steve

> +	TP_printk("\nhorizontal_size %u\nvertical_size %u\nvbv_buffer_size %u\n"
> +		  "profile_and_level_indication %u\nchroma_format %u\nflags %s\n",
> +		  __entry->s.horizontal_size,
> +		  __entry->s.vertical_size,
> +		  __entry->s.vbv_buffer_size,
> +		  __entry->s.profile_and_level_indication,
> +		  __entry->s.chroma_format,
> +		  __print_flags(__entry->s.flags, "|",
> +		  {V4L2_MPEG2_SEQ_FLAG_PROGRESSIVE, "PROGRESSIVE"})
> +	)
> +);
> +

  parent reply	other threads:[~2026-05-01 19:07 UTC|newest]

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

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=20260501150744.065081ac@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --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=nicolas.dufresne@collabora.com \
    --cc=opensource206@gmail.com \
    --cc=p.zabel@pengutronix.de \
    --cc=ribalda@chromium.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