Re: [PATCH 06/16] dyndbg: fix overcounting of ram used by dyndbg

From: Rasmus Villemoes
Date: Tue Oct 29 2019 - 16:47:46 EST


On 29/10/2019 21.00, Jim Cromie wrote:
> during dyndbg init, verbose logging prints its ram overhead. But it
> counted strlens of all ddebug callsite entries, which are full of
> pointers into shared __dyndbg memory, and shouldnt be counted at all
> (since theyre already in the __dyndbg section)

Hm. I agree we're probably overcounting, but the strings themselves do
not live in __dyndbg, but in .rodata. It's true that __FILE__ (and maybe
in a few cases ->format) get's deduplicated and by the nature of
__func__, ->function points at a unique-per-function string.

So I think the commit log is a bit misleading. However, I think the
patch is a good idea anyway: avoiding 4N strlen() calls during boot is a
good thing. And if anybody wants to know how much memory is used by the
pointed-to-strings, well, "wc dynamic_debug/control" should give an idea.

Rasmus