return 0;
}
+bool file_ops_is_init(void)
+{
+ return fops_enabled;
+}
+
int file_ops_init(void)
{
int ret = -EINVAL;
#ifndef __FILE_OPS__
#define __FILE_OPS__
+#include <linux/types.h>
+
+bool file_ops_is_init(void);
int file_ops_init(void);
void file_ops_exit(void);
int ret;
switch (id) {
- case FID_FILE:
+ case FID_SYSFILE_ACTIVITY:
ret = file_ops_init();
break;
case FID_SWITCH:
int ret = 0;
switch (id) {
- case FID_FILE:
+ case FID_SYSFILE_ACTIVITY:
file_ops_exit();
break;
case FID_SWITCH:
{
uninit_syscall_features();
exit_switch_context();
+
+ if (file_ops_is_init())
+ file_ops_exit();
}
SWAP_LIGHT_INIT_MODULE(once, NULL, core_uninit, NULL, NULL);
* Features ids
*/
enum feature_id {
- FID_FILE = 1, /**< File probes */
- FID_IPC = 2, /**< Hz probes */
- FID_PROCESS = 3, /**< Process probes */
- FID_SIGNAL = 4, /**< Signal probes */
- FID_NET = 5, /**< Network probes */
- FID_DESC = 6, /**< Description probes */
- FID_SWITCH = 7 /**< Switch context probes */
+ FID_FILE = 1, /**< File probes */
+ FID_IPC = 2, /**< Hz probes */
+ FID_PROCESS = 3, /**< Process probes */
+ FID_SIGNAL = 4, /**< Signal probes */
+ FID_NET = 5, /**< Network probes */
+ FID_DESC = 6, /**< Description probes */
+ FID_SWITCH = 7, /**< Switch context probes */
+ FID_SYSFILE_ACTIVITY = 8 /**< System file activity */
};
int set_feature(enum feature_id id);
return unset_energy();
}
+static int set_sysfile_activity(struct conf_data *conf)
+{
+ return set_feature(FID_SYSFILE_ACTIVITY);
+}
+
+static int unset_sysfile_activity(void)
+{
+ return unset_feature(FID_SYSFILE_ACTIVITY);
+}
+
/**
* @struct feature_item
* @brief Struct that describes feature.
.unset = unset_func_energy
};
+static struct feature_item feature_sysfile_activity = {
+ .name = "system file activity",
+ .set = set_sysfile_activity,
+ .unset = unset_sysfile_activity
+};
+
static struct feature_item *feature_list[] = {
/* 0 */ NULL,
/* 1 */ NULL,
/* 23 */ NULL,
/* 24 */ NULL,
/* 25 */ NULL,
- /* 26 */ &feature_func_energy
+ /* 26 */ &feature_func_energy,
+ /* 27 */ NULL,
+ /* 28 */ NULL,
+ /* 29 */ NULL,
+ /* 30 */ NULL,
+ /* 31 */ NULL,
+ /* 32 */ NULL,
+ /* 33 */ NULL,
+ /* 34 */ NULL,
+ /* 35 */ NULL,
+ /* 36 */ NULL,
+ /* 37 */ NULL,
+ /* 38 */ NULL,
+ /* 39 */ NULL,
+ /* 40 */ NULL,
+ /* 41 */ NULL,
+ /* 42 */ NULL,
+ /* 43 */ NULL,
+ /* 44 */ NULL,
+ /* 45 */ NULL,
+ /* 46 */ NULL,
+ /* 47 */ NULL,
+ /* 48 */ &feature_sysfile_activity,
};
/**
return ret;
}
- f_mask = ~(1 << i);
+ f_mask = ~((u64)1 << i);
feature_inst = (feature_inst & f_mask) |
(features_backup & ~f_mask);
}