[FIX] race condition on probes disarming (at stop)
[kernel/swap-modules.git] / writer / event_filter.h
1 #ifndef _EVENT_FILTER_H
2 #define _EVENT_FILTER_H
3
4 /*
5  *  SWAP kernel features
6  *  writer/event_filter.h
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21  *
22  * Copyright (C) Samsung Electronics, 2013
23  *
24  * 2013         Vyacheslav Cherkashin <v.cherkashin@samsung.com>
25  *
26  */
27
28
29 #include <linux/list.h>
30
31 struct task_struct;
32
33 struct ev_filter {
34         struct list_head list;
35         char *name;
36         int (*filter)(struct task_struct *);
37 };
38
39
40 int check_event(struct task_struct *task);
41
42 int event_filter_register(struct ev_filter *f);
43 void event_filter_unregister(struct ev_filter *f);
44 int event_filter_set(const char *name);
45 const char *event_filter_get(void);
46
47 void event_filter_on_each(void (*func)(struct ev_filter *, void *),
48                           void *data);
49
50 int event_filter_init(void);
51 void event_filter_exit(void);
52
53 #endif /* _EVENT_FILTER_H */