Remove real_functions.c/h 66/110266/2
authorAlexander Aksenov <a.aksenov@samsung.com>
Tue, 27 Dec 2016 11:57:52 +0000 (14:57 +0300)
committerAlexander Aksenov <a.aksenov@samsung.com>
Mon, 16 Jan 2017 11:16:11 +0000 (14:16 +0300)
It was legacy mechanism for working with native LD_PRELOAD.

Change-Id: I738cbbbc5e3ce77a3d6039341fbbb7d2745787a4
Signed-off-by: Alexander Aksenov <a.aksenov@samsung.com>
23 files changed:
Makefile
custom_chart/da_chart.c
helper/common_probe_init.c
helper/dacapture.c
helper/dacollection.c
helper/libdaprobe.c
helper/real_functions.c [deleted file]
include/dacollection.h
include/real_functions.h [deleted file]
probe_capi/capi_appfw.c
probe_event/da_event.c
probe_event/keytouch.c
probe_file/da_io_posix.c
probe_file/da_io_stdc.c
probe_graphics/da_evas_gl.c
probe_graphics/da_gl_api_init.c
probe_graphics/da_gles20.inc
probe_graphics/da_gles30_native.cpp
probe_memory/libdamemmanage.c
probe_socket/libdasocket.c
probe_third/libdaemon.c
probe_thread/libdasync.c
probe_thread/libdathread.c

index 2027295..05ddb18 100644 (file)
--- 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         \
index 723ebd5..f28b078 100755 (executable)
@@ -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;
index 08b7967..326f173 100644 (file)
@@ -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);
index dd3f341..e9a220a 100755 (executable)
@@ -57,7 +57,6 @@
 #include <tizen-extension-client-protocol.h>
 #include <screenshooter-client-protocol.h>
 
-#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);
index 0d3f89a..e916e52 100755 (executable)
@@ -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);
index 2fa47fc..0e86915 100755 (executable)
@@ -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 (file)
index ac287fc..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- *  DA probe
- *
- * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact:
- *
- * Vitaliy Cherepanov <v.cherepanov@samsung.com>
- *
- * 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 <stdint.h>                    // 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;
-}
index 8027281..590622c 100755 (executable)
@@ -34,7 +34,6 @@
 #include <pthread.h>                   // 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 (file)
index b06904e..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- *  DA probe
- *
- * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact:
- *
- * Vitaliy Cherepanov <v.cherepanov@samsung.com>
- *
- * 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_ */
index 94f811d..f950cfb 100644 (file)
@@ -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"
index fa83c16..3a1b689 100755 (executable)
@@ -41,7 +41,6 @@
 #include "da_event.h"
 
 #include "binproto.h"
-#include "real_functions.h"
 
 
 // ===================================================================
index ba924f8..9557536 100755 (executable)
@@ -50,7 +50,6 @@
 #include "da_event.h"
 
 #include "binproto.h"
-#include "real_functions.h"
 #include "event_probes_list.h"
 #include "probe_event.h"
 
index 5193663..b6c4ab9 100755 (executable)
@@ -50,7 +50,6 @@
 #include <errno.h>
 
 #include "binproto.h"
-#include "real_functions.h"
 #include "file_probes_list.h"
 #include "probe_file.h"
 
index 5ee1dbb..c23a2cb 100644 (file)
@@ -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"
index d971915..debbd42 100644 (file)
@@ -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"
 
index 568d8aa..f601348 100644 (file)
@@ -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);
index cefc001..3106f8d 100644 (file)
@@ -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 */
index 861de5e..8e71ac9 100644 (file)
@@ -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 */
index 6934241..f7c41e8 100644 (file)
@@ -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"
 
index 2721dec..0b105d7 100644 (file)
@@ -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"
 
index 04661e3..fb45542 100644 (file)
@@ -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)
index f06c370..b63faf3 100644 (file)
@@ -39,7 +39,6 @@
 #include "da_sync.h"
 
 #include "binproto.h"
-#include "real_functions.h"
 #include "thread_probes_list.h"
 #include "probe_thread.h"
 
index 0f8bdda..62ac59f 100644 (file)
@@ -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;