Hi Janusz,
> Hi Krzysztof,
>
> Thanks for looking at this.
>
> On Thursday, 8 January 2026 09:58:34 CET Krzysztof Karas wrote:
> > Hi Janusz,
> >
> > [...]
> >
> > > + FILE *printk = fopen("/proc/sys/kernel/printk", "r+");
> > > + int console_log_level, default_log_level;
> > > + unsigned int i;
> > > +
> > > + if (!igt_debug_on(!printk)) {
> > > + if (!igt_debug_on(fscanf(printk, "%d %d",
> > > + &console_log_level,
> > > + &default_log_level) != 2) &&
> > > + default_log_level < 6) {
> > > + rewind(printk);
> > > + igt_debug_on(fprintf(printk, "%d 6",
> > > + console_log_level) != 3);
> > Will this not erase the remaining two values held in printk
> > file? I mean "minimmum" and "boot-time-default".
>
> No, it won't, see
> https://www.kernel.org/doc/Documentation/core-api/printk-basics.rst.
> There you can find an example of only the first element written.
> I've also verified the same rule applies when writing two elements.
You are right, sorry for doubting your solution without prior
verification. I also played with the printk file and it works
as you claim, so I do not have other issues.
Reviewed-by: Krzysztof Karas <[email protected]>
--
Best Regards,
Krzysztof