From a141d9a1940a18c1d5843621e6e5c9dd03ba9900 Mon Sep 17 00:00:00 2001 From: Christian Hergert Date: Mon, 14 Aug 2023 10:26:24 -0700 Subject: [PATCH] sysprof-cli: bump default buffer size to 8mb The goal here is just to reduce the number of file system transactions during the recording process. --- src/sysprof-cli/sysprof-cli.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/sysprof-cli/sysprof-cli.c b/src/sysprof-cli/sysprof-cli.c index 51a0ea2b..282418fa 100644 --- a/src/sysprof-cli/sysprof-cli.c +++ b/src/sysprof-cli/sysprof-cli.c @@ -38,6 +38,8 @@ #include "sysprof-capture-util-private.h" +#define DEFAULT_BUFFER_SIZE (1024L * 1024L * 8L /* 8mb */) + G_DEFINE_AUTOPTR_CLEANUP_FUNC (SysprofCaptureReader, sysprof_capture_reader_unref) G_DEFINE_AUTOPTR_CLEANUP_FUNC (SysprofCaptureWriter, sysprof_capture_writer_unref) @@ -298,7 +300,7 @@ main (int argc, int pid = -1; int fd; int flags; - int n_buffer_pages = 0; + int n_buffer_pages = (DEFAULT_BUFFER_SIZE / sysprof_getpagesize ()); GOptionEntry entries[] = { { "no-throttle", 0, 0, G_OPTION_ARG_NONE, &no_throttle, N_("Disable CPU throttling while profiling [Deprecated for --power-profile]") }, { "pid", 'p', 0, G_OPTION_ARG_INT, &pid, N_("Make sysprof specific to a task [Deprecated]"), N_("PID") },