diff options
Diffstat (limited to 'kernel/trace/ftrace.c')
| -rw-r--r-- | kernel/trace/ftrace.c | 21 | 
1 files changed, 21 insertions, 0 deletions
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index da87b3cba5b3..1f0f547c54da 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c @@ -3511,6 +3511,10 @@ static int ftrace_match(char *str, struct ftrace_glob *g)  		    memcmp(str + slen - g->len, g->search, g->len) == 0)  			matched = 1;  		break; +	case MATCH_GLOB: +		if (glob_match(g->search, str)) +			matched = 1; +		break;  	}  	return matched; @@ -4258,6 +4262,23 @@ int ftrace_set_filter_ip(struct ftrace_ops *ops, unsigned long ip,  }  EXPORT_SYMBOL_GPL(ftrace_set_filter_ip); +/** + * ftrace_ops_set_global_filter - setup ops to use global filters + * @ops - the ops which will use the global filters + * + * ftrace users who need global function trace filtering should call this. + * It can set the global filter only if ops were not initialized before. + */ +void ftrace_ops_set_global_filter(struct ftrace_ops *ops) +{ +	if (ops->flags & FTRACE_OPS_FL_INITIALIZED) +		return; + +	ftrace_ops_init(ops); +	ops->func_hash = &global_ops.local_hash; +} +EXPORT_SYMBOL_GPL(ftrace_ops_set_global_filter); +  static int  ftrace_set_regex(struct ftrace_ops *ops, unsigned char *buf, int len,  		 int reset, int enable)  |