diff options
Diffstat (limited to 'tools/perf')
-rw-r--r-- | tools/perf/builtin-record.c | 31 | ||||
-rw-r--r-- | tools/perf/config/Makefile | 8 | ||||
-rw-r--r-- | tools/perf/config/feature-checks/Makefile | 4 | ||||
-rw-r--r-- | tools/perf/config/feature-checks/test-all.c | 5 | ||||
-rw-r--r-- | tools/perf/config/feature-checks/test-on-exit.c | 16 |
5 files changed, 0 insertions, 64 deletions
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c index 2e0d484068d2..e4c85b8f46c2 100644 --- a/tools/perf/builtin-record.c +++ b/tools/perf/builtin-record.c | |||
@@ -30,37 +30,6 @@ | |||
30 | #include <sched.h> | 30 | #include <sched.h> |
31 | #include <sys/mman.h> | 31 | #include <sys/mman.h> |
32 | 32 | ||
33 | #ifndef HAVE_ON_EXIT_SUPPORT | ||
34 | #ifndef ATEXIT_MAX | ||
35 | #define ATEXIT_MAX 32 | ||
36 | #endif | ||
37 | static int __on_exit_count = 0; | ||
38 | typedef void (*on_exit_func_t) (int, void *); | ||
39 | static on_exit_func_t __on_exit_funcs[ATEXIT_MAX]; | ||
40 | static void *__on_exit_args[ATEXIT_MAX]; | ||
41 | static int __exitcode = 0; | ||
42 | static void __handle_on_exit_funcs(void); | ||
43 | static int on_exit(on_exit_func_t function, void *arg); | ||
44 | #define exit(x) (exit)(__exitcode = (x)) | ||
45 | |||
46 | static int on_exit(on_exit_func_t function, void *arg) | ||
47 | { | ||
48 | if (__on_exit_count == ATEXIT_MAX) | ||
49 | return -ENOMEM; | ||
50 | else if (__on_exit_count == 0) | ||
51 | atexit(__handle_on_exit_funcs); | ||
52 | __on_exit_funcs[__on_exit_count] = function; | ||
53 | __on_exit_args[__on_exit_count++] = arg; | ||
54 | return 0; | ||
55 | } | ||
56 | |||
57 | static void __handle_on_exit_funcs(void) | ||
58 | { | ||
59 | int i; | ||
60 | for (i = 0; i < __on_exit_count; i++) | ||
61 | __on_exit_funcs[i] (__exitcode, __on_exit_args[i]); | ||
62 | } | ||
63 | #endif | ||
64 | 33 | ||
65 | struct record { | 34 | struct record { |
66 | struct perf_tool tool; | 35 | struct perf_tool tool; |
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile index 150c84c7416d..f2edc593a7a7 100644 --- a/tools/perf/config/Makefile +++ b/tools/perf/config/Makefile | |||
@@ -174,7 +174,6 @@ CORE_FEATURE_TESTS = \ | |||
174 | libpython-version \ | 174 | libpython-version \ |
175 | libslang \ | 175 | libslang \ |
176 | libunwind \ | 176 | libunwind \ |
177 | on-exit \ | ||
178 | stackprotector-all \ | 177 | stackprotector-all \ |
179 | timerfd \ | 178 | timerfd \ |
180 | libdw-dwarf-unwind | 179 | libdw-dwarf-unwind |
@@ -200,7 +199,6 @@ VF_FEATURE_TESTS = \ | |||
200 | libelf-getphdrnum \ | 199 | libelf-getphdrnum \ |
201 | libelf-mmap \ | 200 | libelf-mmap \ |
202 | libpython-version \ | 201 | libpython-version \ |
203 | on-exit \ | ||
204 | stackprotector-all \ | 202 | stackprotector-all \ |
205 | timerfd \ | 203 | timerfd \ |
206 | libunwind-debug-frame \ | 204 | libunwind-debug-frame \ |
@@ -571,12 +569,6 @@ ifneq ($(filter -lbfd,$(EXTLIBS)),) | |||
571 | CFLAGS += -DHAVE_LIBBFD_SUPPORT | 569 | CFLAGS += -DHAVE_LIBBFD_SUPPORT |
572 | endif | 570 | endif |
573 | 571 | ||
574 | ifndef NO_ON_EXIT | ||
575 | ifeq ($(feature-on-exit), 1) | ||
576 | CFLAGS += -DHAVE_ON_EXIT_SUPPORT | ||
577 | endif | ||
578 | endif | ||
579 | |||
580 | ifndef NO_BACKTRACE | 572 | ifndef NO_BACKTRACE |
581 | ifeq ($(feature-backtrace), 1) | 573 | ifeq ($(feature-backtrace), 1) |
582 | CFLAGS += -DHAVE_BACKTRACE_SUPPORT | 574 | CFLAGS += -DHAVE_BACKTRACE_SUPPORT |
diff --git a/tools/perf/config/feature-checks/Makefile b/tools/perf/config/feature-checks/Makefile index 2da103c53f89..64c84e5f0514 100644 --- a/tools/perf/config/feature-checks/Makefile +++ b/tools/perf/config/feature-checks/Makefile | |||
@@ -24,7 +24,6 @@ FILES= \ | |||
24 | test-libslang.bin \ | 24 | test-libslang.bin \ |
25 | test-libunwind.bin \ | 25 | test-libunwind.bin \ |
26 | test-libunwind-debug-frame.bin \ | 26 | test-libunwind-debug-frame.bin \ |
27 | test-on-exit.bin \ | ||
28 | test-stackprotector-all.bin \ | 27 | test-stackprotector-all.bin \ |
29 | test-timerfd.bin \ | 28 | test-timerfd.bin \ |
30 | test-libdw-dwarf-unwind.bin | 29 | test-libdw-dwarf-unwind.bin |
@@ -133,9 +132,6 @@ test-liberty-z.bin: | |||
133 | test-cplus-demangle.bin: | 132 | test-cplus-demangle.bin: |
134 | $(BUILD) -liberty | 133 | $(BUILD) -liberty |
135 | 134 | ||
136 | test-on-exit.bin: | ||
137 | $(BUILD) | ||
138 | |||
139 | test-backtrace.bin: | 135 | test-backtrace.bin: |
140 | $(BUILD) | 136 | $(BUILD) |
141 | 137 | ||
diff --git a/tools/perf/config/feature-checks/test-all.c b/tools/perf/config/feature-checks/test-all.c index fc37eb3ca17b..fe5c1e5c952f 100644 --- a/tools/perf/config/feature-checks/test-all.c +++ b/tools/perf/config/feature-checks/test-all.c | |||
@@ -69,10 +69,6 @@ | |||
69 | # include "test-libbfd.c" | 69 | # include "test-libbfd.c" |
70 | #undef main | 70 | #undef main |
71 | 71 | ||
72 | #define main main_test_on_exit | ||
73 | # include "test-on-exit.c" | ||
74 | #undef main | ||
75 | |||
76 | #define main main_test_backtrace | 72 | #define main main_test_backtrace |
77 | # include "test-backtrace.c" | 73 | # include "test-backtrace.c" |
78 | #undef main | 74 | #undef main |
@@ -110,7 +106,6 @@ int main(int argc, char *argv[]) | |||
110 | main_test_gtk2(argc, argv); | 106 | main_test_gtk2(argc, argv); |
111 | main_test_gtk2_infobar(argc, argv); | 107 | main_test_gtk2_infobar(argc, argv); |
112 | main_test_libbfd(); | 108 | main_test_libbfd(); |
113 | main_test_on_exit(); | ||
114 | main_test_backtrace(); | 109 | main_test_backtrace(); |
115 | main_test_libnuma(); | 110 | main_test_libnuma(); |
116 | main_test_timerfd(); | 111 | 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 index 8e88b16e6ded..000000000000 --- a/tools/perf/config/feature-checks/test-on-exit.c +++ /dev/null | |||
@@ -1,16 +0,0 @@ | |||
1 | #include <stdio.h> | ||
2 | #include <stdlib.h> | ||
3 | |||
4 | static void exit_fn(int status, void *__data) | ||
5 | { | ||
6 | printf("exit status: %d, data: %d\n", status, *(int *)__data); | ||
7 | } | ||
8 | |||
9 | static int data = 123; | ||
10 | |||
11 | int main(void) | ||
12 | { | ||
13 | on_exit(exit_fn, &data); | ||
14 | |||
15 | return 321; | ||
16 | } | ||