perf tools: Get rid of on_exit() feature test
authorNamhyung Kim <namhyung@kernel.org>
Mon, 12 May 2014 00:47:25 +0000 (09:47 +0900)
committerJiri Olsa <jolsa@kernel.org>
Mon, 12 May 2014 09:09:50 +0000 (11:09 +0200)
The on_exit() function was only used in perf record but it's gone in
previous patch.

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Acked-by: Stephane Eranian <eranian@google.com>
Cc: Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org>
Cc: Irina Tirdea <irina.tirdea@intel.com>
Link: http://lkml.kernel.org/r/1399855645-25815-2-git-send-email-namhyung@kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
tools/perf/builtin-record.c
tools/perf/config/Makefile
tools/perf/config/feature-checks/Makefile
tools/perf/config/feature-checks/test-all.c
tools/perf/config/feature-checks/test-on-exit.c [deleted file]

index 2e0d484068d2295182b3da82c1ba15c7a74aafff..e4c85b8f46c29fd7526e0bea3ef419ba7884acd3 100644 (file)
 #include <sched.h>
 #include <sys/mman.h>
 
-#ifndef HAVE_ON_EXIT_SUPPORT
-#ifndef ATEXIT_MAX
-#define ATEXIT_MAX 32
-#endif
-static int __on_exit_count = 0;
-typedef void (*on_exit_func_t) (int, void *);
-static on_exit_func_t __on_exit_funcs[ATEXIT_MAX];
-static void *__on_exit_args[ATEXIT_MAX];
-static int __exitcode = 0;
-static void __handle_on_exit_funcs(void);
-static int on_exit(on_exit_func_t function, void *arg);
-#define exit(x) (exit)(__exitcode = (x))
-
-static int on_exit(on_exit_func_t function, void *arg)
-{
-       if (__on_exit_count == ATEXIT_MAX)
-               return -ENOMEM;
-       else if (__on_exit_count == 0)
-               atexit(__handle_on_exit_funcs);
-       __on_exit_funcs[__on_exit_count] = function;
-       __on_exit_args[__on_exit_count++] = arg;
-       return 0;
-}
-
-static void __handle_on_exit_funcs(void)
-{
-       int i;
-       for (i = 0; i < __on_exit_count; i++)
-               __on_exit_funcs[i] (__exitcode, __on_exit_args[i]);
-}
-#endif
 
 struct record {
        struct perf_tool        tool;
index 150c84c7416d282fce506fc4b19000de45589274..f2edc593a7a72cf2f5198380903816a3e01c3abf 100644 (file)
@@ -174,7 +174,6 @@ CORE_FEATURE_TESTS =                        \
        libpython-version               \
        libslang                        \
        libunwind                       \
-       on-exit                         \
        stackprotector-all              \
        timerfd                         \
        libdw-dwarf-unwind
@@ -200,7 +199,6 @@ VF_FEATURE_TESTS =                  \
        libelf-getphdrnum               \
        libelf-mmap                     \
        libpython-version               \
-       on-exit                         \
        stackprotector-all              \
        timerfd                         \
        libunwind-debug-frame           \
@@ -571,12 +569,6 @@ ifneq ($(filter -lbfd,$(EXTLIBS)),)
   CFLAGS += -DHAVE_LIBBFD_SUPPORT
 endif
 
-ifndef NO_ON_EXIT
-  ifeq ($(feature-on-exit), 1)
-    CFLAGS += -DHAVE_ON_EXIT_SUPPORT
-  endif
-endif
-
 ifndef NO_BACKTRACE
   ifeq ($(feature-backtrace), 1)
     CFLAGS += -DHAVE_BACKTRACE_SUPPORT
index 2da103c53f892762b0ad634e1d60669a7c4b5b8a..64c84e5f0514eb7491d2774d4237e401665cca51 100644 (file)
@@ -24,7 +24,6 @@ FILES=                                        \
        test-libslang.bin               \
        test-libunwind.bin              \
        test-libunwind-debug-frame.bin  \
-       test-on-exit.bin                \
        test-stackprotector-all.bin     \
        test-timerfd.bin                \
        test-libdw-dwarf-unwind.bin
@@ -133,9 +132,6 @@ test-liberty-z.bin:
 test-cplus-demangle.bin:
        $(BUILD) -liberty
 
-test-on-exit.bin:
-       $(BUILD)
-
 test-backtrace.bin:
        $(BUILD)
 
index fc37eb3ca17b9121c60ae47133b540896700756c..fe5c1e5c952fdda56d1b49d577995b1b88e5180d 100644 (file)
 # include "test-libbfd.c"
 #undef main
 
-#define main main_test_on_exit
-# include "test-on-exit.c"
-#undef main
-
 #define main main_test_backtrace
 # include "test-backtrace.c"
 #undef main
@@ -110,7 +106,6 @@ int main(int argc, char *argv[])
        main_test_gtk2(argc, argv);
        main_test_gtk2_infobar(argc, argv);
        main_test_libbfd();
-       main_test_on_exit();
        main_test_backtrace();
        main_test_libnuma();
        main_test_timerfd();
diff --git a/tools/perf/config/feature-checks/test-on-exit.c b/tools/perf/config/feature-checks/test-on-exit.c
deleted file mode 100644 (file)
index 8e88b16..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-
-static void exit_fn(int status, void *__data)
-{
-       printf("exit status: %d, data: %d\n", status, *(int *)__data);
-}
-
-static int data = 123;
-
-int main(void)
-{
-       on_exit(exit_fn, &data);
-
-       return 321;
-}