uihv: remove swap-module dependece 29/153929/2
authorVyacheslav Cherkashin <v.cherkashin@samsung.com>
Tue, 3 Oct 2017 11:55:36 +0000 (14:55 +0300)
committerVyacheslav Cherkashin <v.cherkashin@samsung.com>
Fri, 20 Oct 2017 10:48:14 +0000 (13:48 +0300)
Change-Id: I0f3447d693a119d1332e78e73196b1cd095a8dbf
Signed-off-by: Vyacheslav Cherkashin <v.cherkashin@samsung.com>
daemon/Makefile
daemon/daemon.c
daemon/ui_viewer.c [deleted file]
daemon/ui_viewer.h [deleted file]
packaging/swap-manager.spec
scripts/gen_uihv_header.sh [deleted file]
scripts/swap_module.sh
scripts/swap_start.sh

index 66901d9..5547dce 100644 (file)
@@ -105,8 +105,7 @@ SRC_C := \
        smack.c \
        malloc_debug.c \
        target.c \
-       thread.c \
-       ui_viewer.c
+       thread.c
 
 SRC_CPP := \
        cpp/features/feature.cpp \
@@ -138,19 +137,16 @@ START_SH = ../scripts/swap_start.sh
 STOP_SH = ../scripts/swap_stop.sh
 INIT_LOADER_SH = ../scripts/swap_init_loader.sh
 INIT_PRELOAD_SH = ../scripts/swap_init_preload.sh
-INIT_UIHV_SH = ../scripts/swap_init_uihv.sh
 INIT_WSP_SH = ../scripts/swap_init_wsp.sh
 INIT_GTP_SH = ../scripts/swap_init_gtp.sh
 LOADER_SCRIPT = ../scripts/gen_loader_header.sh
 PRELOAD_SCRIPT = ../scripts/gen_preload_header.sh
-UIHV_SCRIPT = ../scripts/gen_uihv_header.sh
 GTP_SCRIPT = ../scripts/gen_gtp_data.sh
 SCRIPTS := \
        $(START_SH) \
        $(STOP_SH) \
        $(INIT_LOADER_SH) \
        $(INIT_PRELOAD_SH) \
-       $(INIT_UIHV_SH) \
        $(INIT_WSP_SH) \
        $(INIT_GTP_SH)
 
@@ -167,10 +163,6 @@ $(INIT_LOADER_SH): $(LOADER_SCRIPT)
 $(INIT_PRELOAD_SH): $(PRELOAD_SCRIPT)
        bash $< $@
 
-#UIHV
-$(INIT_UIHV_SH): $(UIHV_SCRIPT)
-       bash $< $@
-
 #GOT patcher
 $(INIT_GTP_SH): $(GTP_SCRIPT)
        bash $< $@
index f96f330..7d618e7 100644 (file)
@@ -65,7 +65,6 @@
 #include "threads.h"
 #include "smack.h"
 #include "swap_debug.h"
-#include "ui_viewer.h"
 
 #include "cpp/features/feature_manager_c.h"
 #include "cpp/auxd/auxd_client_c.h"
