Remove web startup profiling (WSP) feature 35/191135/1 submit/tizen/20181025.124850
authorVyacheslav Cherkashin <v.cherkashin@samsung.com>
Wed, 10 Oct 2018 19:24:37 +0000 (22:24 +0300)
committerVyacheslav Cherkashin <v.cherkashin@samsung.com>
Thu, 11 Oct 2018 19:01:44 +0000 (22:01 +0300)
Change-Id: I47b50f0b8774cbf9ae15516bd3758399e0bf3993
Signed-off-by: Vyacheslav Cherkashin <v.cherkashin@samsung.com>
daemon/Makefile
daemon/cpp/features/feature_wsp.cpp [deleted file]
daemon/da_protocol_check.c
daemon/daemon.c
packaging/swap-manager.spec
scripts/gen_wsp_data.sh [deleted file]
scripts/swap_module.sh
scripts/swap_start.sh

index bbabe707cb6a8e6923cae186c3c0d32b142b8c7d..1533fdc05d20a30a694033534f452a98c7ec9954 100644 (file)
@@ -134,7 +134,6 @@ 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_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
@@ -144,7 +143,6 @@ SCRIPTS := \
        $(STOP_SH) \
        $(INIT_LOADER_SH) \
        $(INIT_PRELOAD_SH) \
-       $(INIT_WSP_SH) \
        $(INIT_GTP_SH)
 
 all: debug
@@ -183,27 +181,6 @@ else # SYSTEMD_SUPPORT
   DA_MANAGER = ../scripts/da_manager_root.sh
 endif # SYSTEMD_SUPPORT
 
-# WSP
-$(INIT_WSP_SH): $(WSP_SCRIPT)
-ifeq ($(WSP_SUPPORT),y)
-       bash $(WSP_SCRIPT) -s > $@
-else # WSP_SUPPORT
-       echo "#!/bin/bash" > $@
-       echo "PATH=/bin:/usr/bin:/sbin:/usr/sbin" >> $@
-       echo "echo \"Do not init WSP!\" " >> $@
-endif # WSP_SUPPORT
-
-ifeq ($(WSP_SUPPORT),y)
-  SRC_CPP += cpp/features/feature_wsp.cpp
-  GENERATED_WSP_H = include/generated/wsp_data.h
-  WSP_SCRIPT = ../scripts/gen_wsp_data.sh
-  GENERATED_HEADERS += $(GENERATED_WSP_H)
-
-  $(GENERATED_WSP_H): $(WSP_SCRIPT)
-       bash $< -h > $@
-
-endif # WSP_SUPPORT
-
 # NSP
 ifeq ($(NSP_SUPPORT),y)
   SRC_CPP += cpp/features/feature_nsp.cpp
diff --git a/daemon/cpp/features/feature_wsp.cpp b/daemon/cpp/features/feature_wsp.cpp
deleted file mode 100644 (file)
index e69f04f..0000000
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- *  DA manager
- *
- * Copyright (c) 2015 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact:
- *      Vyacheslav Cherkashin <v.cherkashin@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 <string>
-#include <errno.h>
-
-#include "feature.h"
-#include "feature_manager.h"
-
-#include "common.h"
-#include "swap_debug.h"
-#include "wsp_data.h"       /* auto generate */
-#include "elf/Elf.h"
-
-
-static const char path_enabled[] = "/sys/kernel/debug/swap/wsp/enabled";
-static const char path_cmd[] = "/sys/kernel/debug/swap/wsp/cmd";
-static const char chromium_path[] = "/usr/lib/libchromium-ewk.so";
-
-
-static std::string rmPlt(const std::string &name)
-{
-    static const char postfix[] = "@plt";
-    static const size_t postfixSize= sizeof(postfix) - 1;
-
-    if (name.size() <= postfixSize)
-        return std::string();
-
-    if (name.find(postfix) == std::string::npos)
-        return std::string();
-
-    return name.substr(0, name.size() - postfixSize);
-}
-
-class FeatureWSP : public Feature
-{
-    int doInit()
-    {
-        for (int ret, i = 0; i < wsp_data_cnt; ++i) {
-            const std::string name (wsp_data[i].name);
-            uint64_t addr = wsp_data[i].addr;
-
-            if (addr == 0) {
-                std::string str = rmPlt(name);
-                addr = Elf::plt(chromium_path, str);
-            }
-
-            if (addr == 0) {
-                LOGE("address for '%s' is not found\n", name.c_str());
-                return -EINVAL;
-            }
-
-            const std::string cmd(addr2hex(addr) + " " + name);
-
-            ret = write_to_file(path_cmd, cmd);
-            if (ret < 0) {
-                LOGE("write(err=%d) '%s' to %s\n", ret, cmd.c_str(), path_cmd);
-                return ret;
-            }
-        }
-
-        return 0;
-    }
-
-    int doEnable()
-    {
-        int ret(write_to_file(path_enabled, "1"));
-
-        return ret > 0 ? 0 : ret;
-    }
-
-    int doDisable()
-    {
-        int ret(write_to_file(path_enabled, "0"));
-
-        return ret > 0 ? 0 : ret;
-    }
-};
-
-
-REGISTER_FEATURE(FeatureWSP, val2bit(FL_WEB_STARTUP_PROFILING), "WSP");
index 228cd757161a241a4aa64d0f209480487e4df08e..eeca46b873588aba62cd89bfac6d53b6bd6a2c70 100644 (file)
@@ -121,6 +121,8 @@ int check_conf_features(uint64_t feature0, uint64_t feature1)
        /* unsupported features */
        if (feature0 & FL_WEB_PROFILING)
                 LOGW("FL_WEB_PROFILING is not support\n");
