From mboxrd@z Thu Jan 1 00:00:00 1970 From: Arnaldo Carvalho de Melo Subject: Re: [PATCH 1/3] dwarves print: Fix holes accounting Date: Wed, 16 Dec 2015 15:10:20 -0300 Message-ID: <20151216181020.GE6843@kernel.org> References: <1449614826-2278-1-git-send-email-jolsa@kernel.org> <1449614826-2278-2-git-send-email-jolsa@kernel.org> <20151216175839.GB6843@kernel.org> <20151216180532.GD6843@kernel.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <20151216180532.GD6843-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> Sender: dwarves-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Jiri Olsa Cc: Joe Mario , dwarves-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: dwarves@vger.kernel.org Em Wed, Dec 16, 2015 at 03:05:32PM -0300, Arnaldo Carvalho de Melo escreveu: > 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? > > > +++ 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... Yeah, class__find_holes() should have properly calculated last->hole so that (last->byte_offset + last->byte_size + last->hole) == pos->byte_offset. - Arnaldo -- To unsubscribe from this list: send the line "unsubscribe dwarves" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html