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. Before returning, a new log is allocated for future samples.

Source Code

// Defined in /usr/src/emacs/src/profiler.c
{
  Lisp_Object result = cpu_log;
  /* Here we're making the log visible to Elisp, so it's not safe any
     more for our use afterwards since we can't rely on its special
     pre-allocated keys anymore.  So we have to allocate a new one.  */
  cpu_log = profiler_cpu_running ? make_log () : Qnil;
  Fputhash (make_vector (1, QAutomatic_GC),
	    make_fixnum (cpu_gc_count),
	    result);
  cpu_gc_count = 0;
  return result;
}