Commit c09d7a3d authored by Frederic Weisbecker's avatar Frederic Weisbecker

Merge branch '/tip/perf/filter' of...

Merge branch '/tip/perf/filter' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-trace.git into perf/core
parents 0a102479 4defe682
...@@ -208,7 +208,6 @@ struct ftrace_event_call { ...@@ -208,7 +208,6 @@ struct ftrace_event_call {
#define PERF_MAX_TRACE_SIZE 2048 #define PERF_MAX_TRACE_SIZE 2048
#define MAX_FILTER_PRED 32
#define MAX_FILTER_STR_VAL 256 /* Should handle KSYM_SYMBOL_LEN */ #define MAX_FILTER_STR_VAL 256 /* Should handle KSYM_SYMBOL_LEN */
extern void destroy_preds(struct ftrace_event_call *call); extern void destroy_preds(struct ftrace_event_call *call);
......
...@@ -661,8 +661,10 @@ struct ftrace_event_field { ...@@ -661,8 +661,10 @@ struct ftrace_event_field {
}; };
struct event_filter { struct event_filter {
int n_preds; int n_preds; /* Number assigned */
struct filter_pred **preds; int a_preds; /* allocated */
struct filter_pred *preds;
struct filter_pred *root;
char *filter_string; char *filter_string;
}; };
...@@ -674,11 +676,23 @@ struct event_subsystem { ...@@ -674,11 +676,23 @@ struct event_subsystem {
int nr_events; int nr_events;
}; };
#define FILTER_PRED_INVALID ((unsigned short)-1)
#define FILTER_PRED_IS_RIGHT (1 << 15)
#define FILTER_PRED_FOLD (1 << 15)
/*
* The max preds is the size of unsigned short with
* two flags at the MSBs. One bit is used for both the IS_RIGHT
* and FOLD flags. The other is reserved.
*
* 2^14 preds is way more than enough.
*/
#define MAX_FILTER_PRED 16384
struct filter_pred; struct filter_pred;
struct regex; struct regex;
typedef int (*filter_pred_fn_t) (struct filter_pred *pred, void *event, typedef int (*filter_pred_fn_t) (struct filter_pred *pred, void *event);
int val1, int val2);
typedef int (*regex_match_func)(char *str, struct regex *r, int len); typedef int (*regex_match_func)(char *str, struct regex *r, int len);
...@@ -700,11 +714,23 @@ struct filter_pred { ...@@ -700,11 +714,23 @@ struct filter_pred {
filter_pred_fn_t fn; filter_pred_fn_t fn;
u64 val; u64 val;
struct regex regex; struct regex regex;
char *field_name; /*
* Leaf nodes use field_name, ops is used by AND and OR
* nodes. The field_name is always freed when freeing a pred.
* We can overload field_name for ops and have it freed
* as well.
*/
union {
char *field_name;
unsigned short *ops;
};
int offset; int offset;
int not; int not;
int op; int op;
int pop_n; unsigned short index;
unsigned short parent;
unsigned short left;
unsigned short right;
}; };
extern struct list_head ftrace_common_fields; extern struct list_head ftrace_common_fields;
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment