diff options
author | Mikael Pettersson <[email protected]> | 2015-02-08 21:19:35 +0100 |
---|---|---|
committer | Zandra Hird <[email protected]> | 2015-02-19 09:46:32 +0100 |
commit | cfa9229ba1eb8851caecfc92ca1bc9813fb1d567 (patch) | |
tree | 2009b00c72b79734f5c433ab6afb5eae544607f3 /erts/emulator/beam/benchmark.h | |
parent | 9d8327c62a981bcc436e5f9fc5466f5539dce3dc (diff) | |
download | otp-cfa9229ba1eb8851caecfc92ca1bc9813fb1d567.tar.gz otp-cfa9229ba1eb8851caecfc92ca1bc9813fb1d567.tar.bz2 otp-cfa9229ba1eb8851caecfc92ca1bc9813fb1d567.zip |
remove perfctr support
Perfctr is a Linux kernel extension that allows programmatic access
to the performance monitoring counters found in most current CPUs.
However, development of perfctr ceased after 2010, and it cannot be
used with Linux kernels newer than 2.6.32.
Therefore the perfctr support code in the Erlang VM is effectively
dead code, so this patch removes it.
Diffstat (limited to 'erts/emulator/beam/benchmark.h')
-rw-r--r-- | erts/emulator/beam/benchmark.h | 39 |
1 files changed, 2 insertions, 37 deletions
diff --git a/erts/emulator/beam/benchmark.h b/erts/emulator/beam/benchmark.h index 766edaac42..904564a96b 100644 --- a/erts/emulator/beam/benchmark.h +++ b/erts/emulator/beam/benchmark.h @@ -37,10 +37,7 @@ /* BM_TIMERS keeps track of the time spent in diferent parts of the * system. It only measures accual active time, not time spent in idle - * mode. These timers requires hardware support. For Linux, use the - * package perfctr from user.it.uu.se/~mikpe/linux/perfctr. If this - * package is not specified when configuring the system - * (--with-perfctr=PATH), the Solaris hrtime_t will be used. + * mode. Currently, the Solaris hrtime_t will be used. * To add new timers look below. */ #define BM_TIMERS @@ -142,38 +139,7 @@ extern unsigned long long major_gc; * meassure (send time in shared heap for instance). */ -#if (defined(__i386__) || defined(__x86_64__)) && USE_PERFCTR -#include "libperfctr.h" - -#define BM_TIMER_T double - -extern struct vperfctr *system_clock; -extern double cpu_khz; -extern BM_TIMER_T start_time; - -#define BM_START_TIMER(t) start_time = \ - (BM_TIMER_T)vperfctr_read_tsc(system_clock) / \ - cpu_khz; - -#define BM_STOP_TIMER(t) do { \ - BM_TIMER_T tmp = ((BM_TIMER_T)vperfctr_read_tsc(system_clock) / cpu_khz); \ - tmp -= (start_time + timer_time); \ - t##_time += (tmp > 0 ? tmp : 0); \ -} while(0) - -#define BM_TIME_PRINTER(str,time) do { \ - int min,sec,milli,micro; \ - BM_TIMER_T tmp = (time) * 1000; \ - micro = (uint)(tmp - ((int)(tmp / 1000)) * 1000); \ - tmp /= 1000; \ - milli = (uint)(tmp - ((int)(tmp / 1000)) * 1000); \ - tmp /= 1000; \ - sec = (uint)(tmp - ((int)(tmp / 60)) * 60); \ - min = (uint)tmp / 60; \ - erts_fprintf(file,str": %d:%02d.%03d %03d\n",min,sec,milli,micro); \ -} while(0) - -#else /* !USE_PERFCTR (Assuming Solaris) */ +/* (Assuming Solaris) */ #define BM_TIMER_T hrtime_t #define BM_START_TIMER(t) system_clock = sys_gethrtime() @@ -196,7 +162,6 @@ extern BM_TIMER_T start_time; } while(0) extern BM_TIMER_T system_clock; -#endif /* USE_PERFCTR */ extern BM_TIMER_T timer_time; extern BM_TIMER_T system_time; |