[IMPROVE] system file activity 60/41460/3
authorVyacheslav Cherkashin <v.cherkashin@samsung.com>
Mon, 15 Jun 2015 13:13:47 +0000 (16:13 +0300)
committerDmitry Kovalenko <d.kovalenko@samsung.com>
Wed, 17 Jun 2015 14:04:16 +0000 (07:04 -0700)
Change-Id: I9278a8c6b6d5ea76cf69c9c90b2752f0e84de0d8
Signed-off-by: Vyacheslav Cherkashin <v.cherkashin@samsung.com>
ks_features/file_ops.c
ks_features/file_ops.h
ks_features/ks_features.c
ks_features/ks_features.h
parser/features.c

index 0e00942..0c4b82f 100644 (file)
@@ -682,6 +682,11 @@ static int __fops_dput_wrapper(void *data, void *arg)
        return 0;
 }
 
+bool file_ops_is_init(void)
+{
+       return fops_enabled;
+}
+
 int file_ops_init(void)
 {
        int ret = -EINVAL;
index f118d86..56e113d 100644 (file)
@@ -1,6 +1,9 @@
 #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);
 
index d8ae508..3993cb8 100644 (file)
@@ -464,7 +464,7 @@ int set_feature(enum feature_id id)
        int ret;
 
        switch (id) {
-       case FID_FILE:
+       case FID_SYSFILE_ACTIVITY:
                ret = file_ops_init();
                break;
        case FID_SWITCH:
@@ -492,7 +492,7 @@ int unset_feature(enum feature_id id)
        int ret = 0;
 
        switch (id) {
-       case FID_FILE:
+       case FID_SYSFILE_ACTIVITY:
                file_ops_exit();
                break;
        case FID_SWITCH:
@@ -560,6 +560,9 @@ static void core_uninit(void)
 {
        uninit_syscall_features();
        exit_switch_context();
+
+       if (file_ops_is_init())
+               file_ops_exit();
 }
 
 SWAP_LIGHT_INIT_MODULE(once, NULL, core_uninit, NULL, NULL);
index a98c3f6..d75da5e 100644 (file)
  * 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);
index beb7f6b..392f5f5 100644 (file)
@@ -358,6 +358,16 @@ static int unset_func_energy(void)
        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.
@@ -434,6 +444,12 @@ static struct feature_item feature_func_energy = {
        .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,
@@ -461,7 +477,29 @@ static struct feature_item *feature_list[] = {
  /* 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,
 };
 
 /**
@@ -523,7 +561,7 @@ static int do_set_features(struct conf_data *conf)
 
                                return ret;
                        }
-                       f_mask = ~(1 << i);
+                       f_mask = ~((u64)1 << i);
                        feature_inst = (feature_inst & f_mask) |
                                       (features_backup & ~f_mask);
                }