/* Profiler implementation.
-Copyright (C) 2012-2013 Free Software Foundation, Inc.
+Copyright (C) 2012-2014 Free Software Foundation, Inc.
This file is part of GNU Emacs.
typedef struct Lisp_Hash_Table log_t;
+static Lisp_Object Qautomatic_gc;
static Lisp_Object Qprofiler_backtrace_equal;
static struct hash_table_test hashtest_profiler;
return NOT_RUNNING;
current_sampling_interval = XINT (sampling_interval);
- interval = make_emacs_time (current_sampling_interval / billion,
- current_sampling_interval % billion);
+ interval = make_timespec (current_sampling_interval / billion,
+ current_sampling_interval % billion);
emacs_sigaction_init (&action, deliver_profiler_signal);
sigaction (SIGPROF, &action, 0);
sigev.sigev_signo = SIGPROF;
sigev.sigev_notify = SIGEV_SIGNAL;
- for (i = 0; i < sizeof system_clock / sizeof *system_clock; i++)
+ for (i = 0; i < ARRAYELTS (system_clock); i++)
if (timer_create (system_clock[i], &sigev, &profiler_timer) == 0)
{
profiler_timer_ok = 1;
DEFUN ("profiler-cpu-running-p",
Fprofiler_cpu_running_p, Sprofiler_cpu_running_p,
0, 0, 0,
- doc: /* Return non-nil iff cpu profiler is running. */)
+ doc: /* Return non-nil if cpu profiler is running. */)
(void)
{
return profiler_cpu_running ? Qt : Qnil;
to make room for new entries. */);
profiler_log_size = 10000;
+ DEFSYM (Qautomatic_gc, "Automatic GC");
DEFSYM (Qprofiler_backtrace_equal, "profiler-backtrace-equal");
hashtest_profiler.name = Qprofiler_backtrace_equal;