summaryrefslogtreecommitdiff
path: root/include/log.h
diff options
context:
space:
mode:
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>2025-01-17 01:09:53 +0100
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>2025-01-26 11:06:56 +0100
commitcb43e3e427769f5dcbb1ffda155198f38fb7375c (patch)
treec1863bb5717702656d9fcf338fb37eb79ce0c036 /include/log.h
parent1daacb92757e0c2e7b5155613ad9b1334545eb86 (diff)
log: enable filtering on functions
Up to now we could only use log level, category, and file for filtering. Allow filtering on a list of functions. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Diffstat (limited to 'include/log.h')
-rw-r--r--include/log.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/include/log.h b/include/log.h
index 3f9023ae0d2..dd44badc361 100644
--- a/include/log.h
+++ b/include/log.h
@@ -500,6 +500,7 @@ enum log_filter_flags {
* @level: Maximum (or minimum, if %LOGFF_MIN_LEVEL) log level to allow
* @file_list: List of files to allow, separated by comma. If NULL then all
* files are permitted
+ * @func_list: Comma separated list of functions or NULL.
* @sibling_node: Next filter in the list of filters for this log device
*/
struct log_filter {
@@ -508,6 +509,7 @@ struct log_filter {
enum log_category_t cat_list[LOGF_MAX_CATEGORIES];
enum log_level_t level;
const char *file_list;
+ const char *func_list;
struct list_head sibling_node;
};
@@ -599,13 +601,14 @@ int do_log_test(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]);
* @level: Maximum (or minimum, if %LOGFF_LEVEL_MIN) log level to allow
* @file_list: List of files to allow, separated by comma. If NULL then all
* files are permitted
+ * @func_list: Comma separated list of functions or NULL.
* 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 level, const char *file_list,
- int flags);
+ const char *func_list, int flags);
/**
* log_add_filter() - Add a new filter to a log device
@@ -628,7 +631,7 @@ static inline int log_add_filter(const char *drv_name,
const char *file_list)
{
return log_add_filter_flags(drv_name, cat_list, max_level, file_list,
- 0);
+ NULL, 0);
}
/**