All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v3 00/14] log: Add a new logging feature
@ 2017-11-20 22:33 Simon Glass
  2017-11-20 22:33 ` [U-Boot] [PATCH v3 01/14] Revert "sandbox: remove os_putc() and os_puts()" Simon Glass
                   ` (13 more replies)
  0 siblings, 14 replies; 29+ messages in thread
From: Simon Glass @ 2017-11-20 22:33 UTC (permalink / raw)
  To: u-boot

U-Boot currently has fairly rudimentary logging features. A basic printf()
provides console output and debug() provides debug output which is
activated if DEBUG is defined in the file containing the debug()
statements.

It would be useful to have a few more features:

- control of debug output at runtime, so  problems can potentially be
debugged without recompiling U-Boot
- control of which subsystems output debug information, so that (for
example) it is possible to enable debugging for MMC or SATA at runtime
- indication of severity with each message, so that the user can control
whether just errors are displayed, warnings, or all debug messages
- sending logging information to different destinations, such as console,
memory, linux, etc,

At present U-Boot has a logbuffer feature which records output in a memory
buffer for later display or storage. This is useful but is not at present
enabled for any board.

This series introduced a new logging system which supports:
- various log levels from panic to debug
- log categories including all uclasses and a few others
- log drivers to which all log records can be sent
- log filters which control which log records make it to which drivers

Enabling logging with the default options does not add much to code size.
By default the maximum recorded log level is LOGL_INFO, meaning that debug
messages (and above) are discarded a build-time. Increasing this level
provides more run-time flexibility to enable/disable logging at the cost
of increased code size.

This feature is by no means finished. The README provides a long list of
features and clean-ups that could be done. But hopefully this is a
starting point for improving this important area in U-Boot.

The series is available at u-boot-dm/log-working

Changes in v3:
- Rebase to master

Changes in v2:
- Add a comment as to why CONFIG_LOG_MAX_LEVEL is not defined
- Change log levels to match new header
- Change sandbox log level to 6
- Drop MAINTAINERS entries for files not added by this patch
- Drop the special log() functions from the README
- Drop the use of 'continue' in the macro
- Fix LOG_SPL_MAX_LEVEL typo (should be SPL_LOG_MAX_LEVEL)
- Fix function called when test command is selected
- Fix help output for 'log test'
- Fix up bad use of #if CONFIG_VAL() - use #ifdef instead
- Line up log levels with Linux
- Only execute log tests if CONFIG_LOG is enabled
- Rename LOGL_WARN to LOGL_WARNING
- Split pre-console address change into a separate patch
- Update commit message to explain that this is not just for serial output

Simon Glass (14):
  Revert "sandbox: remove os_putc() and os_puts()"
  sandbox: Adjust pre-console address to avoid conflict
  Revert "sandbox: Drop special case console code for sandbox"
  Move debug and logging support to a separate header
  mtdparts: Correct use of debug()
  Drop the log buffer
  log: Add an implemention of logging
  log: Add a console driver
  log: Add a 'log level' command
  log: Add a test command
  log: Plumb logging into the init sequence
  log: sandbox: Enable logging
  log: test: Add a pytest for logging
  log: Add documentation

 MAINTAINERS                       |   9 ++
 arch/sandbox/cpu/os.c             |  11 ++
 cmd/Kconfig                       |   8 +
 cmd/Makefile                      |   2 +-
 cmd/log.c                         | 326 +++++---------------------------------
 cmd/mtdparts.c                    |   3 -
 common/Kconfig                    |  86 ++++++++++
 common/Makefile                   |   2 +
 common/board_f.c                  |  23 +--
 common/board_r.c                  |  27 +---
 common/console.c                  |   7 +
 common/image.c                    |   9 --
 common/log.c                      | 245 ++++++++++++++++++++++++++++
 common/log_console.c              |  23 +++
 common/stdio.c                    |   6 -
 configs/sandbox_defconfig         |   5 +-
 doc/README.log                    | 214 +++++++++++++++++++++++++
 include/asm-generic/global_data.h |   8 +-
 include/common.h                  |  46 +-----
 include/log.h                     | 297 ++++++++++++++++++++++++++++++++++
 include/logbuff.h                 |  49 ------
 include/os.h                      |  20 +++
 include/post.h                    |   4 +-
 post/post.c                       |   9 --
 post/tests.c                      |   4 -
 scripts/config_whitelist.txt      |   1 -
 test/Makefile                     |   1 +
 test/log/Makefile                 |   7 +
 test/log/log_test.c               | 203 ++++++++++++++++++++++++
 test/py/tests/test_log.py         | 101 ++++++++++++
 30 files changed, 1294 insertions(+), 462 deletions(-)
 create mode 100644 common/log.c
 create mode 100644 common/log_console.c
 create mode 100644 doc/README.log
 create mode 100644 include/log.h
 delete mode 100644 include/logbuff.h
 create mode 100644 test/log/Makefile
 create mode 100644 test/log/log_test.c
 create mode 100644 test/py/tests/test_log.py

