src/dpdk/lib/librte_eal/common/eal_common_log.c
static int rte_log_save_level(int priority,
			      const char *regex, const char *pattern)
{
	struct rte_eal_opt_loglevel *opt_ll = NULL;

	opt_ll = malloc(sizeof(*opt_ll));
	if (opt_ll == NULL)
		goto fail;

	opt_ll->level = priority;

	if (regex) {
		opt_ll->pattern = NULL;
		if (regcomp(&opt_ll->re_match, regex, 0) != 0)
			goto fail;
	} else if (pattern) {
		opt_ll->pattern = strdup(pattern);
		if (opt_ll->pattern == NULL)
			goto fail;
	} else
		goto fail;

	TAILQ_INSERT_HEAD(&opt_loglevel_list, opt_ll, next);
	return 0;
fail:
	free(opt_ll);
	return -1;
}
/*
 * Save the type string and the loglevel for later dynamic
 * logtypes which may register later.
 */
Save the type string and the loglevel for later dynamic
logtypes which may register later.
Save the type string and the loglevel for later dynamic logtypes which may register later .
static int rte_log_save_level(int priority,
			      const char *regex, const char *pattern)
{
	struct rte_eal_opt_loglevel *opt_ll = NULL;
	opt_ll = malloc(sizeof(*opt_ll));
	if (opt_ll == NULL)
		goto fail;
	opt_ll->level = priority;
	if (regex) {
		opt_ll->pattern = NULL;
		if (regcomp(&opt_ll->re_match, regex, 0) != 0)
			goto fail;
	} else if (pattern) {
		opt_ll->pattern = strdup(pattern);
		if (opt_ll->pattern == NULL)
			goto fail;
	} else
		goto fail;
	TAILQ_INSERT_HEAD(&opt_loglevel_list, opt_ll, next);
	return 0;
fail:
	free(opt_ll);
	return -1;
}
static int rte_log_save_level ( int priority , const char * regex , const char * pattern ) { struct rte_eal_opt_loglevel * opt_ll = NULL ; opt_ll = malloc ( sizeof ( * opt_ll ) ) ; if ( opt_ll == NULL ) goto fail ; opt_ll -> level = priority ; if ( regex ) { opt_ll -> pattern = NULL ; if ( regcomp ( & opt_ll -> re_match , regex , 0 ) != 0 ) goto fail ; } else if ( pattern ) { opt_ll -> pattern = strdup ( pattern ) ; if ( opt_ll -> pattern == NULL ) goto fail ; } else goto fail ; TAILQ_INSERT_HEAD ( & opt_loglevel_list , opt_ll , next ) ; return 0 ; fail : free ( opt_ll ) ; return -1 ; }
Save the type string and the loglevel for later dynamic
 logtypes which may register later.
Save the type string and the loglevel for later dynamic logtypes which may register later .