Provide process_features() interface 94/151094/4
authorAlexander Aksenov <a.aksenov@samsung.com>
Tue, 19 Sep 2017 10:00:50 +0000 (13:00 +0300)
committerAlexander Aksenov <a.aksenov@samsung.com>
Fri, 22 Sep 2017 08:25:25 +0000 (08:25 +0000)
Now it should be called only when new target bins received or
by call from kernel.

Change-Id: Ie21a637ec4e0ff82a8fcc4d6058b8887e47057c7
Signed-off-by: Alexander Aksenov <a.aksenov@samsung.com>
helper/got_patching.c
helper/got_patching.h
helper/libdaprobe.c

index 089b630..1b6143f 100644 (file)
@@ -381,7 +381,7 @@ static void _patch_target_bins(struct feature_desc_t *feature)
        dl_iterate_phdr(_patch_bin, feature);
 }
 
-static void _process_features(void)
+void process_features(void)
 {
        unsigned int i;
 
@@ -580,7 +580,7 @@ void process_got_patching(char *data, size_t size)
                inited = true;
        }
        _process_target_bins(data, size);
-       _process_features();
+       process_features();
 }
 
 
index 9783575..21b1410 100644 (file)
@@ -4,5 +4,6 @@
 void process_got_patching(char *data, size_t size);
 void restore_got_patching(void);
 void init_features(void);
+void process_features(void);
 
 #endif /* __GOT_PATCHING_H__ */
index 2bdafda..2d44719 100755 (executable)
@@ -115,9 +115,15 @@ static void _configure(char* configstr)
                 gTraceInfo.features.feature_0, gTraceInfo.features.feature_1);
 }
 
+static void _receive_target_bins(char *data_buf, size_t size)
+{
+       process_got_patching(data_buf, size);
+}
+
 static void _process_target_bins(char *data_buf, size_t size)
 {
        process_got_patching(data_buf, size);
+       process_features();
 }
 
 void application_exit()
@@ -269,7 +275,7 @@ static int create_socket(void)
                        recved |= MSG_CONFIG_RECV;
                } else if (log.type == APP_MSG_TARGET_BINS) {
                        PRINTMSG("APP_MSG_TARGET_BINS");
-                       _process_target_bins((char *)data_buf, data_size);
+                       _receive_target_bins((char *)data_buf, data_size);
                        recved |= MSG_TARGET_BINS_RECV;
                } else {
                        // unexpected case