@@ -207,10 +206,6 @@ static int exec_app_case_type_tizen(const struct app_info_t *app_info)
 {
        const char ui_viewer_log[] = "/run/swap/uilib.log";
 
-       if (is_feature_enabled(FL_UI_VIEWER_PROFILING))
-               if (ui_viewer_enable(app_info))
-                       LOGE("Failed to enabled UI viewer profiling\n");
-
        if (access(ui_viewer_log, F_OK) != -1)
                remove(ui_viewer_log);
 
@@ -238,8 +233,6 @@ static int exec_app_case_type_web(const struct app_info_t *app_info)
 
 static int kill_app_case_type_tizen(const struct app_info_t *app_info)
 {
-       ui_viewer_disable();
-
        if (!auxd_client_tizen_app_terminate(manager.auxd_client, app_info->app_id)) {
                LOGE("Cannot kill tizen app %s\n", app_info->app_id);
                return -1;
diff --git a/daemon/ui_viewer.c b/daemon/ui_viewer.c
deleted file mode 100644 (file)
index b098852..0000000
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- *  DA manager
- *
- * Copyright (c) 2015 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact:
- *
- * Anastasia Lyupa <a.lyupa@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Contributors:
- * - Samsung RnD Institute Russia
- *
- */
-
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdbool.h>
-#include <string.h>
-#include <errno.h>
-
-#include "ui_viewer.h"
-#include "da_protocol.h"
-#include "swap_debug.h"
-#include "smack.h"
-
-static int ui_viewer_set_app_info(const struct app_info_t *app_info)
-{
-       const char APP_INFO_FILE[] =
-               "/sys/kernel/debug/swap/uihv/app_info";
-       FILE *fp;
-       int ret = 0, c = 0;
-       uint64_t main_offset;
-
-       main_offset = *(uint64_t*)app_info->setup_data.data;
-
-       if (app_info->exe_path == NULL || !strlen(app_info->exe_path)) {
-               LOGE("Executable path is not correct\n");
-               ret = -EINVAL;
-               goto fail;
-       }
-
-       fp = fopen(APP_INFO_FILE, "w");
-       if (fp != NULL) {
-               c = fprintf(fp, "0x%lx:%s\n", (unsigned long)main_offset,
-                           app_info->exe_path);
-               if (c < 0) {
-                       LOGE("Can't write to file: %s\n", APP_INFO_FILE);
-                       ret = -EIO;
-               }
-               fclose(fp);
-       } else {
-               LOGE("Can't open file: %s\n", APP_INFO_FILE);
-               ret = -ENOENT;
-       }
-fail:
-       return ret;
-}
-
-static int ui_viewer_ctrl(bool enable)
-{
-       const char UI_ENABLE_FILE[] =
-               "/sys/kernel/debug/swap/uihv/enable";
-       FILE *fp;
-       int ret = 0, c = 0;
-
-       fp = fopen(UI_ENABLE_FILE, "w");
-       if (fp != NULL) {
-               c = fprintf(fp, "%d\n", enable ? 1 : 0);
-               if (c < 0) {
-                       LOGE("Can't write to file: %s\n", UI_ENABLE_FILE);
-                       ret = -EIO;
-               }
-               fclose(fp);
-       } else {
-               LOGE("Can't open file: %s\n", UI_ENABLE_FILE);
-               ret = -ENOENT;
-       }
-
-       return ret;
-}
-
-int ui_viewer_enable(const struct app_info_t *app_info)
-{
-       int ret = 0;
-
-       if (ui_viewer_set_app_info(app_info)) {
-               LOGE("Cannot set app info for ui viewer\n");
-               ret = -1;
-               goto out;
-       }
-
-       ret = ui_viewer_ctrl(true);
-
-out:
-       return ret;
-}
-
-int ui_viewer_disable(void)
-{
-       return ui_viewer_ctrl(false);
-}
diff --git a/daemon/ui_viewer.h b/daemon/ui_viewer.h
deleted file mode 100644 (file)
index 30e9415..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- *  DA manager
- *
- * Copyright (c) 2015 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact:
- *
- * Anastasia Lyupa <a.lyupa@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Contributors:
- * - Samsung RnD Institute Russia
- *
- */
-
-
-#ifndef UI_VIEWER_H_
-#define UI_VIEWER_H_
-
-#include "da_inst.h"
-
-int ui_viewer_enable(const struct app_info_t *app_info);
-int ui_viewer_disable(void);
-
-#endif /* UI_VIEWER_H_ */
index 1063b44..8422e18 100644 (file)
@@ -240,7 +240,6 @@ su - owner -c "systemctl --user daemon-reload"
 %{_bindir}/swap_stop.sh
 %{_bindir}/swap_init_loader.sh
 %{_bindir}/swap_init_preload.sh
-%{_bindir}/swap_init_uihv.sh
 %{_bindir}/swap_init_wsp.sh
 %{_bindir}/swap_init_gtp.sh
 
diff --git a/scripts/gen_uihv_header.sh b/scripts/gen_uihv_header.sh
deleted file mode 100755 (executable)
index 2337ab6..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/bin/bash
-ui_viewer_lib="$LIBDIR/da_ui_viewer.so"
-
-output=$1
-
-
-function print_header()
-{
-    filename=$1
-    echo "#!/bin/bash
-#Preload
-PATH=/bin:/usr/bin:/sbin:/usr/sbin
-" > $filename
-}
-
-function print_ui_viewer_lib()
-{
-    filename=$1
-    echo -e "/bin/echo \"$ui_viewer_lib\" > /sys/kernel/debug/swap/uihv/path" >> $filename
-}
-
-##################################
-#       Script entry point       #
-##################################
-
-
-print_header $output
-print_ui_viewer_lib $output
index a86ab97..679b41d 100755 (executable)
@@ -33,7 +33,6 @@ swap_loader.ko \
 swap_preload.ko \
 swap_wsp.ko \
 swap_nsp.ko \
-swap_uihv.ko \
 swap_gtp.ko \
 "
 
index 0b2d91d..6477d9d 100755 (executable)
@@ -97,12 +97,6 @@ then
        /usr/bin/swap_init_preload.sh
 fi
 
-#UIHV
-if [ -d /sys/kernel/debug/swap/uihv/ ]
-then
-       /usr/bin/swap_init_uihv.sh
-fi
-
 #WSP
 if [ -d /sys/kernel/debug/swap/wsp/ ]
 then