lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMuHMdXSLhypYULqfCm55MQxZCwLzxBBc7mnr6OBcPaHFwh2Lw@mail.gmail.com>
Date: Thu, 3 Apr 2025 10:27:14 +0200
From: Geert Uytterhoeven <geert@...ux-m68k.org>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: Francesco Valla <francesco@...la.it>, linux-kernel@...r.kernel.org, 
	linux-embedded@...r.kernel.org, Steven Rostedt <rostedt@...dmis.org>, 
	Tim Bird <Tim.Bird@...y.com>
Subject: Re: [PATCH] init/main.c: log initcall level when initcall_debug is used

Hi Andrew,

On Thu, 3 Apr 2025 at 04:56, Andrew Morton <akpm@...ux-foundation.org> wrote:
> On Sun, 16 Mar 2025 21:50:15 +0100 Francesco Valla <francesco@...la.it> wrote:
> > When initcall_debug is specified on the command line, the start and
> > return point for each initcall is printed. However, no information on
> > the initcall level is reported.
> >
> > Add to the initcall_debug infrastructure an additional print that
> > informs when a new initcall level is entered. This is particularly
> > useful when debugging dependency chains and/or working on boot time
> > reduction.
> >
> > ...
> >
> > --- a/init/main.c
> > +++ b/init/main.c
> > @@ -1214,6 +1214,12 @@ trace_initcall_finish_cb(void *data, initcall_t fn, int ret)
> >                fn, ret, (unsigned long long)ktime_us_delta(rettime, *calltime));
> >  }
> >
> > +static __init_or_module void
> > +trace_initcall_level_cb(void *data, const char *level)
> > +{
> > +     printk(KERN_DEBUG "entering initcall level: %s\n", level);
> > +}
>
> Please review and test this fixlet:
>
> --- a/init/main.c~init-mainc-log-initcall-level-when-initcall_debug-is-used-fix
> +++ a/init/main.c
> @@ -1217,7 +1217,7 @@ trace_initcall_finish_cb(void *data, ini
>  static __init_or_module void
>  trace_initcall_level_cb(void *data, const char *level)
>  {
> -       printk(KERN_DEBUG "entering initcall level: %s\n", level);
> +       pr_debug("entering initcall level: %s\n", level);
>  }
>
>  static ktime_t initcall_calltime;

I think the "printk(KERN_DEBUG ...)" construct is intentional.
The message should be logged when "initcall_debug" is passed on
the kernel command line, while pr_debug() is a no-op unless DEBUG is
defined inside the source file.

See also the two existing users in init/main.c near
https://elixir.bootlin.com/linux/v6.13.7/source/init/main.c#L1207.

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