-- 
2.15.0.448.gf294e3d99a-goog

^ permalink raw reply	[flat|nested] 29+ messages in thread

end of thread, other threads:[~2018-04-02  8:43 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-20 22:33 [U-Boot] [PATCH v3 00/14] log: Add a new logging feature Simon Glass
2017-11-20 22:33 ` [U-Boot] [PATCH v3 01/14] Revert "sandbox: remove os_putc() and os_puts()" Simon Glass
2017-11-20 22:33 ` [U-Boot] [PATCH v3 02/14] sandbox: Adjust pre-console address to avoid conflict Simon Glass
2017-11-20 22:33 ` [U-Boot] [PATCH v3 03/14] Revert "sandbox: Drop special case console code for sandbox" Simon Glass
2017-11-20 22:33 ` [U-Boot] [PATCH v3 04/14] Move debug and logging support to a separate header Simon Glass
2017-11-21  9:41   ` Lukasz Majewski
2017-11-20 22:33 ` [U-Boot] [PATCH v3 05/14] mtdparts: Correct use of debug() Simon Glass
2017-11-20 22:33 ` [U-Boot] [PATCH v3 06/14] Drop the log buffer Simon Glass
2017-11-20 22:33 ` [U-Boot] [PATCH v3 07/14] log: Add an implemention of logging Simon Glass
2017-11-21  9:55   ` Lukasz Majewski
2017-11-24  1:49     ` Simon Glass
2017-11-20 22:33 ` [U-Boot] [PATCH v3 08/14] log: Add a console driver Simon Glass
2017-11-21  9:57   ` Lukasz Majewski
2017-11-20 22:33 ` [U-Boot] [PATCH v3 09/14] log: Add a 'log level' command Simon Glass
2017-11-21  9:58   ` Lukasz Majewski
2017-11-20 22:33 ` [U-Boot] [PATCH v3 10/14] log: Add a test command Simon Glass
2017-11-21 10:00   ` Lukasz Majewski
2017-11-30  3:35   ` [U-Boot] [U-Boot,v3,10/14] " Tom Rini
2017-11-30 16:27     ` Simon Glass
2017-11-30 16:38       ` Tom Rini
2017-11-20 22:33 ` [U-Boot] [PATCH v3 11/14] log: Plumb logging into the init sequence Simon Glass
2017-11-21 10:01   ` Lukasz Majewski
2017-11-20 22:33 ` [U-Boot] [PATCH v3 12/14] log: sandbox: Enable logging Simon Glass
2017-11-21 10:01   ` Lukasz Majewski
2017-11-20 22:33 ` [U-Boot] [PATCH v3 13/14] log: test: Add a pytest for logging Simon Glass
2017-11-21 10:03   ` Lukasz Majewski
2017-11-20 22:33 ` [U-Boot] [PATCH v3 14/14] log: Add documentation Simon Glass
2017-11-21 10:19   ` Lukasz Majewski
2018-04-02  8:43     ` Simon Glass

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.