Author Topic: Incredible amounts of kernel logs  (Read 4026 times)

DonOregano

  • Newbie
  • *
  • Posts: 24
    • View Profile
Incredible amounts of kernel logs
« on: July 07, 2018, 03:40:11 pm »
The amount of logs generated by the kernel in TP1 & TP2 is astounding. Is there any way to turn off or reduce these logs? They make the system log difficult to use for debugging other things...

Kiriririn

  • Jr. Member
  • **
  • Posts: 66
    • View Profile
Incredible amounts of kernel logs
« Reply #1 on: July 07, 2018, 06:16:30 pm »
You can install systemd from stretch-backports, and then set ReadKMsg=no (I think that setting may already be in place by default)

Murple2

  • Full Member
  • ***
  • Posts: 137
    • View Profile
Incredible amounts of kernel logs
« Reply #2 on: July 08, 2018, 04:00:21 am »
You should be able to
Code: [Select]
cat /proc/sys/kernel/printk w x y z
where you substitute the letters for the desired numbers below

0 - emergency              
1 - alert          
2 - critical  
3 - error  
4 - warning
5 - notice
6 - informational
7 - debug

Or you can put quiet in your kernel command line (or loglevel=X)

Or you can
Code: [Select]
sudo dmesg -n 1 or dmesg -D  (off) and dmesg -E (on) to toggle console messages  on/off

Or you create / edit /etc/sysctl.conf and add
Code: [Select]
kernel.printk = w x y z substituting the numbers from above.

Quote from: Kiriririn
You can install systemd from stretch-backports, and then set ReadKMsg=no (I think that setting may already be in place by default)

I wouldn't install systemd just to get functionality that already exists several times over. But if you do then be aware that recent versions of systemd no longer read /etc/sysctl.conf and look in /etc/sysctl.d/*.conf
« Last Edit: July 08, 2018, 04:17:27 am by Murple2 »

Kiriririn

  • Jr. Member
  • **
  • Posts: 66
    • View Profile
Incredible amounts of kernel logs
« Reply #3 on: July 08, 2018, 07:14:28 am »
Quote from: Murple2
You should be able to
Code: [Select]
cat /proc/sys/kernel/printk w x y z
where you substitute the letters for the desired numbers below

0 - emergency              
1 - alert          
2 - critical  
3 - error  
4 - warning
5 - notice
6 - informational
7 - debug

Or you can put quiet in your kernel command line (or loglevel=X)

Or you can
Code: [Select]
sudo dmesg -n 1 or dmesg -D  (off) and dmesg -E (on) to toggle console messages  on/off

Or you create / edit /etc/sysctl.conf and add
Code: [Select]
kernel.printk = w x y z substituting the numbers from above.

Quote from: Kiriririn
You can install systemd from stretch-backports, and then set ReadKMsg=no (I think that setting may already be in place by default)

I wouldn't install systemd just to get functionality that already exists several times over. But if you do then be aware that recent versions of systemd no longer read /etc/sysctl.conf and look in /etc/sysctl.d/*.conf

All of those only affect what is printed to TTYs, which in this case would be the serial console

It's not clear whether the OP is referring to that, to dmesg, or to the systemd journal
« Last Edit: July 08, 2018, 07:16:10 am by Kiriririn »

Murple2

  • Full Member
  • ***
  • Posts: 137
    • View Profile
Incredible amounts of kernel logs
« Reply #4 on: July 08, 2018, 01:07:18 pm »
Quote from: Kiriririn
Quote from: Murple2
You should be able to
Code: [Select]
cat /proc/sys/kernel/printk w x y z
where you substitute the letters for the desired numbers below

0 - emergency              
1 - alert          
2 - critical  
3 - error  
4 - warning
5 - notice
6 - informational
7 - debug

Or you can put quiet in your kernel command line (or loglevel=X)

Or you can
Code: [Select]
sudo dmesg -n 1 or dmesg -D  (off) and dmesg -E (on) to toggle console messages  on/off

Or you create / edit /etc/sysctl.conf and add
Code: [Select]
kernel.printk = w x y z substituting the numbers from above.

Quote from: Kiriririn
You can install systemd from stretch-backports, and then set ReadKMsg=no (I think that setting may already be in place by default)

I wouldn't install systemd just to get functionality that already exists several times over. But if you do then be aware that recent versions of systemd no longer read /etc/sysctl.conf and look in /etc/sysctl.d/*.conf

All of those only affect what is printed to TTYs, which in this case would be the serial console

It's not clear whether the OP is referring to that, to dmesg, or to the systemd journal

I'm guessing systemd journal isn't installed seeing as you are suggesting the OP installs systemd. Your suggestion just disables kernel messages within the journald, which probably isn't what the OP wanted (particularly if it isn't even installed!).  I also think my suggestions would suppress messages to other programs (eg journald) and not just the TTYs as you assert. (OK I admit, some of the suggestions not all)

Edit : Sorry,, I've given up smoking and I'm a little tetchy...
« Last Edit: July 08, 2018, 01:24:14 pm by Murple2 »

DonOregano

  • Newbie
  • *
  • Posts: 24
    • View Profile
Incredible amounts of kernel logs
« Reply #5 on: July 11, 2018, 06:30:52 am »
Well, to clarify what I was after, I wanted to be able to use dmesg -w without getting drowned in stuff, and journalctl -f without getting inundated.
On a "normal" debian system I have never had these amounts of logs. Also I was thinking that with the amount of logging there must be a little too much disk access being generated, which would reduce battery life...

mithrandir

  • Full Member
  • ***
  • Posts: 193
    • View Profile
    • http://www.mygnu.de
Incredible amounts of kernel logs
« Reply #6 on: July 11, 2018, 06:43:55 am »
Quote from: DonOregano
Well, to clarify what I was after, I wanted to be able to use dmesg -w without getting drowned in stuff, and journalctl -f without getting inundated.
On a "normal" debian system I have never had these amounts of logs. Also I was thinking that with the amount of logging there must be a little too much disk access being generated, which would reduce battery life...
I think the journal does not get persisted. At least journalctl -b1 tells "no persisted journal was found". So there should be no disk access. However, the exessive logging at least generates some CPU usage which consumes a bit battery.
« Last Edit: July 11, 2018, 06:45:13 am by mithrandir »

Kiriririn

  • Jr. Member
  • **
  • Posts: 66
    • View Profile
Incredible amounts of kernel logs
« Reply #7 on: July 11, 2018, 08:45:06 am »
Quote from: DonOregano
Well, to clarify what I was after, I wanted to be able to use dmesg -w without getting drowned in stuff, and journalctl -f without getting inundated.
On a "normal" debian system I have never had these amounts of logs. Also I was thinking that with the amount of logging there must be a little too much disk access being generated, which would reduce battery life...

My above suggestion hides kernel logs from journalctl, but doesn't help with dmesg. In my kernel fork you can find a couple of commits that hack out the worst offenders https://github.com/lukefor/gemini-linux-kernel-3.18

You may also want to disable logd, which is the worst for CPU usage - see https://www.oesf.org/forum/index.php?showtopic=35245
« Last Edit: July 11, 2018, 08:46:35 am by Kiriririn »