-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lib/ukprint: Introduce libukprint #1527
Open
michpappas
wants to merge
19
commits into
unikraft:staging
Choose a base branch
from
michpappas:michpappas/feature/libukprint
base: staging
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
lib/ukprint: Introduce libukprint #1527
michpappas
wants to merge
19
commits into
unikraft:staging
from
michpappas:michpappas/feature/libukprint
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
asmdump is implemented using zydis which is not part of unikraft, so all asmdump calls are stubbed out. Signed-off-by: Michalis Pappas <[email protected]>
With asmdump removed from libukdebug, remove references from plat/ Signed-off-by: Michalis Pappas <[email protected]>
Introduce libukprint for printing and logging facilities, and migrate printing code from ukdebug. Signed-off-by: Michalis Pappas <[email protected]>
Update imported sources to match coding conventions. Checkpatch-Ignore: LONG_LINE Signed-off-by: Michalis Pappas <[email protected]>
Replace uk_printd() functions with a new UK_PRINT_KLVL severity for uk_printk(). The uk_pr_debug() helper now invokes uk_printk() with UK_PRINT_KLVL_DEBUG. This also obsoletes output redirection (CONFIG_LIBUKPRINT_REDIR). The behavior of printing debug messages when defining UK_DEBUG regardless of the configured severity is preserved, provided that LIBUKPRINT_PRINTK is selected. Checkpatch-Ignore: MACRO_ARG_REUSE Signed-off-by: Michalis Pappas <[email protected]>
Add UK_PRINT_RAW flag that causes uk_printk() functions to print without prepending output with metadata. Add UK_PRINT_KLVL_NONE pseudo-severity level that instructs the uk_printk() functions to print unconditionally of the configured severity. Checkpatch-Ignore: MACRO_ARG_REUSE Checkpatch-Ignore: LONG_LINE Signed-off-by: Michalis Pappas <[email protected]>
github-actions
bot
added
arch/arm
arch/arm64
arch/x86_64
area/arch
Unikraft Architecture
area/lib
Internal Unikraft Microlibrary
area/plat
Unikraft Patform
lang/c
Issues or PRs to do with C/C++
lib/nolibc
Only neccessary subset of libc functionality
lib/syscall_shim
lib/ukdebug
plat/common
Common to all platforms
labels
Oct 21, 2024
TBD:
|
Decouple console-specific logic and introduce logbuffer. The logbuffer is implemented as a circular buffer of variable sized objects. At Kconfig the kernel console messages can be controlled individually of the logbuffer. The verbosity option controls both kernel console mesasges and messages logged into the logbuffer. Reorganize Kconfig options to reflect this separation. The logbuffer can be printed into the console by the newly introduced function uk_print_dmesg(). Checkpatch-Ignore: COMPLEX_MACRO Checkpatch-Ignore: SPACING Checkpatch-Ignore: LONG_LINE Signed-off-by: Michalis Pappas <[email protected]>
This formalizes the convention that the kernel printing facilities do not need to be conditionally compiled. Moreover, libraries don't need to select libukprint in their config files. Checkpatch-Ignore: LINE_SPACING Signed-off-by: Michalis Pappas <[email protected]>
Provide a static ukstore entry to control the console level at runtime. The loglevel values used are defined by UK_PRINT_KLVL in print.h. Notice that the loglevel can be set via ukstore to a value less or equal to the max loglevel set in Kconfig. Signed-off-by: Michalis Pappas <[email protected]>
Update libukprint header includes. Replace hexdumpCd() with hexcumpCk(UK_PRINT_KLVL_DEBUG). Signed-off-by: Michalis Pappas <[email protected]>
Update libukprint header includes and references to printk flags. Replace hexdumpCd() with hexcumpCk(UK_PRINT_KLVL_DEBUG). Checkpatch-Ignore: CAMELCASE Signed-off-by: Michalis Pappas <[email protected]>
Update libukprint header includes. Signed-off-by: Michalis Pappas <[email protected]>
Update libukprint header includes. Signed-off-by: Michalis Pappas <[email protected]>
Update references to printk flags. Signed-off-by: Michalis Pappas <[email protected]>
Update references to printk flags. Signed-off-by: Michalis Pappas <[email protected]>
Update references to printk flags. Signed-off-by: Michalis Pappas <[email protected]>
Update printk flags. Print messages with UK_PRINT_KLVL_NONE. Signed-off-by: Michalis Pappas <[email protected]>
Map LOG_DEBUG syslog severity to UK_PRINT_KLVL_DEBUG and invoke uk_printk() similarly to the rest of severities. Signed-off-by: Michalis Pappas <[email protected]>
Update __UK_SYSCALL_PRINTD and __UK_SYSCALL_EXECENV_PRINTD to use uk_printk() instead of uk_printd(). Repalce direct calls to uk_console with uk_printk() using UK_PRINT_FLAGS_RAW. Checkpatch-Ignore: MULTISTATEMENT_MACRO_USE_DO_WHILE Checkpatch-Ignore: MACRO_ARG_REUSE Signed-off-by: Michalis Pappas <[email protected]>
michpappas
force-pushed
the
michpappas/feature/libukprint
branch
from
October 21, 2024 09:21
755a187
to
4e3115d
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
arch/arm
arch/arm64
arch/x86_64
area/arch
Unikraft Architecture
area/lib
Internal Unikraft Microlibrary
area/plat
Unikraft Patform
lang/c
Issues or PRs to do with C/C++
lib/nolibc
Only neccessary subset of libc functionality
lib/syscall_shim
lib/ukdebug
plat/common
Common to all platforms
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Prerequisite checklist
checkpatch.uk
on your commit series before opening this PR;Base target
Additional configuration
Description of changes
This series introduces
libukprint
that is entasked to handle all printing and logging facilities. The changes are summarized below:libukdebug/asmdump
is deprecated, as it relies onzydis
, and effectively was never used.uk_printk()
API and theuk_pr_
helpers are migrated fromlibukdebug
into the newly introducedlibukprint
.uk_printk()
severity level,UK_PRINT_KLVL_DEBUG
.uk_printd()
and console redirection are deprecated. Theuk_pr_debug()
helper is implemented by a call touk_printk()
withUK_PRINT_KLVL_DEBUG
. The functionality of enabling debug prints on individual files by definingUK_DEBUG
remains unchanged.uk_printk()
API is further enhanced with features that allow raw and unconditional printing. Raw printing does not prepend output with metadata and is implemented by a new flag,UK_PRINT_RAW
. Unconditional printing implements messages that appear regardless of the configured severity level and is implemented by a new pseudo-severity flagUK_PRINT_KLVL_NONE
. These features are useful for use-cases of thesyscall_shim
anduktest
.ukstore
entries are added tolibukprint
to allow derive and update the severity level at runtime. These can later be used to implement control via/proc/sys/kernel/printk
.dmesg
functionality to Unikraft via the newly introduceduk_print_dmesg()
. The logbuffer can be enabled independently of the kernel console.libukprint
are always included in the build. This formalizes convention that calls to kernel printing facilities from various libraries do not need to be conditionally compiled. Moreover, libraries do not need to selectLIBUKPRINT
in theirConfig.uk
.