[lttng-dev] [MODULES RFC PATCH] Extract the bitmask of FDs set in select syscall

Julien Desfossez jdesfossez at efficios.com
Thu Oct 8 09:53:01 EDT 2015


> > +#define OVERRIDE_64_select
> > +SC_LTTNG_TRACEPOINT_EVENT_CODE(select,
> > +	TP_PROTO(sc_exit(long ret,) int n, fd_set __user * inp, fd_set __user * outp,
> > +		fd_set __user * exp, struct timeval * tvp),
> > +	TP_ARGS(sc_exit(ret,) n, inp, outp, exp, tvp),
> > +	TP_locvar(
> > +		unsigned long fds_in[__FD_SETSIZE / (8 * sizeof(long))],
> > +			fds_out[__FD_SETSIZE / (8 * sizeof(long))],
> > +			fds_ex[__FD_SETSIZE / (8 * sizeof(long))];
> > +		int nb_in, nb_out, nb_ex;
> > +	),
> > +	TP_code(
> > +		sc_inout(
> > +		{
> > +			unsigned long nr;
> > +			int ret;
> > +
> > +			nr = FDS_BYTES(n);
> > +			tp_locvar->nb_in = 0;
> > +			tp_locvar->nb_out = 0;
> > +			tp_locvar->nb_ex = 0;
> 
> You could initialize them to 0 in TP_locvar (definition).
Hum apparently I can't do anything other than just declaring variables
in the TP_locvar section. Assigning a value to it (at declare time or
afterward) generates a lot of errors.

Julien



More information about the lttng-dev mailing list