On Wed, Apr 23, 2025 at 10:30 AM Vladimir 'phcoder' Serbinenko < phco...@gmail.com> wrote:
> > > Le mer. 23 avr. 2025, 01:39, Leo Sandoval <lsand...@redhat.com> a écrit : > >> >> >> On Tue, Apr 15, 2025 at 9:28 AM Vladimir 'phcoder' Serbinenko < >> phco...@gmail.com> wrote: >> >>> What is the code size increase on i386-pc? Did you test it? This is >>> likely to result in a big one >>> >> >> I did not test the binary size impact but du'ing does not show >> much degradation (around 24kb increase) on my fedora box >> > > The size of modules is mostly irrelevant. What matters are the core sizes. > ./grub-mkimage -O i386-pc -p /boot/grub -o core.img biosdisk part_msdos > ext2 > Resulting core has to be under 31K for all the filesystems (replace ext2 > with different FS) except btrfs and zfs > Thanks for the pointers. These are the sizes then -rw-r--r--. 1 root root 34K Apr 23 20:19 core-no-function-name.img -rw-r--r--. 1 root root 35K Apr 23 20:20 core-with-function-name.img <--- (or in bytes -rw-r--r--. 1 root root 34524 Apr 23 20:19 core-no-function-name.img -rw-r--r--. 1 root root 34870 Apr 23 20:20 core-with-function-name.img ) so, in both cases img files are both > 31K, so is there something am I missing? I used the command you suggested, same params. >> before patch >> >> # du /boot/grub2/ >> 3404 /boot/grub2/i386-pc >> 5484 /boot/grub2/locale >> 2344 /boot/grub2/fonts >> 11252 /boot/grub2/ >> >> with patch >> >> # du /boot/grub2/ >> 3428 /boot/grub2/i386-pc >> 5484 /boot/grub2/locale >> 2344 /boot/grub2/fonts >> 11276 /boot/grub2/ >> >> >> >> >>> >>> Regards >>> Vladimir 'phcoder' Serbinenko >>> >>> Le sam. 12 avr. 2025, 01:03, Leo Sandoval via Grub-devel < >>> grub-devel@gnu.org> a écrit : >>> >>>> Together with the line number, the debug trace with the function name >>>> provides a bit more context and could be useful when inspecting log. >>>> >>>> Signed-off-by: Leo Sandoval <lsand...@redhat.com> >>>> --- >>>> grub-core/kern/misc.c | 4 ++-- >>>> include/grub/misc.h | 5 +++-- >>>> 2 files changed, 5 insertions(+), 4 deletions(-) >>>> >>>> diff --git a/grub-core/kern/misc.c b/grub-core/kern/misc.c >>>> index 2b79223935..90c71d7cea 100644 >>>> --- a/grub-core/kern/misc.c >>>> +++ b/grub-core/kern/misc.c >>>> @@ -231,14 +231,14 @@ grub_debug_enabled (const char * condition) >>>> } >>>> >>>> void >>>> -grub_real_dprintf (const char *file, const int line, const char >>>> *condition, >>>> +grub_real_dprintf (const char *file, const char *function, const int >>>> line, const char *condition, >>>> const char *fmt, ...) >>>> { >>>> va_list args; >>>> >>>> if (grub_debug_enabled (condition)) >>>> { >>>> - grub_printf ("%s:%d:%s: ", file, line, condition); >>>> + grub_printf ("%s:%s:%d:%s: ", file, function, line, condition); >>>> va_start (args, fmt); >>>> grub_vprintf (fmt, args); >>>> va_end (args); >>>> diff --git a/include/grub/misc.h b/include/grub/misc.h >>>> index e087e7b3e8..881af5ca98 100644 >>>> --- a/include/grub/misc.h >>>> +++ b/include/grub/misc.h >>>> @@ -35,7 +35,7 @@ >>>> #define ARRAY_SIZE(array) (sizeof (array) / sizeof (array[0])) >>>> #define COMPILE_TIME_ASSERT(cond) switch (0) { case 1: case !(cond): ; >>>> } >>>> >>>> -#define grub_dprintf(condition, ...) grub_real_dprintf(GRUB_FILE, >>>> __LINE__, condition, __VA_ARGS__) >>>> +#define grub_dprintf(condition, ...) grub_real_dprintf(GRUB_FILE, >>>> __FUNCTION__, __LINE__, condition, __VA_ARGS__) >>>> >>>> void *EXPORT_FUNC(grub_memmove) (void *dest, const void *src, >>>> grub_size_t n); >>>> char *EXPORT_FUNC(grub_strcpy) (char *dest, const char *src); >>>> @@ -410,9 +410,10 @@ grub_puts (const char *s) >>>> int EXPORT_FUNC(grub_puts_) (const char *s); >>>> int EXPORT_FUNC(grub_debug_enabled) (const char *condition); >>>> void EXPORT_FUNC(grub_real_dprintf) (const char *file, >>>> + const int function, >>>> const int line, >>>> const char *condition, >>>> - const char *fmt, ...) >>>> __attribute__ ((format (GNU_PRINTF, 4, 5))); >>>> + const char *fmt, ...) >>>> __attribute__ ((format (GNU_PRINTF, 5, 6))); >>>> int EXPORT_FUNC(grub_printf) (const char *fmt, ...) __attribute__ >>>> ((format (GNU_PRINTF, 1, 2))); >>>> int EXPORT_FUNC(grub_printf_) (const char *fmt, ...) __attribute__ >>>> ((format (GNU_PRINTF, 1, 2))); >>>> int EXPORT_FUNC(grub_vprintf) (const char *fmt, va_list args); >>>> -- >>>> 2.48.1 >>>> >>>> >>>> _______________________________________________ >>>> Grub-devel mailing list >>>> Grub-devel@gnu.org >>>> https://lists.gnu.org/mailman/listinfo/grub-devel >>>> >>>
_______________________________________________ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel