aboutsummaryrefslogtreecommitdiffstats
path: root/src/profiler.c
diff options
context:
space:
mode:
authorJoakim Verona2013-06-12 12:32:25 +0200
committerJoakim Verona2013-06-12 12:32:25 +0200
commite6fa6da6899bf1b4877b96c450eae3934085d560 (patch)
tree48e6fda463d24a792ec8428fb8044a250ee2ff82 /src/profiler.c
parent4f0994366d33f8f76db4662cc126720866df3461 (diff)
parent84d6f46535554f9f51aae3314313112e8d755c65 (diff)
downloademacs-e6fa6da6899bf1b4877b96c450eae3934085d560.tar.gz
emacs-e6fa6da6899bf1b4877b96c450eae3934085d560.zip
Merge branch 'trunk' into xwidget
Conflicts: src/Makefile.in src/keyboard.c src/termhooks.h
Diffstat (limited to 'src/profiler.c')
-rw-r--r--src/profiler.c17
1 files changed, 3 insertions, 14 deletions
diff --git a/src/profiler.c b/src/profiler.c
index 0a0a4d0bc57..aba81344c68 100644
--- a/src/profiler.c
+++ b/src/profiler.c
@@ -138,10 +138,8 @@ static void evict_lower_half (log_t *log)
138static void 138static void
139record_backtrace (log_t *log, EMACS_INT count) 139record_backtrace (log_t *log, EMACS_INT count)
140{ 140{
141 struct backtrace *backlist = backtrace_list;
142 Lisp_Object backtrace; 141 Lisp_Object backtrace;
143 ptrdiff_t index, i = 0; 142 ptrdiff_t index;
144 ptrdiff_t asize;
145 143
146 if (!INTEGERP (log->next_free)) 144 if (!INTEGERP (log->next_free))
147 /* FIXME: transfer the evicted counts to a special entry rather 145 /* FIXME: transfer the evicted counts to a special entry rather
@@ -151,16 +149,7 @@ record_backtrace (log_t *log, EMACS_INT count)
151 149
152 /* Get a "working memory" vector. */ 150 /* Get a "working memory" vector. */
153 backtrace = HASH_KEY (log, index); 151 backtrace = HASH_KEY (log, index);
154 asize = ASIZE (backtrace); 152 get_backtrace (backtrace);
155
156 /* Copy the backtrace contents into working memory. */
157 for (; i < asize && backlist; i++, backlist = backlist->next)
158 /* FIXME: For closures we should ignore the environment. */
159 ASET (backtrace, i, backlist->function);
160
161 /* Make sure that unused space of working memory is filled with nil. */
162 for (; i < asize; i++)
163 ASET (backtrace, i, Qnil);
164 153
165 { /* We basically do a `gethash+puthash' here, except that we have to be 154 { /* We basically do a `gethash+puthash' here, except that we have to be
166 careful to avoid memory allocation since we're in a signal 155 careful to avoid memory allocation since we're in a signal
@@ -232,7 +221,7 @@ static EMACS_INT current_sampling_interval;
232static void 221static void
233handle_profiler_signal (int signal) 222handle_profiler_signal (int signal)
234{ 223{
235 if (backtrace_list && EQ (backtrace_list->function, Qautomatic_gc)) 224 if (EQ (backtrace_top_function (), Qautomatic_gc))
236 /* Special case the time-count inside GC because the hash-table 225 /* Special case the time-count inside GC because the hash-table
237 code is not prepared to be used while the GC is running. 226 code is not prepared to be used while the GC is running.
238 More specifically it uses ASIZE at many places where it does 227 More specifically it uses ASIZE at many places where it does