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.

Thanks,
Janusz

> 
> > +                   } else {
> > +                           fclose(printk);
> > +                           printk = NULL;
> > +                   }
> > +           }
> > +
> > +           for (i = 0; i < regions->num_regions; i++) {
> > +                   region = &regions->regions[i];
> > +                   if (region->region.memory_class == 
> > I915_MEMORY_CLASS_DEVICE)
> > +                           igt_dynamic_f("lmem%u", 
> > region->region.memory_instance)
> > +                                   test_smem_oom(i915, ctx, region);
> > +           }
> > +
> > +           if (printk) {
> > +                   rewind(printk);
> > +                   igt_debug_on(fprintf(printk, "%d %d",
> > +                                        console_log_level,
> > +                                        default_log_level) != 3);
> > +                   fclose(printk);
> > +           }
> > +   }
> >  
> >     igt_fixture() {
> >             intel_allocator_multiprocess_stop();
> 
> 




Reply via email to