Re: [PATCH 1/3] dwarves print: Fix holes accounting

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Em Wed, Dec 16, 2015 at 02:58:39PM -0300, Arnaldo Carvalho de Melo escreveu:
> Em Tue, Dec 08, 2015 at 11:47:04PM +0100, Jiri Olsa escreveu:
> > Sometimes the hole could be missing, try to bypass
> > this issue by comparing last and current offsets.
> 
> Can you provide an example of before and after this change? What real
> case triggered this?
> 
> - Arnaldo
>  
> > Signed-off-by: Jiri Olsa <jolsa@xxxxxxxxxx>
> > ---
> >  dwarves_fprintf.c | 11 +++++++++++
> >  1 file changed, 11 insertions(+)
> > 
> > diff --git a/dwarves_fprintf.c b/dwarves_fprintf.c
> > index 71d8ce9f982b..df80af255c67 100644
> > --- a/dwarves_fprintf.c
> > +++ b/dwarves_fprintf.c
> > @@ -1268,6 +1268,17 @@ size_t class__fprintf(struct class *class, const struct cu *cu,
> >  		}
> >  		pos = tag__class_member(tag_pos);
> >  
> > +		/*
> > +		 * Sometimes the hole could be missing, try to bypass
> > +		 * this issue by comparing last and current offsets.
> > +		 */
> > +		if (last) {
> > +			uint32_t tmp = last->byte_offset + last->byte_size + last->hole;
> > +
> > +			if (pos->byte_offset > tmp)
> > +				sum_holes += pos->byte_offset - tmp;
> > +		}
> > +

I mean, how could this be? last->hole then would have been wrong,
miscalculated, looking at where it is calculated now...

- arnaldo

> >  		if (last != NULL &&
> >  		    pos->byte_offset != last->byte_offset &&
> >  		    !cconf.suppress_comments)
> > -- 
> > 2.4.3
> > 
> > --
> > To unsubscribe from this list: send the line "unsubscribe dwarves" in
> > the body of a message to majordomo@xxxxxxxxxxxxxxx
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe dwarves" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux