ARM: tizen_tm1_defconfig: Enable missing features related with CGROUPS
[profile/mobile/platform/kernel/linux-3.10-sc7730.git] / kernel / swap / us_manager / sspt / sspt_file.h
1 #ifndef __SSPT_FILE__
2 #define __SSPT_FILE__
3
4 /**
5  * @file us_manager/sspt/sspt_file.h
6  * @author Vyacheslav Cherkashin <v.cherkashin@samsung.com>
7  *
8  * @section LICENSE
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22  *
23  * @section COPYRIGHT
24  * Copyright (C) Samsung Electronics, 2013
25  */
26
27 #include "ip.h"
28 #include <linux/types.h>
29
30 enum US_FLAGS;
31 struct vm_area_struct;
32
33 /**
34  * @struct sspt_file
35  * @breaf Image of file for specified process
36  */
37 struct sspt_file {
38         struct list_head list;          /**< For sspt_proc */
39         struct sspt_proc *proc;         /**< Pointer to the proc (parent) */
40         struct dentry *dentry;          /**< Dentry of file */
41         unsigned long vm_start;         /**< VM start */
42         unsigned long vm_end;           /**< VM end */
43
44         unsigned long page_probes_hash_bits;    /**< Hash-table size */
45         struct hlist_head *page_probes_table;   /**< Hash-table for pages */
46
47         unsigned loaded:1;                      /**< Flag of loading */
48 };
49
50
51 struct sspt_file *sspt_file_create(struct dentry *dentry, int page_cnt);
52 void sspt_file_free(struct sspt_file *file);
53
54 struct sspt_page *sspt_find_page_mapped(struct sspt_file *file,
55                                         unsigned long page);
56 void sspt_file_add_ip(struct sspt_file *file, unsigned long offset,
57                       struct probe_info *probe_i);
58
59 void sspt_file_on_each_ip(struct sspt_file *file,
60                           void (*func)(struct us_ip *, void *), void *data);
61
62 struct sspt_page *sspt_get_page(struct sspt_file *file,
63                                 unsigned long offset_addr);
64 void sspt_put_page(struct sspt_page *page);
65
66 int sspt_file_check_install_pages(struct sspt_file *file);
67 void sspt_file_install(struct sspt_file *file);
68 int sspt_file_uninstall(struct sspt_file *file,
69                         struct task_struct *task,
70                         enum US_FLAGS flag);
71 void sspt_file_set_mapping(struct sspt_file *file, struct vm_area_struct *vma);
72
73 #endif /* __SSPT_FILE__ */