1
0
Fork 0
Commit graph

4 commits

Author SHA1 Message Date
Ondřej Lysoněk
6c1df704ce tuned-adm: Print log excerpt when changing profile
Print messages logged during a profile switch to stderr (this affects
the "profile" and "auto_profile" commands). By default messages with
log level ERROR and higher are printed. This can be changed using the
--loglevel command line option. Valid values are debug, info, warn,
error, console, none ('none' can be used to disable the log printing).
E.g.:
tuned-adm --loglevel info profile powersave

Log printing cannot be used when --async is used.

Resolves: rhbz#1538745

Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
2018-06-11 09:56:14 +02:00
Ondřej Lysoněk
829c7de36c Support sending logs over DBus
Add two DBus calls:
log_capture_start(log_level, timeout)
 * This will instruct Tuned to create a new log handler, which will
   start writing log messages with level 'log_level' and higher to
   a buffer. The log levels are standard Python log levels (e.g.
   logging.INFO) or Tuned's custom log level LOG_LEVEL_CONSOLE which
   is defined as 60. The handler will be destroyed after 'timeout' seconds
   if contents of the buffer are not collected using log_capture_finish()
   before the timeout. If 'timeout' <= 0, log messages will be collected
   for as long as it takes before log_capture_finish() is called (use
   with care, so that you don't fill up memory with Tuned logs). This
   call returns a string ID of the log handler, a token, which should
   be passed to log_capture_finish().

log_capture_finish(token)
 * This will return (as a string) log messages collected by a log handler
   associated with the 'token'. It will also destroy the log handler.

These calls are privileged. They can only be called by the root user or
by a user logged in on a local console (just like the change-profile DBus
calls). This restriction is meant to prevent ordinary users from forcing
Tuned to allocate an insane amount of memory for the log buffers and crash
it (or other processes). In the future we may wish to replace this
restriction with a configurable policy which determines how many (and how
big) log buffers can a user with a given UID create. We may also want to
destroy the log handler when the original caller disconnects from DBus.

Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
2018-06-11 09:23:20 +02:00
Jan Vcelak
fead260bc3 first stable 2.0 release 2012-03-30 14:37:17 +02:00
Jan Vcelak
42241cd8c9 TODO file 2012-03-12 17:53:14 +01:00