+       if (feature0 & FL_WEB_STARTUP_PROFILING)
+               LOGW("FL_WEB_STARTUP_PROFILING is not supported\n");
 
        return res;
 }
index fda9f53b95365415696f40fc3311f65e81022879..d6b7714e12075ee2a9b7cd2d2e9634b875f0abb4 100644 (file)
@@ -533,8 +533,7 @@ static void reconfigure_recording(struct conf_t conf)
        /* fill actual features fm suppor */
        uint64_t fm_f0 = conf.use_features0
                       & (
-                         FL_APP_STARTUP |
-                         FL_WEB_STARTUP_PROFILING
+                         FL_APP_STARTUP
                         );
        uint64_t fm_f1 = conf.use_features1 & 0;
 
index f5f0f146c94c0063478b0c780dda5e37e427950a..00e98cf9cde5778a447ac228c4196fcadee29aa6 100644 (file)
@@ -12,7 +12,6 @@ Source:    %{name}_%{version}.tar.gz
 %define SET_TESTING 0
 %define SWAP_MODULES_SUPPORT 1
 %define NSP_SUPPORT 0
-%define WSP_SUPPORT 0
 %define WAYLAND_SUPPORT 0
 %define SYSTEMD_SUPPORT 1
 
@@ -23,7 +22,6 @@ Source:    %{name}_%{version}.tar.gz
 # for mobile/werable/tv product
 %if "%{sec_product_feature_profile_lite}" == "1" || "%{sec_product_feature_profile_wearable}" == "1" || "%{TIZEN_PRODUCT_TV}" == "1"
 %define TIZEN_PRODUCT 1
-%define WSP_SUPPORT 0
 %endif
 
 %ifarch armv7l
@@ -83,11 +81,6 @@ BuildRequires: pkgconfig(wayland-client) >= 1.0.0
 BuildRequires: pkgconfig(tizen-extension-client)
 %endif
 
-
-%if %{WSP_SUPPORT}
-BuildRequires: crosswalk-tizen
-%endif
-
 Requires: swap-probe
 Requires: swap-probe-elf
 Requires: sdbd
@@ -113,10 +106,6 @@ popd
   export NSP_SUPPORT=y
 %endif
 
-%if %{WSP_SUPPORT}
-  export WSP_SUPPORT=y
-%endif
-
 %if %{SYSTEMD_SUPPORT}
   export SYSTEMD_SUPPORT=y
 %endif
@@ -261,7 +250,6 @@ fi
 %{_bindir}/swap_stop.sh
 %{_bindir}/swap_init_loader.sh
 %{_bindir}/swap_init_preload.sh
-%{_bindir}/swap_init_wsp.sh
 %{_bindir}/swap_init_gtp.sh
 
 # uihv
