From: Aurelien DARRAGON Date: Tue, 21 May 2024 08:49:55 +0000 (+0200) Subject: DEBUG: errors: add name hint for startup-logs memory area X-Git-Tag: v3.0-dev13~58 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9424e5a06ffbb484b9bef5abf2e83b73bec0fd4f;p=thirdparty%2Fhaproxy.git DEBUG: errors: add name hint for startup-logs memory area Thanks to ("MINOR: tools: add vma_set_name() helper"), set a name hint for startup-logs ring's memory area created using mmap() so it can be easily indentified in /proc//maps. 7b8e91cce000-7b8e91cde000 rw-s 00000000 00:19 46 [anon_shmem:errors:startup_logs] --- diff --git a/src/errors.c b/src/errors.c index 51997da70d..197a0cdefd 100644 --- a/src/errors.c +++ b/src/errors.c @@ -112,7 +112,7 @@ error: * Once in wait mode, the shm must be copied and closed. * */ -void startup_logs_init() +void startup_logs_init_shm() { struct ring *r = NULL; char *str_fd, *endptr; @@ -176,14 +176,20 @@ error: } -#else /* ! USE_SHM_OPEN */ +#endif /* ! USE_SHM_OPEN */ void startup_logs_init() { +#ifdef USE_SHM_OPEN + startup_logs_init_shm(); +#else /* ! USE_SHM_OPEN */ startup_logs = ring_new(STARTUP_LOG_SIZE); -} - #endif + if (startup_logs) + vma_set_name(ring_allocated_area(startup_logs), + ring_allocated_size(startup_logs), + "errors", "startup_logs"); +} /* free the startup logs, unmap if it was an shm */ void startup_logs_free(struct ring *r)