src/dpdk/lib/librte_eal/common/eal_common_log.c
int
rte_log_register_type_and_pick_level(const char *name, uint32_t level_def)
{
	struct rte_eal_opt_loglevel *opt_ll;
	uint32_t level = level_def;
	int type;

	type = rte_log_register(name);
	if (type < 0)
		return type;

	TAILQ_FOREACH(opt_ll, &opt_loglevel_list, next) {
		if (opt_ll->level > RTE_LOG_DEBUG)
			continue;

		if (opt_ll->pattern) {
			if (fnmatch(opt_ll->pattern, name, 0) == 0)
				level = opt_ll->level;
		} else {
			if (regexec(&opt_ll->re_match, name, 0, NULL, 0) == 0)
				level = opt_ll->level;
		}
	}

	rte_logs.dynamic_types[type].loglevel = level;

	return type;
}
/* Register an extended log type and try to pick its level from EAL options */
Register an extended log type and try to pick its level from EAL options
Register an extended log type and try to pick its level from EAL options
int
rte_log_register_type_and_pick_level(const char *name, uint32_t level_def)
{
	struct rte_eal_opt_loglevel *opt_ll;
	uint32_t level = level_def;
	int type;
	type = rte_log_register(name);
	if (type < 0)
		return type;
	TAILQ_FOREACH(opt_ll, &opt_loglevel_list, next) {
		if (opt_ll->level > RTE_LOG_DEBUG)
			continue;
		if (opt_ll->pattern) {
			if (fnmatch(opt_ll->pattern, name, 0) == 0)
				level = opt_ll->level;
		} else {
			if (regexec(&opt_ll->re_match, name, 0, NULL, 0) == 0)
				level = opt_ll->level;
		}
	}
	rte_logs.dynamic_types[type].loglevel = level;
	return type;
}
int rte_log_register_type_and_pick_level ( const char * name , uint32_t level_def ) { struct rte_eal_opt_loglevel * opt_ll ; uint32_t level = level_def ; int type ; type = rte_log_register ( name ) ; if ( type < 0 ) return type ; TAILQ_FOREACH ( opt_ll , & opt_loglevel_list , next ) { if ( opt_ll -> level > RTE_LOG_DEBUG ) continue ; if ( opt_ll -> pattern ) { if ( fnmatch ( opt_ll -> pattern , name , 0 ) == 0 ) level = opt_ll -> level ; } else { if ( regexec ( & opt_ll -> re_match , name , 0 , NULL , 0 ) == 0 ) level = opt_ll -> level ; } } rte_logs . dynamic_types [ type ] . loglevel = level ; return type ; }
Register an extended log type and try to pick its level from EAL options
Register an extended log type and try to pick its level from EAL options