View previous topic :: View next topic |
Author |
Message |
legacy Tux's lil' helper
Joined: 10 Sep 2012 Posts: 144
|
Posted: Thu Jul 04, 2013 3:13 pm Post subject: how to remove what between "[" .. "]" in |
|
|
Hi
i have a 3.4.13 kernel which is annoying me with timestamp between "[" .. "]", i have removed the CONFIG_PRINTK_TIME -> kernel/printk.c, but i am still having this dmesg
Code: |
[ 3.867299] Bluetooth: RFCOMM socket layer initialized
[ 3.867416] Bluetooth: RFCOMM ver 1.11
[ 3.867519] Bluetooth: HIDP (Human Interface Emulation) ver 1.2
[ 3.867637] Bluetooth: HIDP socket layer initialized
[ 3.868222] Using IPI No-Shortcut mode
[ 3.868634] PM: Hibernation image not present or could not be loaded.
[ 3.868641] registered taskstats version 1
[ 3.870378] ALSA device list:
[ 3.870494] #0: HDA NVidia at 0xd3480000 irq 22
[ 3.923858] kjournald starting. Commit interval 5 seconds
[ 3.923914] EXT3-fs (sda3): mounted filesystem with ordered data mode
[ 3.923926] VFS: Mounted root (ext3 filesystem) readonly on device 8:3.
[ 3.931409] apple 0003:05AC:8242.0001: hiddev0,hidraw0: USB HID v1.11 Device [Apple Computer, Inc. IR Receiver] on usb-0000:00:04.0-5/input0
[ 3.957974] devtmpfs: mounted
|
How to remove [%lu.%lu] ??? |
|
Back to top |
|
|
aCOSwt Bodhisattva
Joined: 19 Oct 2007 Posts: 2537 Location: Hilbert space
|
Posted: Thu Jul 04, 2013 3:23 pm Post subject: Re: how to remove what between "[" .. "]" |
|
|
legacy wrote: | How to remove [%lu.%lu] ??? |
_________________
|
|
Back to top |
|
|
legacy Tux's lil' helper
Joined: 10 Sep 2012 Posts: 144
|
Posted: Fri Jul 05, 2013 1:13 pm Post subject: |
|
|
yes, but is it possible to remove it from the kernel support ? In case which option is it ? |
|
Back to top |
|
|
TomWij Retired Dev
Joined: 04 Jul 2012 Posts: 1553
|
Posted: Fri Jul 05, 2013 3:35 pm Post subject: |
|
|
CONFIG_PRINTK_TIME indeed does; sounds to me you are adding support for it in another place, perhaps the kernel command line. |
|
Back to top |
|
|
legacy Tux's lil' helper
Joined: 10 Sep 2012 Posts: 144
|
Posted: Fri Jul 05, 2013 7:25 pm Post subject: |
|
|
cat /proc/cmdline
root=/dev/sda3 root=/dev/sda3 CONSOLE=/dev/tty1 |
|
Back to top |
|
|
aCOSwt Bodhisattva
Joined: 19 Oct 2007 Posts: 2537 Location: Hilbert space
|
Posted: Sat Jul 06, 2013 5:46 pm Post subject: |
|
|
Unselecting CONFIG_PRINTK_TIME does indeed prevent the kernel to provide the timestamp but will obviously not prevent your logging system (sys/meta/whatever-log) to add its own one.
(Far less accurate than kernel's one of course).
Which makes dmesg --notime, the only practical answer to your original question (How to remove [%lu.%lu] in dmesg???) _________________
|
|
Back to top |
|
|
TomWij Retired Dev
Joined: 04 Jul 2012 Posts: 1553
|
Posted: Sat Jul 06, 2013 6:06 pm Post subject: |
|
|
Indeed, and if you are bothered by having to type the parameter you could add something like this to ~/.bashrc (translate if you use a different shell):
Quote: | alias dmesg="dmesg --notime" |
|
|
Back to top |
|
|
legacy Tux's lil' helper
Joined: 10 Sep 2012 Posts: 144
|
Posted: Fri Jul 12, 2013 10:22 pm Post subject: |
|
|
so dmesg is only filtering what between "[" and ']'. Who is adding the timestamp ? You have said the logger, is it possible to hack it ? |
|
Back to top |
|
|
legacy Tux's lil' helper
Joined: 10 Sep 2012 Posts: 144
|
Posted: Fri Jul 12, 2013 10:27 pm Post subject: |
|
|
the kernel is putting log into /dev/kmsg, i see it adds something to every line, how to remove it ? should i hack the kernel ? |
|
Back to top |
|
|
legacy Tux's lil' helper
Joined: 10 Sep 2012 Posts: 144
|
Posted: Fri Jul 12, 2013 10:42 pm Post subject: |
|
|
Code: |
config PRINTK_TIME
bool "Show timing information on printks"
depends on PRINTK
help
Selecting this option causes time stamps of the printk()
messages to be added to the output of the syslog() system
call and at the console.
The timestamp is always recorded internally, and exported
to /dev/kmsg. This flag just specifies if the timestamp should
be included, not that the timestamp is recorded.
The behavior is also controlled by the kernel command line
parameter printk.time=1. See Documentation/kernel-parameters.txt
|
|
|
Back to top |
|
|
legacy Tux's lil' helper
Joined: 10 Sep 2012 Posts: 144
|
Posted: Fri Jul 12, 2013 10:47 pm Post subject: |
|
|
kernel/printk.c
Code: |
...
* The 'struct log' buffer header must never be directly exported to
* userspace, it is a kernel-private implementation detail that might
* need to be changed in the future, when the requirements change.
*
* /dev/kmsg exports the structured data in the following line format:
* "level,sequnum,timestamp;<message text>\n"
*
* The optional key/value pairs are attached as continuation lines starting
* with a space character and terminated by a newline. All possible
* non-prinatable characters are escaped in the "\xff" notation.
*
* Users of the export format should ignore possible additional values
* separated by ',', and find the message after the ';' character.
|
|
|
Back to top |
|
|
666threesixes666 Veteran
Joined: 31 May 2011 Posts: 1248 Location: 42.68n 85.41w
|
Posted: Fri Jul 12, 2013 11:24 pm Post subject: |
|
|
sed is a stream editor, you want to edit the contents of your brackets out of your stream..... ie. pipe dmesg through sed.
Code: |
dmesg | sed -e 's/\[[^][]*\]//g'
|
|
|
Back to top |
|
|
aCOSwt Bodhisattva
Joined: 19 Oct 2007 Posts: 2537 Location: Hilbert space
|
Posted: Sat Jul 13, 2013 9:02 am Post subject: |
|
|
legacy wrote: | so dmesg is only filtering what between "[" and ']'. Who is adding the timestamp ? You have said the logger, is it possible to hack it ? |
The rfc5424 does not exactly appear to me as belonging to the april's joke category of rfcs.
So... feel free... to be on your own. _________________
|
|
Back to top |
|
|
legacy Tux's lil' helper
Joined: 10 Sep 2012 Posts: 144
|
Posted: Sat Jul 13, 2013 11:49 pm Post subject: |
|
|
aCOSwt wrote: | legacy wrote: | so dmesg is only filtering what between "[" and ']'. Who is adding the timestamp ? You have said the logger, is it possible to hack it ? |
The rfc5424 does not exactly appear to me as belonging to the april's joke category of rfcs.
So... feel free... to be on your own. |
Well, why should i add rules on bashrc ? why should i process the output of /dev/kmsg in order to filter the damn verbosity ? I want simpler stuff, i want a kernel that puts out clean things, also older kernel (e.g. 2.6.39) are not so verbose.
Anyway i will hack the kernel, i do not need any sys logger at all. |
|
Back to top |
|
|
|