[RFC PATCH v2 2/4] Add eventfd option to --decode-fds

Dmitry V. Levin ldv at strace.io
Sat May 4 12:51:19 UTC 2024


On Thu, May 02, 2024 at 11:59:34PM +0530, Sahil wrote:
> On Thursday, May 2, 2024 3:25:24 AM IST Dmitry V. Levin wrote:
> > On Wed, May 01, 2024 at 10:57:59PM +0530, Sahil Siddiq wrote:
[...]

> > > +	if (efd_counter != -1ULL && efd_id != -1) {
> > > +		tprint_associated_info_begin();
> > > +		tprints_string("eventfd-count:");
> > > +		PRINT_VAL_U(efd_counter);
> > > +		tprint_arg_next();
> > 
> > tprint_arg_next() is for syscall and function arguments, here we probably
> > need to introduce tprint_associated_info_next().
> 
> Got it.
> 
> > > +		tprints_string("eventfd-id:");
> > > +		PRINT_VAL_U(efd_id);

Now that I think of it, this could be printed in a more structured way
by using a struct, e.g.

	tprint_associated_info_begin();
	tprint_struct_begin();
	tprints_field_name("eventfd-count");
	PRINT_VAL_U(efd_counter);
	tprint_struct_next();
	tprints_field_name("eventfd-id");
	PRINT_VAL_U(efd_id);
	tprint_struct_end();
	tprint_associated_info_end();


-- 
ldv


More information about the Strace-devel mailing list