From 9ba8c1090baddfa450bf0f2c7ce60ddd9ad04c5c Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Tue, 27 Dec 2016 14:57:52 +0300 Subject: [PATCH] Remove real_functions.c/h It was legacy mechanism for working with native LD_PRELOAD. Change-Id: I738cbbbc5e3ce77a3d6039341fbbb7d2745787a4 Signed-off-by: Alexander Aksenov --- Makefile | 1 - custom_chart/da_chart.c | 4 ++-- helper/common_probe_init.c | 1 - helper/dacapture.c | 3 +-- helper/dacollection.c | 4 ++-- helper/libdaprobe.c | 10 +--------- helper/real_functions.c | 38 ------------------------------------- include/dacollection.h | 1 - include/real_functions.h | 36 ----------------------------------- probe_capi/capi_appfw.c | 1 - probe_event/da_event.c | 1 - probe_event/keytouch.c | 1 - probe_file/da_io_posix.c | 1 - probe_file/da_io_stdc.c | 1 - probe_graphics/da_evas_gl.c | 1 - probe_graphics/da_gl_api_init.c | 1 - probe_graphics/da_gles20.inc | 1 - probe_graphics/da_gles30_native.cpp | 1 - probe_memory/libdamemmanage.c | 1 - probe_socket/libdasocket.c | 1 - probe_third/libdaemon.c | 4 +--- probe_thread/libdasync.c | 1 - probe_thread/libdathread.c | 3 +-- 23 files changed, 8 insertions(+), 109 deletions(-) delete mode 100644 helper/real_functions.c delete mode 100644 include/real_functions.h diff --git a/Makefile b/Makefile index 2027295..05ddb18 100644 --- a/Makefile +++ b/Makefile @@ -99,7 +99,6 @@ TIZEN_LDFLAGS = -lstdc++ COMMON_SRCS = $(UTILITY_SRCS) $(PROBE_SRCS) UTILITY_SRCS = \ ./helper/lsan_open.c \ - ./helper/real_functions.c \ ./helper/libdaprobe.c \ ./helper/dahelper.c \ ./helper/dacollection.c \ diff --git a/custom_chart/da_chart.c b/custom_chart/da_chart.c index 723ebd5..f28b078 100755 --- a/custom_chart/da_chart.c +++ b/custom_chart/da_chart.c @@ -46,7 +46,6 @@ #include "da_chart.h" #include "binproto.h" -#include "real_functions.h" #define ERR_THREAD_CREATE_FAIL -2001 // thread creation fail @@ -222,7 +221,8 @@ static void add_to_callback_list(chart_interval interval, da_handle charthandle, { chart_interval_callback* newelem; - newelem = (chart_interval_callback*)real_malloc(sizeof(chart_interval_callback)); + newelem = + (chart_interval_callback *)malloc(sizeof(chart_interval_callback)); newelem->chart_handle = charthandle; newelem->series_handle = series_handle; newelem->callback = callback; diff --git a/helper/common_probe_init.c b/helper/common_probe_init.c index 08b7967..326f173 100644 --- a/helper/common_probe_init.c +++ b/helper/common_probe_init.c @@ -30,7 +30,6 @@ #include "da_gles20.h" #include "binproto.h" #include "common_probe_init.h" -#include "real_functions.h" //#define EGL_TEST void (*real_glGetVertexAttribfv)(GLuint index, GLenum pname, GLfloat *params); diff --git a/helper/dacapture.c b/helper/dacapture.c index dd3f341..e9a220a 100755 --- a/helper/dacapture.c +++ b/helper/dacapture.c @@ -57,7 +57,6 @@ #include #include -#include "real_functions.h" #include "daprobe.h" #include "dahelper.h" @@ -269,7 +268,7 @@ static Evas* create_canvas(int width, int height) } // ARGB32 is sizeof(int), that is 4 bytes, per pixel - pixels = real_malloc(width * height * sizeof(int)); + pixels = malloc(width * height * sizeof(int)); if (unlikely(pixels == NULL)) { PRINTERR("could not allocate canvas pixels!"); __evas_free_p(canvas); diff --git a/helper/dacollection.c b/helper/dacollection.c index 0d3f89a..e916e52 100755 --- a/helper/dacollection.c +++ b/helper/dacollection.c @@ -214,11 +214,11 @@ int add_to_glist(char* key, void* data) elm = find_element(key); if (elm == NULL) { - elm = (element_t*)real_malloc(sizeof(element_t)); + elm = (element_t *)malloc(sizeof(element_t)); if (likely(elm != NULL)) { elm->keylen = strlen(key); - elm->keystr = (char*)real_malloc(elm->keylen + 1); + elm->keystr = (char *)malloc(elm->keylen + 1); if (likely(elm->keystr != NULL)) { memcpy(elm->keystr, key, elm->keylen + 1); diff --git a/helper/libdaprobe.c b/helper/libdaprobe.c index 2fa47fc..0e86915 100755 --- a/helper/libdaprobe.c +++ b/helper/libdaprobe.c @@ -62,7 +62,6 @@ #include "daforkexec.h" #include "dastdout.h" #include "common_probe_init.h" -#include "real_functions.h" #include "lsan_open.h" #include "got_patching.h" @@ -206,7 +205,7 @@ static int create_socket(void) if (recvlen > 0) {/* recv succeed */ char *data_buf = NULL; - data_buf = real_malloc(log.length); + data_buf = malloc(log.length); if (data_buf == NULL) { PRINTERR("cannot allocate buf to recv msg"); @@ -561,13 +560,6 @@ void _init_(void) void __attribute__((constructor)) _init_probe() { - - if (_init_real_functions()) { - PRINTERR("cannot init real functions\n"); - exit(1); - } - rtdl_next_set_once(real_malloc, "malloc"); - /* init library */ _init_(); diff --git a/helper/real_functions.c b/helper/real_functions.c deleted file mode 100644 index ac287fc..0000000 --- a/helper/real_functions.c +++ /dev/null @@ -1,38 +0,0 @@ -/* - * DA probe - * - * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * - * Vitaliy Cherepanov - * - * 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 // fot uint32_t,uint64_t -#include "daprobe.h" - -void *(*real_malloc)(size_t) = NULL; - -int _init_real_functions() -{ - rtdl_next_set_once(real_malloc, "malloc"); - return 0; -} diff --git a/include/dacollection.h b/include/dacollection.h index 8027281..590622c 100755 --- a/include/dacollection.h +++ b/include/dacollection.h @@ -34,7 +34,6 @@ #include // for pthread_mutex_t #include "khash.h" -#include "real_functions.h" #ifdef __cplusplus extern "C"{ diff --git a/include/real_functions.h b/include/real_functions.h deleted file mode 100644 index b06904e..0000000 --- a/include/real_functions.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * DA probe - * - * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * - * Vitaliy Cherepanov - * - * 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 - * - */ - -#ifndef _REAL_FUNCTIONS_H_ -#define _REAL_FUNCTIONS_H_ - -/* real malloc function pointer */ -extern void *(*real_malloc)(size_t); - -extern int _init_real_functions(); -#endif /* _REAL_FUNCTIONS_H_ */ diff --git a/probe_capi/capi_appfw.c b/probe_capi/capi_appfw.c index 94f811d..f950cfb 100644 --- a/probe_capi/capi_appfw.c +++ b/probe_capi/capi_appfw.c @@ -36,7 +36,6 @@ #include "dahelper.h" #include "probeinfo.h" #include "binproto.h" -#include "real_functions.h" #include "common_probe_init.h" #include "capi_probes_list.h" #include "probe_capi.h" diff --git a/probe_event/da_event.c b/probe_event/da_event.c index fa83c16..3a1b689 100755 --- a/probe_event/da_event.c +++ b/probe_event/da_event.c @@ -41,7 +41,6 @@ #include "da_event.h" #include "binproto.h" -#include "real_functions.h" // =================================================================== diff --git a/probe_event/keytouch.c b/probe_event/keytouch.c index ba924f8..9557536 100755 --- a/probe_event/keytouch.c +++ b/probe_event/keytouch.c @@ -50,7 +50,6 @@ #include "da_event.h" #include "binproto.h" -#include "real_functions.h" #include "event_probes_list.h" #include "probe_event.h" diff --git a/probe_file/da_io_posix.c b/probe_file/da_io_posix.c index 5193663..b6c4ab9 100755 --- a/probe_file/da_io_posix.c +++ b/probe_file/da_io_posix.c @@ -50,7 +50,6 @@ #include #include "binproto.h" -#include "real_functions.h" #include "file_probes_list.h" #include "probe_file.h" diff --git a/probe_file/da_io_stdc.c b/probe_file/da_io_stdc.c index 5ee1dbb..c23a2cb 100644 --- a/probe_file/da_io_stdc.c +++ b/probe_file/da_io_stdc.c @@ -42,7 +42,6 @@ #include "da_io.h" #include "binproto.h" -#include "real_functions.h" #include "aliases.h" #include "file_probes_list.h" #include "probe_file.h" diff --git a/probe_graphics/da_evas_gl.c b/probe_graphics/da_evas_gl.c index d971915..debbd42 100644 --- a/probe_graphics/da_evas_gl.c +++ b/probe_graphics/da_evas_gl.c @@ -30,7 +30,6 @@ #include "daprobe.h" #include "binproto.h" #include "common_probe_init.h" -#include "real_functions.h" #include "graphics_probes_list.h" #include "probe_graphics.h" diff --git a/probe_graphics/da_gl_api_init.c b/probe_graphics/da_gl_api_init.c index 568d8aa..f601348 100644 --- a/probe_graphics/da_gl_api_init.c +++ b/probe_graphics/da_gl_api_init.c @@ -30,7 +30,6 @@ #include "da_gles20.h" #include "binproto.h" #include "common_probe_init.h" -#include "real_functions.h" /* GL __local_* functions prototypes */ #define X(func) extern void __local_##func(void); diff --git a/probe_graphics/da_gles20.inc b/probe_graphics/da_gles20.inc index cefc001..3106f8d 100644 --- a/probe_graphics/da_gles20.inc +++ b/probe_graphics/da_gles20.inc @@ -30,7 +30,6 @@ */ #include "da_gles20.h" #include "daprobe.h" -#include "real_functions.h" #include "common_probe_init.h" static char contextValue[MAX_GL_CONTEXT_VALUE_SIZE]; /* maybe it should not be gobal static variable */ diff --git a/probe_graphics/da_gles30_native.cpp b/probe_graphics/da_gles30_native.cpp index 861de5e..8e71ac9 100644 --- a/probe_graphics/da_gles30_native.cpp +++ b/probe_graphics/da_gles30_native.cpp @@ -19,7 +19,6 @@ #define TYPEDEF(type) typedef type #include "daprobe.h" -#include "real_functions.h" #include "common_probe_init.h" /* TODO search real definition */ diff --git a/probe_memory/libdamemmanage.c b/probe_memory/libdamemmanage.c index 6934241..f7c41e8 100644 --- a/probe_memory/libdamemmanage.c +++ b/probe_memory/libdamemmanage.c @@ -42,7 +42,6 @@ #include "da_memory.h" #include "binproto.h" #include "common_probe_init.h" -#include "real_functions.h" #include "memory_probes_list.h" #include "probe_memory.h" diff --git a/probe_socket/libdasocket.c b/probe_socket/libdasocket.c index 2721dec..0b105d7 100644 --- a/probe_socket/libdasocket.c +++ b/probe_socket/libdasocket.c @@ -51,7 +51,6 @@ #include "dahelper.h" #include "api_id_mapping.h" #include "binproto.h" -#include "real_functions.h" #include "socket_probes_list.h" #include "probe_socket.h" diff --git a/probe_third/libdaemon.c b/probe_third/libdaemon.c index 04661e3..fb45542 100644 --- a/probe_third/libdaemon.c +++ b/probe_third/libdaemon.c @@ -34,8 +34,6 @@ #include "daprobe.h" #include "dahelper.h" -#include "real_functions.h" - int daemon_close_allv(const int except_fds[]) { static int (*daemon_close_allvp)(const int except_fds[]); @@ -52,7 +50,7 @@ int daemon_close_allv(const int except_fds[]) } // allocate memory for new except fds - fds = (int*)real_malloc((i + 2) * sizeof(int)); + fds = (int *)malloc((i + 2) * sizeof(int)); // copy fds if(fds) diff --git a/probe_thread/libdasync.c b/probe_thread/libdasync.c index f06c370..b63faf3 100644 --- a/probe_thread/libdasync.c +++ b/probe_thread/libdasync.c @@ -39,7 +39,6 @@ #include "da_sync.h" #include "binproto.h" -#include "real_functions.h" #include "thread_probes_list.h" #include "probe_thread.h" diff --git a/probe_thread/libdathread.c b/probe_thread/libdathread.c index 0f8bdda..62ac59f 100644 --- a/probe_thread/libdathread.c +++ b/probe_thread/libdathread.c @@ -38,7 +38,6 @@ #include "da_thread.h" #include "da_sync.h" #include "binproto.h" -#include "real_functions.h" #include "thread_probes_list.h" #include "probe_thread.h" #include "lsan_open.h" @@ -81,7 +80,7 @@ HANDLER_WRAPPERS(thread_feature, int, pthread_create, pthread_t *, thread, if(blockresult) { thread_routine_call *ptrc = - (thread_routine_call *) real_malloc(sizeof(thread_routine_call)); + (thread_routine_call *)malloc(sizeof(thread_routine_call)); ptrc->thread_routine = start_routine; ptrc->argument = arg; -- 2.7.4