@@ -2826,6 +2826,10 @@ ftrace_set_regex(struct ftrace_ops *ops, unsigned char *buf, int len,
28262826 struct ftrace_hash * hash ;
28272827 int ret ;
28282828
2829+ /* All global ops uses the global ops filters */
2830+ if (ops -> flags & FTRACE_OPS_FL_GLOBAL )
2831+ ops = & global_ops ;
2832+
28292833 if (unlikely (ftrace_disabled ))
28302834 return - ENODEV ;
28312835
@@ -2856,20 +2860,57 @@ ftrace_set_regex(struct ftrace_ops *ops, unsigned char *buf, int len,
28562860
28572861/**
28582862 * ftrace_set_filter - set a function to filter on in ftrace
2863+ * @ops - the ops to set the filter with
2864+ * @buf - the string that holds the function filter text.
2865+ * @len - the length of the string.
2866+ * @reset - non zero to reset all filters before applying this filter.
2867+ *
2868+ * Filters denote which functions should be enabled when tracing is enabled.
2869+ * If @buf is NULL and reset is set, all functions will be enabled for tracing.
2870+ */
2871+ void ftrace_set_filter (struct ftrace_ops * ops , unsigned char * buf ,
2872+ int len , int reset )
2873+ {
2874+ ftrace_set_regex (ops , buf , len , reset , 1 );
2875+ }
2876+ EXPORT_SYMBOL_GPL (ftrace_set_filter );
2877+
2878+ /**
2879+ * ftrace_set_notrace - set a function to not trace in ftrace
2880+ * @ops - the ops to set the notrace filter with
2881+ * @buf - the string that holds the function notrace text.
2882+ * @len - the length of the string.
2883+ * @reset - non zero to reset all filters before applying this filter.
2884+ *
2885+ * Notrace Filters denote which functions should not be enabled when tracing
2886+ * is enabled. If @buf is NULL and reset is set, all functions will be enabled
2887+ * for tracing.
2888+ */
2889+ void ftrace_set_notrace (struct ftrace_ops * ops , unsigned char * buf ,
2890+ int len , int reset )
2891+ {
2892+ ftrace_set_regex (ops , buf , len , reset , 0 );
2893+ }
2894+ EXPORT_SYMBOL_GPL (ftrace_set_notrace );
2895+ /**
2896+ * ftrace_set_filter - set a function to filter on in ftrace
2897+ * @ops - the ops to set the filter with
28592898 * @buf - the string that holds the function filter text.
28602899 * @len - the length of the string.
28612900 * @reset - non zero to reset all filters before applying this filter.
28622901 *
28632902 * Filters denote which functions should be enabled when tracing is enabled.
28642903 * If @buf is NULL and reset is set, all functions will be enabled for tracing.
28652904 */
2866- void ftrace_set_filter (unsigned char * buf , int len , int reset )
2905+ void ftrace_set_global_filter (unsigned char * buf , int len , int reset )
28672906{
28682907 ftrace_set_regex (& global_ops , buf , len , reset , 1 );
28692908}
2909+ EXPORT_SYMBOL_GPL (ftrace_set_global_filter );
28702910
28712911/**
28722912 * ftrace_set_notrace - set a function to not trace in ftrace
2913+ * @ops - the ops to set the notrace filter with
28732914 * @buf - the string that holds the function notrace text.
28742915 * @len - the length of the string.
28752916 * @reset - non zero to reset all filters before applying this filter.
@@ -2878,10 +2919,11 @@ void ftrace_set_filter(unsigned char *buf, int len, int reset)
28782919 * is enabled. If @buf is NULL and reset is set, all functions will be enabled
28792920 * for tracing.
28802921 */
2881- void ftrace_set_notrace (unsigned char * buf , int len , int reset )
2922+ void ftrace_set_global_notrace (unsigned char * buf , int len , int reset )
28822923{
28832924 ftrace_set_regex (& global_ops , buf , len , reset , 0 );
28842925}
2926+ EXPORT_SYMBOL_GPL (ftrace_set_global_notrace );
28852927
28862928/*
28872929 * command line interface to allow users to set filters on boot up.
0 commit comments