1 /* This file is part of the Linux Trace Toolkit viewer
2 * Copyright (C) 2003-2004 Michel Dagenais
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License Version 2 as
6 * published by the Free Software Foundation;
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place - Suite 330, Boston,
20 consist in AND, OR and NOT nested expressions, forming a tree with
21 simple relations as leaves. The simple relations test is a field
22 in an event is equal, not equal, smaller, smaller or equal, larger, or
23 larger or equal to a specified value. */
25 #include <lttv/filter.h>
27 typedef enum _lttv_expression_op
36 typedef enum _lttv_expression_type
39 LTTV_SIMPLE_EXPRESSION
40 } lttv_expression_type
;
42 typedef struct _lttv_simple_expression
44 lttv_expression_op op
;
47 } lttv_simple_expression
;
49 typedef struct _lttv_expression
53 gboolean simple_expression
;
56 // lttv_expression *e;
57 // lttv_field_relation *se;
66 simple expr [ op expr ]
68 read_simple_expression
69 read_field_path [ rel value ]
72 read_field_component [. field path]
81 path(component...) -> field
85 * create a new lttv_filter
86 * @param expression filtering options string
87 * @param t pointer to the current LttvTrace
88 * @return the current lttv_filter
91 lttv_filter_new(char *expression
, LttvTrace
*t
) {
93 g_print("filter::lttv_filter_new()\n"); /* debug */
97 * 2. construct binary tree
98 * 3. return corresponding filter
105 lttv_filter_tracefile(lttv_filter
*filter
, void *tracefile
) {
110 lttv_filter_event(lttv_filter
*filter
, void *event
) {