[PATCH 2/2] asinfo: Introduce static query tool asinfo

Eugene Syromiatnikov esyr at redhat.com
Mon Aug 7 08:40:56 UTC 2017


On Tue, Aug 01, 2017 at 01:13:56AM +0300, Edgar Kaziakhmedov wrote:
> On Mon, 31 Jul 2017 06:19:23 +0200
> Eugene Syromiatnikov <esyr at redhat.com> wrote:
> > > +enum impl_type
> > > +al_sck_syscall(struct arch_service *m, unsigned index)
> > > +{
> > > +	struct arch_descriptor *elem = al_get(m, index);
> > > +	int i;
> > > +	enum impl_type impl_buf = IMPL_int;
> > > +
> > > +	for (i = 0; i < elem->max_scn; i++) {
> > > +		if (elem->list_of_syscall[i].sys_name == NULL)
> > > +			continue;
> > > +		if (strcmp(elem->list_of_syscall[i].sys_name,
> > > +			   "socketcall") == 0)
> > > +			impl_buf = IMPL_int;
> > > +		/* It is enough to find just socket sybcall */
> > > +		if ((strcmp(elem->list_of_syscall[i].sys_name,
> > > "socket") == 0)
> > > +		    && (!(elem->list_of_syscall[i].sys_flags &
> > > +		    TRACE_INDIRECT_SUBCALL))) {
> > > +			if (impl_buf == IMPL_int)
> > > +				impl_buf = IMPL_int_ext;
> > > +			else
> > > +				impl_buf = IMPL_ext;
> > > +		}
> > > +	}
> > > +	return impl_buf;
> > > +}
> > For this, I think some generator similar to ioctlsort could be used,
> > which allows generating list of ID's of syscalls on different
> > architectures. Or simple wrapper for generate_sen.h, which allows
> > accessing them vis SEN_<arch>_<syscall> constants.
> To get rid of strcmp as I understand?
Yes.




More information about the Strace-devel mailing list