[IMPROVE] Us_manager: implement 'dumb' filter
[kernel/swap-modules.git] / us_manager / pf / pf_group.h
1 /*
2  *  SWAP uprobe manager
3  *  modules/us_manager/pf/pf_group.h
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18  *
19  * Copyright (C) Samsung Electronics, 2013
20  *
21  * 2013  Vyacheslav Cherkashin: SWAP us_manager implement
22  *
23  */
24
25
26 #ifndef _PF_GROUP_H
27 #define _PF_GROUP_H
28
29 #include <linux/types.h>
30
31 struct dentry;
32 struct pf_group;
33 struct sspt_proc;
34
35 struct pf_group *get_pf_group_by_dentry(struct dentry *dentry, void *priv);
36 struct pf_group *get_pf_group_by_tgid(pid_t tgid, void *priv);
37 struct pf_group *get_pf_group_dumb(void *priv);
38 void put_pf_group(struct pf_group *pfg);
39
40 int pf_register_probe(struct pf_group *pfg, struct dentry *dentry,
41                       unsigned long offset, const char *args, char ret_type);
42 int pf_unregister_probe(struct pf_group *pfg, struct dentry *dentry,
43                         unsigned long offset);
44
45 void install_all(void);
46 void uninstall_all(void);
47
48 void call_page_fault(struct task_struct *task, unsigned long page_addr);
49 void call_mm_release(struct task_struct *task);
50 void uninstall_proc(struct sspt_proc *proc);
51
52 void uninstall_page(unsigned long addr);
53
54 /* debug */
55 void pfg_print(struct pf_group *pfg);
56 /* debug */
57
58 #endif /* _PF_GROUP_H */