@@ -207,6 +207,18 @@ field name::
As the kernel will have to know how to retrieve the memory that the pointer
is at from user space.
+You can convert any long type to a function address and search by function
name:: +
+ call_site.function == security_prepare_creds
+
+The above will filter when the field "call_site" falls on the address
within +"security_prepare_creds". That is, it will compare the value of
"call_site" and +the filter will return true if it is greater than or equal
to the start of +the function "security_prepare_creds" and less than the
end of that function. +
+The ".function" postfix can only be attached to values of size long, and
can only +be compared with "==" or "!=".
+
5.2 Setting filters
-------------------
@@ -2822,7 +2822,7 @@ static __init int setup_trace_triggers(char *str)
if (!trigger)
break;
bootup_triggers[i].event = strsep(&trigger, ".");
- bootup_triggers[i].trigger = strsep(&trigger, ".");
+ bootup_triggers[i].trigger = strsep(&trigger, "");
if (!bootup_triggers[i].trigger)
break;
}
b/kernel/trace/trace_events_filter.c index 96acc2b71ac7..eef6426051bb 100644
@@ -64,6 +64,7 @@ enum filter_pred_fn {
FILTER_PRED_FN_PCHAR_USER,
FILTER_PRED_FN_PCHAR,
FILTER_PRED_FN_CPU,
+ FILTER_PRED_FN_FUNCTION,
FILTER_PRED_FN_,
FILTER_PRED_TEST_VISITED,
};
@@ -71,6 +72,7 @@ enum filter_pred_fn {
struct filter_pred {
enum filter_pred_fn fn_num;
u64 val;
+ u64 val2;
struct regex regex;
unsigned short *ops;
struct ftrace_event_field *field;
@@ -103,6 +105,7 @@ struct filter_pred {
C(INVALID_FILTER, "Meaningless filter expression"), \
C(IP_FIELD_ONLY, "Only 'ip' field is supported for function
trace"), \ C(INVALID_VALUE, "Invalid value (did you forget
quotes)?"), \
+ C(NO_FUNCTION, "Function not found"),
\ C(ERRNO, "Error"),
\ C(NO_FILTER, "No filter found")