From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jiri Olsa Subject: [PATCH 1/3] dwarves print: Fix holes accounting Date: Tue, 8 Dec 2015 23:47:04 +0100 Message-ID: <1449614826-2278-2-git-send-email-jolsa@kernel.org> References: <1449614826-2278-1-git-send-email-jolsa@kernel.org> Return-path: In-Reply-To: <1449614826-2278-1-git-send-email-jolsa-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> Sender: dwarves-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Arnaldo Carvalho de Melo Cc: Joe Mario , dwarves-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: dwarves@vger.kernel.org Sometimes the hole could be missing, try to bypass this issue by comparing last and current offsets. Signed-off-by: Jiri Olsa --- 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; + } + 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-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html