diff --git a/scripts/gen_wsp_data.sh b/scripts/gen_wsp_data.sh
deleted file mode 100755 (executable)
index 34e6135..0000000
+++ /dev/null
@@ -1,158 +0,0 @@
-#!/bin/bash
-
-output_type=$1
-script_dir=$(readlink -f $0 | xargs dirname)
-webapp_path="/sys/kernel/debug/swap/wsp/webapp_path"
-ewebkit_path="/sys/kernel/debug/swap/wsp/ewebkit_path"
-source $script_dir/dyn_vars
-
-chromium_package_name=chromium-efl
-path_libchromium=`rpm -ql $chromium_package_name | grep "libchromium-ewk.so$" | head -1`
-
-if [ "$__tizen_product__" == "1" ]; then
-       path_libchromium_debuginfo=$path_libchromium
-else
-       path_libchromium_debuginfo=`rpm -ql ${chromium_package_name}-debuginfo | grep "libchromium-ewk.so.debug$" | head -1`
-fi
-
-
-
-g_names=()
-g_nick_names=()
-
-g_names_plt=()
-g_nick_names_plt=()
-
-get_addrs()
-{
-       param=$1
-       shift
-       names=($@)
-       len=${#names[@]}
-
-       if [[ "$param" == "plt" ]]; then
-               path_lib=$path_libchromium
-
-               for (( i=0; i < ${len}; ++i)); do
-                       names[$i]=`echo ${names[$i]} | cut -d'@' -f 1`
-               done
-       else
-               path_lib=$path_libchromium_debuginfo
-       fi
-
-       for (( i=0; i < ${len}; ++i)); do
-               name=${names[$i]}
-               addr=$(parse_elf -f $path_lib --addr_format=swap --syms=$name | cut -f1 -d' ')
-               if [ -z "$addr" -o $((16#$addr)) -eq 0 ]; then
-                       addr=0
-                       echo "ERROR: symbol '$name' not found" >&2
-               fi
-               echo 0x$addr
-       done
-}
-
-add_func()
-{
-       name=$1
-       nick_name=$2
-
-       g_names+=($name)
-       g_nick_names+=($nick_name)
-}
-
-add_func_plt()
-{
-       name=$1
-       nick_name=$2
-
-       g_names_plt+=($name)
-       g_nick_names_plt+=($nick_name)
-}
-
-gen_array()
-{
-       addrs_plt=`get_addrs plt ${g_names_plt[@]}`
-       if [ $? -ne 0 ]; then
-               exit 1;
-       fi
-
-       addrs=`get_addrs syms ${g_names[@]}`
-       if [ $? -ne 0 ]; then
-               exit 1;
-       fi
-
-       addrs=($addrs_plt $addrs)
-       g_names=(${g_names_plt[@]} ${g_names[@]})
-       g_nick_names=(${g_nick_names_plt[@]} ${g_nick_names[@]})
-
-       len=${#g_names[@]}
-       for (( i=0; i < ${len}; ++i)); do
-               echo -e "\t{ \"${g_names[$i]}\", \"${g_nick_names[$i]}\", ${addrs[$i]} },"
-       done
-}
-
-function gen_header_out()
-{
-       add_func _ZN5blink14ResourceLoader5startEv res_will
-       add_func _ZN5blink14ResourceLoader16didFinishLoadingEPNS_12WebURLLoaderEdx res_finish
-       add_func _ZN7content23CompositorOutputSurface11SwapBuffersEPN2cc15CompositorFrameE redraw
-
-       IFS=$'\n'
-
-       array=`gen_array`
-       if [ $? -ne 0 ]; then
-               exit 1
-       fi
-
-       cat <<- EOF
-
-               /*
-                * Autogenerated header
-                */
-
-               #ifndef __WSP_DATA__
-               #define __WSP_DATA__
-
-               struct wsp_data {
-                       const char *name;
-                       const char *nick_name;
-                       unsigned long addr;
-               };
-
-               static struct wsp_data wsp_data[] = {
-               ${array}
-               };
-
-               enum {
-                       wsp_data_cnt = sizeof(wsp_data) / sizeof(struct wsp_data)
-               };
-
-               #endif /* __WSP_DATA__ */
-
-EOF
-}
-
-function gen_script_out()
-{
-       webapp_package_name=crosswalk-tizen
-       path_webapp=`rpm -ql $webapp_package_name | grep "wrt-loader" | head -1`
-
-       cat <<- EOF
-
-               #!/bin/bash
-
-               #WSP initialze autogenerated script
-               PATH=/bin:/usr/bin:/sbin:/usr/sbin
-               /bin/echo "$path_webapp" > $webapp_path
-               /bin/echo "$path_libchromium" > $ewebkit_path
-
-EOF
-}
-
-if [ "$1" == "-h" ]; then
-       gen_header_out
-elif [ "$1" == "-s" ]; then
-       gen_script_out
-else
-       exit 1
-fi
index 679b41dbe12af85a6defbb569581e854882df934..5483a929de7dd01b8c775a23b7deca3c6481a84c 100755 (executable)
@@ -31,7 +31,6 @@ swap_retprobe.ko \
 swap_fbiprobe.ko \
 swap_loader.ko \
 swap_preload.ko \
-swap_wsp.ko \
 swap_nsp.ko \
 swap_gtp.ko \
 "
index 6477d9d00a4d1dad1b3b2960ebd9494e0ad84d6d..3aa640919e0782be153fc803444ab8701adf3403 100755 (executable)
@@ -97,12 +97,6 @@ then
        /usr/bin/swap_init_preload.sh
 fi
 
-#WSP
-if [ -d /sys/kernel/debug/swap/wsp/ ]
-then
-       /usr/bin/swap_init_wsp.sh
-fi
-
 #GOT patcher
 if [ -d /sys/kernel/debug/swap/got_patcher/ ]
 then