From: Vitaliy Cherepanov Date: Wed, 25 Jun 2014 09:40:42 +0000 (+0400) Subject: [FIX] application termination X-Git-Tag: Tizen_SDK_2.3~62 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F25%2F23425%2F3;p=platform%2Fcore%2Fsystem%2Fswap-probe.git [FIX] application termination fixed application termination without ld preloaded lib destructor Change-Id: Ib52079a73f9ff4944fcc7c40ffaf14e761cfe3fc Signed-off-by: Vitaliy Cherepanov --- diff --git a/Makefile b/Makefile index f8277f5..c4e7a0b 100644 --- a/Makefile +++ b/Makefile @@ -88,8 +88,6 @@ PROBE_SRCS = \ DUMMY_SRCS = ./custom_chart/da_chart_dummy.c CAPI_SRCS = $(COMMON_SRCS) \ - ./helper/appfw-capi.c \ - ./helper/addr-capi.c \ ./probe_capi/capi_appfw.c \ ./probe_ui/capi_capture.c diff --git a/helper/addr-capi.c b/helper/addr-capi.c deleted file mode 100644 index 741959e..0000000 --- a/helper/addr-capi.c +++ /dev/null @@ -1,60 +0,0 @@ -/* - * DA probe - * - * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * - * Jaewon Lim - * Woojin Jung - * Juyoung Kim - * Anastasia Lyupa - * - * This library is free software; you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your option) - * any later version. - * - * This library is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public - * License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this library; if not, write to the Free Software Foundation, Inc., 51 - * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Contributors: - * - S-Core Co., Ltd - * - Samsung RnD Institute Russia - * - */ - -#include -#include "daprobe.h" -#include "dahelper.h" - -int get_map_address(void* sym, void** start, void** end); - -int getExecutableMappingAddress() -{ - int ret = 0; - void* main_symbol; - - probeBlockStart(); - main_symbol = dlsym(RTLD_NEXT, "main"); - if(main_symbol != NULL) - { - ret = get_map_address(main_symbol, &(gTraceInfo.exec_map.map_start), - &(gTraceInfo.exec_map.map_end)); - } - else - { - // failed to get address of main - ret = 0; - } - probeBlockEnd(); - - return ret; -} - diff --git a/helper/addr-tizen.c b/helper/addr-tizen.c index d791780..dabe6c5 100644 --- a/helper/addr-tizen.c +++ b/helper/addr-tizen.c @@ -38,20 +38,18 @@ int get_map_address(void* sym, void** start, void** end); int getExecutableMappingAddress() { - int ret = 0; - void* main_symbol; + int ret = 0, i = 0; + void *main_symbol; + static const char *funcs[] = {"OspMain", "main"}; probeBlockStart(); - main_symbol = dlsym(RTLD_NEXT, "OspMain"); - if(main_symbol != NULL) - { - ret = get_map_address(main_symbol, &(gTraceInfo.exec_map.map_start), - &(gTraceInfo.exec_map.map_end)); - } - else - { - // failed to get address of OspMain - ret = 0; + for (i = 0; i < (int)(sizeof(funcs)/sizeof(funcs[0])); i++){ + main_symbol = dlsym(RTLD_NEXT, funcs[i]); + if(main_symbol != NULL) { + ret = get_map_address(main_symbol, &(gTraceInfo.exec_map.map_start), + &(gTraceInfo.exec_map.map_end)); + break; + } } probeBlockEnd(); diff --git a/helper/appfw-capi.c b/helper/appfw-capi.c deleted file mode 100644 index 6dfbc4f..0000000 --- a/helper/appfw-capi.c +++ /dev/null @@ -1,39 +0,0 @@ -/* - * DA probe - * - * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * - * Jaewon Lim - * Woojin Jung - * Juyoung Kim - * - * This library is free software; you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your option) - * any later version. - * - * This library is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public - * License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this library; if not, write to the Free Software Foundation, Inc., 51 - * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Contributors: - * - S-Core Co., Ltd - * - */ - -#include -#include "dahelper.h" - -void application_exit() -{ - PRINTMSG("EXIT appfw-capi"); - app_efl_exit(); -} - diff --git a/helper/libdaprobe.c b/helper/libdaprobe.c index 412e344..2f401f9 100755 --- a/helper/libdaprobe.c +++ b/helper/libdaprobe.c @@ -204,6 +204,12 @@ static pid_t _gettid() return gTid; } +void application_exit() +{ + PRINTMSG("EXIT appfw-capi"); + app_efl_exit(); +} + static void *recvThread(void __unused * data) { fd_set readfds, workfds; @@ -283,7 +289,9 @@ static void *recvThread(void __unused * data) } else if(log.type == MSG_STOP) { + PRINTMSG("MSG_STOP"); application_exit(); + break; } else { diff --git a/include/dahelper.h b/include/dahelper.h index feceba5..f20835a 100755 --- a/include/dahelper.h +++ b/include/dahelper.h @@ -212,7 +212,6 @@ int __profil(int mode); //wchar_t* -> char* void WcharToChar(char* pstrDest, const wchar_t* pwstrSrc); char *absolutize_filepath(char buf[PATH_MAX], const char *fname); -void application_exit(); // screen capture functions int initialize_screencapture();