[PATCH 2/2] remove tcp->parent and TCB_CLONE_THREAD

Denys Vlasenko dvlasenk at redhat.com
Wed Aug 17 13:43:55 UTC 2011


On Tue, 2011-08-02 at 01:55 +0400, Dmitry V. Levin wrote:
> On Sat, Jun 25, 2011 at 11:34:41AM +0200, Denys Vlasenko wrote:
> > +#ifdef LINUX
> > +/* Temporarily hijack this bit to mark tcb's we already attached */
> > +# define TCB_ATTACH_DONE TCB_INSYSCALL
> 
> We are not short of unused flags yet to apply such tricks, and your patch
> series makes even more room for future flags allocation.

I switched it from a hack to a normal flag.

> > +#else
> > +# define TCB_ATTACH_DONE 0
> 
> And this is not needed anyway, see below.
> 
> > @@ -537,6 +540,15 @@ startup_attach(void)
> >  				tcp->pid);
> >  	} /* for each tcbtab[] */
> >  
> > + ret:
> > +	if (TCB_ATTACH_DONE) {
> > +		for (tcbi = 0; tcbi < tcbtabsize; tcbi++) {
> > +			tcp = tcbtab[tcbi];
> > +			tcp->flags &= ~TCB_ATTACH_DONE;
> > +		}
> > +	}
> > +#undef TCB_ATTACH_DONE
> > +
> 
> This new hunk should be wrapped with #ifdef LINUX, and the check for
> TCB_ATTACH_DONE != 0 could be safely omitted.

Ok.

Committed with the above changes.

-- 
vda






More information about the Strace-devel mailing list