aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog10
-rw-r--r--src/profiler.c21
2 files changed, 20 insertions, 11 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index f540aef3814..ce6f56fa8fc 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,9 @@
12012-09-26 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * profiler.c (Fprofiler_cpu_stop, Fprofiler_memory_stop):
4 Return whether the profiler was running, instead of signaling an error
5 if it wasn't.
6
12012-09-26 Juanma Barranquero <lekktu@gmail.com> 72012-09-26 Juanma Barranquero <lekktu@gmail.com>
2 8
3 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c. 9 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
@@ -106,8 +112,8 @@
106 * w32uniscribe.c (uniscribe_shape): Fix producing gstring 112 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
107 components for RTL text (Bug#11860). Adjust X-OFFSET of each 113 components for RTL text (Bug#11860). Adjust X-OFFSET of each
108 non-base glyph for the width of the base character, according to 114 non-base glyph for the width of the base character, according to
109 what x_draw_composite_glyph_string_foreground expects. Generate 115 what x_draw_composite_glyph_string_foreground expects.
110 WADJUST value according to composition_gstring_width's 116 Generate WADJUST value according to composition_gstring_width's
111 expectations, to produce correct width of the composed character. 117 expectations, to produce correct width of the composed character.
112 Reverse the sign of the DU offset produced by ScriptPlace. 118 Reverse the sign of the DU offset produced by ScriptPlace.
113 119
diff --git a/src/profiler.c b/src/profiler.c
index 8573d13b554..e7593a6a0e0 100644
--- a/src/profiler.c
+++ b/src/profiler.c
@@ -257,19 +257,20 @@ See also `profiler-log-size' and `profiler-max-stack-depth'. */)
257 timer.it_value = timer.it_interval; 257 timer.it_value = timer.it_interval;
258 setitimer (ITIMER_PROF, &timer, 0); 258 setitimer (ITIMER_PROF, &timer, 0);
259 259
260 profiler_cpu_running = 1; 260 profiler_cpu_running = true;
261 261
262 return Qt; 262 return Qt;
263} 263}
264 264
265DEFUN ("profiler-cpu-stop", Fprofiler_cpu_stop, Sprofiler_cpu_stop, 265DEFUN ("profiler-cpu-stop", Fprofiler_cpu_stop, Sprofiler_cpu_stop,
266 0, 0, 0, 266 0, 0, 0,
267 doc: /* Stop the cpu profiler. The profiler log is not affected. */) 267 doc: /* Stop the cpu profiler. The profiler log is not affected.
268Return non-nil if the profiler was running. */)
268 (void) 269 (void)
269{ 270{
270 if (!profiler_cpu_running) 271 if (!profiler_cpu_running)
271 error ("Sample profiler is not running"); 272 return Qnil;
272 profiler_cpu_running = 0; 273 profiler_cpu_running = false;
273 274
274 setitimer (ITIMER_PROF, 0, 0); 275 setitimer (ITIMER_PROF, 0, 0);
275 276
@@ -332,7 +333,7 @@ See also `profiler-log-size' and `profiler-max-stack-depth'. */)
332 memory_log = make_log (profiler_log_size, 333 memory_log = make_log (profiler_log_size,
333 profiler_max_stack_depth); 334 profiler_max_stack_depth);
334 335
335 profiler_memory_running = 1; 336 profiler_memory_running = true;
336 337
337 return Qt; 338 return Qt;
338} 339}
@@ -340,13 +341,13 @@ See also `profiler-log-size' and `profiler-max-stack-depth'. */)
340DEFUN ("profiler-memory-stop", 341DEFUN ("profiler-memory-stop",
341 Fprofiler_memory_stop, Sprofiler_memory_stop, 342 Fprofiler_memory_stop, Sprofiler_memory_stop,
342 0, 0, 0, 343 0, 0, 0,
343 doc: /* Stop the memory profiler. The profiler log is not affected. */) 344 doc: /* Stop the memory profiler. The profiler log is not affected.
345Return non-nil if the profiler was running. */)
344 (void) 346 (void)
345{ 347{
346 if (!profiler_memory_running) 348 if (!profiler_memory_running)
347 error ("Memory profiler is not running"); 349 return Qnil;
348 profiler_memory_running = 0; 350 profiler_memory_running = false;
349
350 return Qt; 351 return Qt;
351} 352}
352 353
@@ -403,6 +404,7 @@ to make room for new entries. */);
403 profiler_log_size = 10000; 404 profiler_log_size = 10000;
404 405
405#ifdef PROFILER_CPU_SUPPORT 406#ifdef PROFILER_CPU_SUPPORT
407 profiler_cpu_running = false;
406 cpu_log = Qnil; 408 cpu_log = Qnil;
407 staticpro (&cpu_log); 409 staticpro (&cpu_log);
408 defsubr (&Sprofiler_cpu_start); 410 defsubr (&Sprofiler_cpu_start);
@@ -410,6 +412,7 @@ to make room for new entries. */);
410 defsubr (&Sprofiler_cpu_running_p); 412 defsubr (&Sprofiler_cpu_running_p);
411 defsubr (&Sprofiler_cpu_log); 413 defsubr (&Sprofiler_cpu_log);
412#endif 414#endif
415 profiler_memory_running = false;
413 memory_log = Qnil; 416 memory_log = Qnil;
414 staticpro (&memory_log); 417 staticpro (&memory_log);
415 defsubr (&Sprofiler_memory_start); 418 defsubr (&Sprofiler_memory_start);