How to stop logging in dmesg (kernel ring buffer)?

76 views
Skip to first unread message

Girish Bopaiah

unread,
Jun 1, 2022, 12:54:46 PM6/1/22
to inside_linux
Hi All,

The below code fills up the log file  dmesg 


drivers/usb/host/ehci-q.c  (qh_completions())

ehci_dbg(ehci,

  "detected XactErr len %zu/%zu retry %d\n",

  qtd->length - QTD_LENGTH(token), qtd->length, qh->xacterrs);


The problem is,  it fills up the swlog .

 

My log levels are as below

cat /proc/sys/kernel/printk

4       3       1       4

 

The severity in code is ehci_dbg which is debug(7)

 

May I know why still the logs are printed in swlog/dmesg?

How to stop it from printing in swlog ?

 

--
Regards,
Girish

Anil Kumar Pugalia

unread,
Jun 2, 2022, 5:41:16 AM6/2/22
to inside...@googlegroups.com

Console log level is to decide whether to print on console or not. Everything will always go to the ring buffer.

Regards
Anil
Passion: http://sysplay.in (Playing with Systems)
Girish Bopaiah wrote on 01/06/22 10:24 pm:
--
You received this message because you are subscribed to the Google Groups "SysPlay's Inside Linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to inside_linux...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/inside_linux/CAPCN_%2BzdwrERC5w%2BxqTyC4tc71ctds%3Dt8wisM3AGvQzG0F2VRg%40mail.gmail.com.

Girish Bopaiah

unread,
Jun 7, 2022, 12:26:34 AM6/7/22
to inside_linux
Is there a way to stop logging to the ring buffer?  
Some logging we need only for debugging purpose and not all the time 
That is, can user control logging ?

Right now I used printk_once  to avoid ring buffer getting full.



--
Regards,
Girish

Anil Kumar Pugalia

unread,
Jun 8, 2022, 3:06:00 AM6/8/22
to inside...@googlegroups.com

That is one way. One other thing you can do is use dynamic printing, which prints only when enabled.

Regards
Anil
Passion: http://sysplay.in (Playing with Systems)
Girish Bopaiah wrote on 07/06/22 9:56 am:

Girish Bopaiah

unread,
Jun 9, 2022, 8:27:26 AM6/9/22
to inside_linux
Thank you Sir.



--
Regards,
Girish
Reply all
Reply to author
Forward
0 new messages