]> git.eshelyaron.com Git - emacs.git/commit
src/profiler.c: Share more code between CPU and Memory profilers
authorStefan Monnier <monnier@iro.umontreal.ca>
Fri, 10 Mar 2023 20:30:20 +0000 (15:30 -0500)
committerStefan Monnier <monnier@iro.umontreal.ca>
Fri, 10 Mar 2023 20:30:20 +0000 (15:30 -0500)
commit83be04c66ffaec86aee136b9a94979169d1ba68d
treef39bc07c848c5fe9fba781023e924742b5f31fa7
parentf97d4b9e54c7de3f67d78be8c63afcdb6b704531
src/profiler.c: Share more code between CPU and Memory profilers

* src/profiler.c (struct profiler_log): New type.
(make_log): Use it.
(cpu, memory): New vars to replace cpu_log, memory_log, cpu_gc_count,
and mem_gc_count.
(add_sample): New function, extracted from `handle_profiler_signal`.
(handle_profiler_signal, malloc_probe): Use it.
(Fprofiler_cpu_start, Fprofiler_memory_start): Adjust call to `make_log`.
(export_log): New function, extracted from `Fprofiler_cpu_log`.
(Fprofiler_cpu_log, Fprofiler_memory_log): Use it.
(syms_of_profiler, syms_of_profiler_for_pdumper): Adjust to new `cpu`
and `memory` vars.
src/profiler.c