1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-01 08:17:38 +00:00
Commit Graph

15 Commits

Author SHA1 Message Date
Paul Eggert
735135f9bc Spelling fixes. 2012-10-04 22:57:24 -07:00
Paul Eggert
b3ecad33ae Count overruns when profiling; change units to ns.
* lisp/profiler.el (profiler-sampling-interval): Change units
from ms to ns, multiplying the default by 1000000 so that
it remains 1 ms.
(profiler-report-cpu-line-format): Give enough room for
the maximum counters on 64-bit hosts.
(profiler-report-render-calltree-1): Call them "CPU samples",
not "Time (ms)", since they are not milliseconds now (and
never really were).
* src/profiler.c (handle_profiler_signal): Count sampling intervals, not ms.
Give extra weight to samples after overruns, to attempt to count
the time more accurately.
(setup_cpu_timer): Change sampling interval units from ms to ns, since
the underlying primitives nominally do ns.
(Fprofiler_cpu_start): Document the change.  Mention that
the sampling intervals are only approximate.
2012-10-01 23:30:40 -07:00
Paul Eggert
19e54a4d41 * profiler.el (profiler-sampling-interval): Change default back to 1.
See Stefan Monnier in
<http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00863.html>.
2012-09-30 18:46:06 -07:00
Tomohiro Matsuyama
c22bac2cc5 * profiler.el (profiler-sampling-interval): Rename from
profiler-sample-interval.
(profiler-sampling-interval): Default to 10.
(profiler-find-profile): New command (was profiler-find-log).
(profiler-find-profile-other-window): New command.
(profiler-find-profile-other-frame): New command.
(profiler-profile): Introduce API-level data structure.
2012-10-01 07:21:25 +09:00
Stefan Monnier
3a880af4a7 Merge profiler branch 2012-09-26 11:19:10 -04:00
Stefan Monnier
234148bf94 * lisp/profiler.el (profiler-start): Don't prompt for choice when there
isn't any.
(profiler-stop): Use new semantics of profiler-*-stop.
(profiler-reset, profiler--report-cpu): Don't signal an error if the
cpu profiler is not available.
* src/profiler.c (Fprofiler_cpu_stop, Fprofiler_memory_stop):
Return whether the profiler was running, instead of signaling an error
if it wasn't.
2012-09-26 00:02:21 -04:00
Stefan Monnier
6521894d1a * src/profiler.c: Rename sample_profiler_* to profiler_cpu_* and
memory_profiler_* to profiler_memory_*.  Move sigprof_handler before
its first use, inside the PROFILER_CPU_SUPPORT conditional.
2012-09-24 22:30:46 -04:00
Stefan Monnier
ad942b63d7 Try to let it compile on other platforms
* src/profiler.c (evict_lower_half): Fix typo.
(PROFILER_CPU_SUPPORT): Check and define if cpu-profiler is supported.
Don't compile the cpu-profiler code, if not supported.
(malloc_probe): Presume memory_log is non-nil.
(syms_of_profiler): Don't defsubr functions when they aren't defined.
* src/lisp.h (sample_profiler_running, gc_probe): Don't declare.
2012-09-24 17:15:53 -04:00
Stefan Monnier
3d80c99f38 Rewrite sampler to use Elisp hash-tables.
* src/profiler.c: Remove filtering functionality.
(is_in_trace, Qgc): Remove vars.
(make_log, record_backtrace, Fsample_profiler_log):
Rewrite, using Elisp hash-tables.
(approximate_median, evict_lower_half): New functions.
(cpu_log): Rename from sample_log.
(cpu_gc_count): New var.
(Fsample_profiler_reset, Fmemory_profiler_reset): Remove.
(sigprof_handler): Add count to cpu_gc_count during GC, detected via
backtrace_list.
(block_sigprof, unblock_sigprof): Remove.
(gc_probe, mark_profiler): Remove functions.
(syms_of_profiler): Staticpro cpu_log and memory_log.

* lisp/profiler.el (profiler-sample-interval): Move before first use.
Change default to 1ms.
(profiler-entry=, profiler-backtrace-reverse, profiler-log-fixup-slot)
(profiler-calltree-elapsed<, profiler-calltree-elapsed>): Remove functions.
(profiler-entry-format): Don't use type-of.
(profiler-slot, profiler-log): Remove structs.
(profiler-log-timestamp, profiler-log-type, profiler-log-diff-p):
Redefine for new log representation.
(profiler-log-diff, profiler-log-fixup, profiler-calltree-build-1):
Rewrite for new log representation.
(profiler-calltree): Remove `elapsed' fields.
(profiler-calltree-count<, profiler-report-make-entry-part):
Remove gc special case.
(profiler-calltree-find): Use equal.
(profiler-calltree-walk): Remove `args'; rely on closures instead.
(profiler-calltree-compute-percentages-1): Remove; inlined.
(profiler-calltree-compute-percentages): Simplify.
(profiler-report-log, profiler-report-reversed)
(profiler-report-order): Use defvar-local.
(profiler-report-line-format): Remove `elapsed', do a bit of CSE.
(profiler-report-mode-map): Remove up/down bindings.
(profiler-report-make-buffer-name): Simplify by CSE.
(profiler-report-mode): Remove redundant code.
(profiler-report-expand-entry, profiler-report-collapse-entry):
Use inhibit-read-only.
(profiler-report-render-calltree-1): Simplify by CSE.
(profiler-reset): Rewrite for new subroutines.
(profiler--report-cpu): Rename from sample-profiler-report.
(profiler--report-memory): Rename from memory-profiler-report.

* src/alloc.c (Fgarbage_collect): Record itself in backtrace_list.
Don't set is_in_trace any more.  Don't call mark_profiler.
Only call gc_probe for the memory profiler.
(syms_of_alloc): Define Qautomatic_gc.

* src/lisp.h (SXHASH_COMBINE): Move back to...
* src/fns.c (SXHASH_COMBINE): ...here.

* src/xdisp.c (Qautomatic_redisplay): New constant.
(redisplay_internal): Record itself in backtrace_list.
(syms_of_xdisp): Define Qautomatic_redisplay.

* .dir-locals.el (indent-tabs-mode): Remove personal preference.
2012-09-24 10:38:10 -04:00
Tomohiro Matsuyama
0efc778b80 profiler: Refactoring and documentation. 2012-08-23 21:11:12 +09:00
Tomohiro Matsuyama
12b3895d74 Add GC profiler. 2012-08-22 21:38:39 +09:00
Tomohiro Matsuyama
ce56157e5f * profiler.el (with-sample-profiling): New macro.
(with-memory-profiling): New macro.
2012-08-22 18:15:17 +09:00
Tomohiro Matsuyama
a4924b1491 * profiler.el (profiler-start): Change mode spec. 2012-08-22 16:08:36 +09:00
Tomohiro Matsuyama
b02baf7f7c * profiler.el: Switch to cl-lib. 2012-08-22 15:49:34 +09:00
Tomohiro Matsuyama
c2d7786e12 Add emacs native profiler. 2012-08-22 15:38:59 +09:00