Commit graph

9 commits

Author SHA1 Message Date
Nick Kralevich
5db8d6aafa logging: avoid unnecessary printfs
Don't spend CPU cycles formatting a bunch of strings if we're
just going to throw them away later. Maybe make booting faster.

Change-Id: I4d8eb99fb3fa873ca91cf776933d0ad01988abf5
2016-01-16 16:20:24 -08:00
Nick Kralevich
7eb3abdb3b klog: don't unconditionally call mknod()
If /dev/kmsg already exists, it's unnecessary for klog_init()
to create it's own copy. This avoids needing to grant the mknod
permission to everyone who uses kmsg. Typically the only time
/dev/kmsg doesn't exist is before ueventd starts.

(cherrypicked from commit 4d32a486fe)

Bug: 21242418
Change-Id: I0c88d80feca6899fcdbc8c9f2f99448ee0a3422d
2015-05-19 15:19:25 -07:00
Elliott Hughes
c02f81cccb Always unlink /dev/__kmsg__.
Whether the open succeeds or fails, we should unlink.

Change-Id: Ic2f1e10dc7b6d6e459c56049da00d165bd63ba8f
2015-03-28 09:51:54 -07:00
Elliott Hughes
da40c00137 Log more timing information from init.
Also make important events in init's life NOTICE rather than INFO,
and ensure that NOTICE events actually make it to the kernel log.

Also fix the logging so that if you have a printf format string
error, the compiler now catches it.

Also give messages from init, ueventd, and watchdogd distinct tags.
(Previously they'd all call themselves "init", and dmesg doesn't
include pids, so you couldn't untangle them.)

Also include the tag in SELinux messages.

Bug: 19544788
Change-Id: Ica6daea065bfdb80155c52c0b06f346a7df208fe
2015-03-28 00:25:22 -07:00
Alex Ray
157e1b645a libcutils: add method to get klog level
Change-Id: I55e8311bae97703be26e57b415a8ab0a6d9b4361
2014-03-07 13:58:02 -08:00
Stephen Smalley
eb3f421e02 Enable building init with -Wall -Werror.
Eliminates various warnings from SELinux-related code.

Bug: 12587913
Change-Id: I28921f0ebd934324436609540d95ccef58552b64
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2014-02-19 09:15:09 -05:00
Todd Poynor
451a6ba829 klog: error handling fixups
Change-Id: I9014e62010c589ec30d5e99eef420353e35418b5
2013-04-22 11:07:14 -07:00
Ken Sumrall
7425fd1b23 klog: Have klog_write() call klog_init() if needed
Also change klog_init() to do nothing if already initialized.

Change-Id: Ia2dfe914c9d9fd119fb8939508d57b15c9884663
2013-04-11 20:03:47 -07:00
Dima Zavin
8f91282ebe init/cutils: move kernel logging interface to libcutils from init
Change-Id: Ia0f91b1fcd6cae69d76bf3dd841340958db938a8
Signed-off-by: Dima Zavin <dima@android.com>
2011-09-02 12:11:17 -07:00