From b3ecad33ae977f9dd0bdd3e0a10cd8603f54a398 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 1 Oct 2012 23:30:40 -0700 Subject: 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. --- lisp/profiler.el | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'lisp/profiler.el') diff --git a/lisp/profiler.el b/lisp/profiler.el index 55e706ec70b..efa23e7aec0 100644 --- a/lisp/profiler.el +++ b/lisp/profiler.el @@ -33,8 +33,8 @@ (defconst profiler-version "24.3") -(defcustom profiler-sampling-interval 1 - "Default sampling interval in millisecond." +(defcustom profiler-sampling-interval 1000000 + "Default sampling interval in nanoseconds." :type 'integer :group 'profiler) @@ -323,8 +323,8 @@ function name of a function itself." :group 'profiler) (defvar profiler-report-cpu-line-format - '((60 left) - (14 right ((9 right) + '((50 left) + (24 right ((19 right) (5 right))))) (defvar profiler-report-memory-line-format @@ -551,7 +551,7 @@ otherwise collapse." (cpu (profiler-report-header-line-format profiler-report-cpu-line-format - "Function" (list "Time (ms)" "%"))) + "Function" (list "CPU samples" "%"))) (memory (profiler-report-header-line-format profiler-report-memory-line-format -- cgit v1.2.1