aboutsummaryrefslogtreecommitdiffstats
path: root/src/ChangeLog
diff options
context:
space:
mode:
authorPaul Eggert2012-09-29 23:19:33 -0700
committerPaul Eggert2012-09-29 23:19:33 -0700
commitd89460ed93e67852a95a597a7a1a7983e8828fb9 (patch)
tree349021cb4c7dd7546ae3e354bee1ab2d0b4b48a5 /src/ChangeLog
parent65788e2e93a48015493514b7e8b712700d31a7a2 (diff)
downloademacs-d89460ed93e67852a95a597a7a1a7983e8828fb9.tar.gz
emacs-d89460ed93e67852a95a597a7a1a7983e8828fb9.zip
Profiler improvements: more-accurate timers, overflow checks.
* profiler.c: Don't include stdio.h, limits.h, sys/time.h, signal.h, setjmp.h. Include systime.h instead. (saturated_add): New function. (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t. (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow. (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]: New static vars. (enum profiler_cpu_running): New enumn. (profiler_cpu_running): Now of that enum type, not bool. All uses changed to store the new value. (handle_profiler_signal): Rename from sigprof_handler_1, for consistency with other handlers. Do not check whether cpu_log is a hash-table if garbage collecting, since it doesn't matter in that case. (deliver_profiler_signal): Rename from sigprof_handler, for consistency with other handlers. (setup_cpu_timer): New function, with much of what used to be in Fprofiler_cpu_start. Check for out-of-range argument. Prefer timer_settime if available, and prefer thread cputime clocks, then process cputime clocks, then monotonic clocks, to the old realtime clock. Use make_timeval to round more-correctly when falling back to setitimer. (Fprofiler_cpu_start): Use it. (Fprofiler_cpu_stop): Prefer timer_settime if available. Don't assume that passing NULL as the 2nd argument of setitimer is the same as passing a pointer to all-zero storage. Ignore SIGPROF afterwards. (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM. * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in non-fatal signal handlers. Ignore SIGPROF on startup. * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not in profiler.c, since sysdep.c now uses it.
Diffstat (limited to 'src/ChangeLog')
-rw-r--r--src/ChangeLog34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index fd4319eb4b0..97f955e7136 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,39 @@
12012-09-30 Paul Eggert <eggert@cs.ucla.edu> 12012-09-30 Paul Eggert <eggert@cs.ucla.edu>
2 2
3 Profiler improvements: more-accurate timers, overflow checks.
4 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
5 signal.h, setjmp.h. Include systime.h instead.
6 (saturated_add): New function.
7 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
8 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
9 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
10 New static vars.
11 (enum profiler_cpu_running): New enumn.
12 (profiler_cpu_running): Now of that enum type, not bool.
13 All uses changed to store the new value.
14 (handle_profiler_signal): Rename from sigprof_handler_1,
15 for consistency with other handlers. Do not check whether
16 cpu_log is a hash-table if garbage collecting, since it
17 doesn't matter in that case.
18 (deliver_profiler_signal): Rename from sigprof_handler,
19 for consistency with other handlers.
20 (setup_cpu_timer): New function, with much of what used to be in
21 Fprofiler_cpu_start. Check for out-of-range argument.
22 Prefer timer_settime if available, and prefer
23 thread cputime clocks, then process cputime clocks, then
24 monotonic clocks, to the old realtime clock. Use make_timeval
25 to round more-correctly when falling back to setitimer.
26 (Fprofiler_cpu_start): Use it.
27 (Fprofiler_cpu_stop): Prefer timer_settime if available.
28 Don't assume that passing NULL as the 2nd argument of setitimer
29 is the same as passing a pointer to all-zero storage.
30 Ignore SIGPROF afterwards.
31 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
32 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
33 non-fatal signal handlers. Ignore SIGPROF on startup.
34 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
35 in profiler.c, since sysdep.c now uses it.
36
3 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40. 37 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
4 Suggested by Eli Zaretskii in 38 Suggested by Eli Zaretskii in
5 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>. 39 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.