diff mbox series

[3/4] v4l2-tracer: stringify target in v4l2_selection

Message ID 6ba577331303022b419d58fcbfaeba7b2459a5b5.1686102391.git.deborah.brouwer@collabora.com (mailing list archive)
State New, archived
Headers show
Series v4l2-tracer: add tracing for frames/events | expand

Commit Message

Deborah Brouwer June 7, 2023, 2:11 a.m. UTC
The struct v4l2_selection has a member "target" that is currently being
traced as an integer.  Since the "target" values are defines, convert them
to strings to make the trace easier to read.

Signed-off-by: Deborah Brouwer <deborah.brouwer@collabora.com>
---
 utils/v4l2-tracer/v4l2-tracer-gen.pl | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/utils/v4l2-tracer/v4l2-tracer-gen.pl b/utils/v4l2-tracer/v4l2-tracer-gen.pl
index f3eb87bb..4db204e3 100755
--- a/utils/v4l2-tracer/v4l2-tracer-gen.pl
+++ b/utils/v4l2-tracer/v4l2-tracer-gen.pl
@@ -246,7 +246,9 @@  sub get_val_def_name {
 	if ($member eq "audmode") {
 		return "tuner_audmode_val_def";
 	}
-	return "";
+	if ($member eq "target" && $struct_name eq "v4l2_selection") {
+		return "selection_target_val_def";
+	}
 }
 
 sub get_flag_def_name {
@@ -974,6 +976,11 @@  while (<>) {
 	if (grep {/^#define\s+(MEDIA_REQUEST_IOC\w*)\s*.*/} $_) {
 		push (@ioctls, $_);
 	}
+	if (grep {/^#define V4L2_SEL_TGT_CROP\s+/} $_) {
+		printf $fh_common_info_h "constexpr val_def selection_target_val_def[] = {\n";
+		val_def_gen("V4L2_SEL_TGT_COMPOSE_PADDED");
+		next;
+	}
 }
 
 printf $fh_common_info_h "constexpr val_def control_val_def[] = {\n";