Function: profiler-cpu-log

profiler-cpu-log is a function defined in profiler.c.

Signature

(profiler-cpu-log)

Documentation

Return the current cpu profiler log.

The log is a hash-table mapping backtraces to counters which represent the amount of time spent at those points. Every backtrace is a vector of functions, where the last few elements may be nil.

If the profiler has not run since the last invocation of profiler-cpu-log(var)/profiler-cpu-log(fun) (or was never run at all), return nil. If the profiler is currently running, allocate a new log for future samples before returning.

Source Code

// Defined in /usr/src/emacs/src/profiler.c
{
  /* Temporarily stop profiling to avoid it interfering with our data
     access.  */
  bool prof_cpu = profiler_cpu_running;
  if (prof_cpu)
    Fprofiler_cpu_stop ();

  Lisp_Object ret = export_log (&cpu);

  if (prof_cpu)
    Fprofiler_cpu_start (profiler_cpu_interval);

  return ret;
}