+2012-09-26 Juanma Barranquero <lekktu@gmail.com>
+
+ * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
+ ($(BLD)/profiler.$(O)): New target.
+
2012-09-25 Stefan Monnier <monnier@iro.umontreal.ca>
* profiler.c: Rename sample_profiler_* to profiler_cpu_* and
$(BLD)/terminal.$(O) \
$(BLD)/menu.$(O) \
$(BLD)/xml.$(O) \
+ $(BLD)/profiler.$(O) \
$(BLD)/w32term.$(O) \
$(BLD)/w32xfns.$(O) \
$(BLD)/w32fns.$(O) \
process.c callproc.c unexw32.c \
region-cache.c sound.c atimer.c \
doprnt.c intervals.c textprop.c composite.c \
- gnutls.c xml.c
+ gnutls.c xml.c profiler.c
SOME_MACHINE_OBJECTS = dosfns.o msdos.o \
xterm.o xfns.o xmenu.o xselect.o xrdb.o xsmfns.o dbusbind.o
obj = $(GLOBAL_SOURCES:.c=.o)
$(CONFIG_H) \
$(LISP_H)
+$(BLD)/profiler.$(O) : \
+ $(SRC)/profiler.c \
+ $(CONFIG_H) \
+ $(LISP_H)
+
$(BLD)/image.$(O) : \
$(SRC)/image.c \
$(SRC)/epaths.h \
ptrdiff_t asize;
if (!INTEGERP (log->next_free))
+ /* FIXME: transfer the evicted counts to a special entry rather
+ than dropping them on the floor. */
evict_lower_half (log);
index = XINT (log->next_free);
/* Copy the backtrace contents into working memory. */
for (; i < asize && backlist; i++, backlist = backlist->next)
+ /* FIXME: For closures we should ignore the environment. */
ASET (backtrace, i, *backlist->function);
/* Make sure that unused space of working memory is filled with nil. */
/* FIXME: If the hash-table is almost full, we should set
some global flag so that some Elisp code can offload its
- data elsewhere, so as to avoid the eviction code. */
+ data elsewhere, so as to avoid the eviction code.
+ There are 2 ways to do that, AFAICT:
+ - Set a flag checked in QUIT, such that QUIT can then call
+ Fprofiler_cpu_log and stash the full log for later use.
+ - Set a flag check in post-gc-hook, so that Elisp code can call
+ profiler-cpu-log. That gives us more flexibility since that
+ Elisp code can then do all kinds of fun stuff like write
+ the log to disk. Or turn it right away into a call tree.
+ Of course, using Elisp is generally preferable, but it may
+ take longer until we get a chance to run the Elisp code, so
+ there's more risk that the table will get full before we
+ get there. */
}
}
}