summaryrefslogtreecommitdiff
path: root/cmd/log.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2025-01-26 08:10:28 -0600
committerTom Rini <trini@konsulko.com>2025-01-26 08:10:28 -0600
commit8a2a71a4eec7afdca6377ee46b1ed7e78ec692c9 (patch)
tree460b9a426fc254b7fd9f4048dabccfb54822ba02 /cmd/log.c
parent292278d6828e6c8c6ae11bc8658586d1acc411d4 (diff)
parent21de624eb89c647a21b06a5b0f5b186838be1d17 (diff)
Merge tag 'efi-2025-04-rc1-2' of https://source.denx.de/u-boot/custodians/u-boot-efi
Pull request efi-2025-04-rc1-2 Documentation: * describe creating a pflash file for qemu-system-riscv64 UEFI: * correct logging StartImage() * use LOGC_EFI consistently * reduce UEFI size if HAS_BOARD_SIZE_LIMIT=y * Update efi_run_image() to accept image and device path * Add a version of efi_binary_run() with more parameters * Move the fallback code from efi_run_image() * Pass in the required parameters from EFI bootmeth * bootmeth_efi: Support PXE booting Other: * Enable log filtering by function name
Diffstat (limited to 'cmd/log.c')
-rw-r--r--cmd/log.c42
1 files changed, 22 insertions, 20 deletions
diff --git a/cmd/log.c b/cmd/log.c
index 519ec76f3b5..64add6d8b5a 100644
--- a/cmd/log.c
+++ b/cmd/log.c
@@ -115,30 +115,27 @@ static int do_log_filter_list(struct cmd_tbl *cmdtp, int flag, int argc,
return CMD_RET_FAILURE;
}
- /* <3> < 6 > <2+1 + 7 > < 16 > < unbounded... */
- printf("num policy level categories files\n");
list_for_each_entry(filt, &ldev->filter_head, sibling_node) {
- printf("%3d %6.6s %s %-7.7s ", filt->filter_num,
- filt->flags & LOGFF_DENY ? "deny" : "allow",
+ printf("%-3d: %s %s %s\n", filt->filter_num,
+ filt->flags & LOGFF_DENY ? "DENY" : "ALLOW",
filt->flags & LOGFF_LEVEL_MIN ? ">=" : "<=",
log_get_level_name(filt->level));
if (filt->flags & LOGFF_HAS_CAT) {
- int i;
-
- if (filt->cat_list[0] != LOGC_END)
- printf("%16.16s %s\n",
- log_get_cat_name(filt->cat_list[0]),
- filt->file_list ? filt->file_list : "");
-
- for (i = 1; i < LOGF_MAX_CATEGORIES &&
- filt->cat_list[i] != LOGC_END; i++)
- printf("%21c %16.16s\n", ' ',
+ printf(" Categories:");
+ for (int i = 0;
+ i < LOGF_MAX_CATEGORIES &&
+ filt->cat_list[i] != LOGC_END;
+ ++i) {
+ printf(" %s",
log_get_cat_name(filt->cat_list[i]));
- } else {
- printf("%16c %s\n", ' ',
- filt->file_list ? filt->file_list : "");
+ }
+ printf("\n");
}
+ if (filt->file_list)
+ printf(" Files: %s\n", filt->file_list);
+ if (filt->func_list)
+ printf(" Functions: %s\n", filt->func_list);
}
return CMD_RET_SUCCESS;
@@ -151,6 +148,7 @@ static int do_log_filter_add(struct cmd_tbl *cmdtp, int flag, int argc,
bool print_num = false;
bool type_set = false;
char *file_list = NULL;
+ char *func_list = NULL;
const char *drv_name = "console";
int opt, err;
int cat_count = 0;
@@ -160,7 +158,7 @@ static int do_log_filter_add(struct cmd_tbl *cmdtp, int flag, int argc,
struct getopt_state gs;
getopt_init_state(&gs);
- while ((opt = getopt(&gs, argc, argv, "Ac:d:Df:l:L:p")) > 0) {
+ while ((opt = getopt(&gs, argc, argv, "Ac:d:Df:F:l:L:p")) > 0) {
switch (opt) {
case 'A':
#define do_type() do { \
@@ -199,6 +197,9 @@ static int do_log_filter_add(struct cmd_tbl *cmdtp, int flag, int argc,
case 'f':
file_list = gs.arg;
break;
+ case 'F':
+ func_list = gs.arg;
+ break;
case 'l':
#define do_level() do { \
if (level_set) { \
@@ -229,7 +230,7 @@ static int do_log_filter_add(struct cmd_tbl *cmdtp, int flag, int argc,
cat_list[cat_count] = LOGC_END;
err = log_add_filter_flags(drv_name, cat_count ? cat_list : NULL, level,
- file_list, flags);
+ file_list, func_list, flags);
if (err < 0) {
printf("Could not add filter (err = %d)\n", err);
return CMD_RET_FAILURE;
@@ -388,7 +389,8 @@ U_BOOT_LONGHELP(log,
"\t-d <driver> - Specify the log driver to add the filter to; defaults\n"
"\t to console\n"
"\t-D - Deny messages matching this filter; mutually exclusive with -A\n"
- "\t-f <files_list> - A comma-separated list of files to match\n"
+ "\t-f <file_list> - A comma-separated list of files to match\n"
+ "\t-F <func_list> - A comma-separated list of functions to match\n"
"\t-l <level> - Match log levels less than or equal to <level>;\n"
"\t mutually-exclusive with -L\n"
"\t-L <level> - Match log levels greather than or equal to <level>;\n"