diff options
author | Sean Anderson <seanga2@gmail.com> | 2020-10-27 19:55:25 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2020-10-30 10:55:26 -0400 |
commit | a02f84ee9c6f42137671b74ec3bb9d159b10b7ee (patch) | |
tree | 05b1ca63f85ab40f1c47d17a8a8d51385f735d0e /include | |
parent | 3102c1d2c21762889e90ec68fd0b3ce5209528a6 (diff) | |
download | u-boot-a02f84ee9c6f42137671b74ec3bb9d159b10b7ee.zip u-boot-a02f84ee9c6f42137671b74ec3bb9d159b10b7ee.tar.gz u-boot-a02f84ee9c6f42137671b74ec3bb9d159b10b7ee.tar.bz2 |
log: Add function to create a filter with flags
This function exposes a way to specify flags when creating a filter.
Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/log.h | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/include/log.h b/include/log.h index 12293d6..ee94f14 100644 --- a/include/log.h +++ b/include/log.h @@ -477,6 +477,25 @@ enum log_fmt { int do_log_test(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]); /** + * log_add_filter_flags() - Add a new filter to a log device, specifying flags + * + * @drv_name: Driver name to add the filter to (since each driver only has a + * single device) + * @flags: Flags for this filter (LOGFF_...) + * @cat_list: List of categories to allow (terminated by %LOGC_END). If empty + * then all categories are permitted. Up to LOGF_MAX_CATEGORIES entries + * can be provided + * @max_level: Maximum log level to allow + * @file_list: List of files to allow, separated by comma. If NULL then all + * files are permitted + * @return the sequence number of the new filter (>=0) if the filter was added, + * or a -ve value on error + */ +int log_add_filter_flags(const char *drv_name, enum log_category_t cat_list[], + enum log_level_t max_level, const char *file_list, + int flags); + +/** * log_add_filter() - Add a new filter to a log device * * @drv_name: Driver name to add the filter to (since each driver only has a @@ -490,8 +509,14 @@ int do_log_test(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]); * @return the sequence number of the new filter (>=0) if the filter was added, * or a -ve value on error */ -int log_add_filter(const char *drv_name, enum log_category_t cat_list[], - enum log_level_t max_level, const char *file_list); +static inline int log_add_filter(const char *drv_name, + enum log_category_t cat_list[], + enum log_level_t max_level, + const char *file_list) +{ + return log_add_filter_flags(drv_name, cat_list, max_level, file_list, + 0); +} /** * log_remove_filter() - Remove a filter from a log device |