![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
#include "system/memory_pressure.h"#include "system/macros.h"#include <glib.h>#include <glib/gstdio.h>#include <inttypes.h>#include <stdio.h>#include <string.h>#include <errno.h>#include <pthread.h>#include <fcntl.h>#include <poll.h>#include <sys/eventfd.h>#include <unistd.h>
Include dependency graph for memory_pressure.c:Go to the source code of this file.
Data Structures | |
| struct | dt_memory_pressure_watch_t |
Functions | |
| static gboolean | _read_full_total (const char *file, uint64_t *total_us) |
| static void | _own_cgroup_path (char *path, const size_t size) |
| static gboolean | _cgroup_below_root (const char *path) |
| static gboolean | _cgroup_parent (char *path) |
| static int | _open_trigger (const char *file, const char *trigger) |
| int | dt_memory_pressure_read_full_stall (uint64_t *total_us, int max_levels) |
| static int | _triggers_open (int *fds, int max_fds, uint64_t stall_us, uint64_t window_us) |
| static void | _watch_close (dt_memory_pressure_watch_t *watch) |
| static void * | _watch_thread (void *arg) |
| dt_memory_pressure_watch_t * | dt_memory_pressure_watch_start (uint64_t stall_us, uint64_t window_us, void(*stalled)(void *user), void *user) |
| void | dt_memory_pressure_watch_stop (dt_memory_pressure_watch_t **watch) |
| int | dt_memory_pressure_watch_levels (const dt_memory_pressure_watch_t *watch) |
|
static |
Definition at line 81 of file memory_pressure.c.
Referenced by _triggers_open(), and dt_memory_pressure_read_full_stall().
|
static |
Definition at line 88 of file memory_pressure.c.
References FALSE, IS_NULL_PTR, and TRUE.
Referenced by _triggers_open(), and dt_memory_pressure_read_full_stall().
|
static |
Definition at line 96 of file memory_pressure.c.
Referenced by _triggers_open().
|
static |
Definition at line 59 of file memory_pressure.c.
References f, IS_NULL_PTR, and size.
Referenced by _triggers_open(), and dt_memory_pressure_read_full_stall().
|
static |
Definition at line 38 of file memory_pressure.c.
References f, FALSE, IS_NULL_PTR, and TRUE.
Referenced by dt_memory_pressure_read_full_stall().
Definition at line 144 of file memory_pressure.c.
References _cgroup_below_root(), _cgroup_parent(), _open_trigger(), and _own_cgroup_path().
Referenced by dt_memory_pressure_watch_start().
|
static |
Definition at line 179 of file memory_pressure.c.
References dt_memory_pressure_watch_t::count, dt_memory_pressure_watch_t::fds, i, and dt_memory_pressure_watch_t::stop_fd.
Referenced by dt_memory_pressure_watch_start(), and dt_memory_pressure_watch_stop().
Definition at line 186 of file memory_pressure.c.
References dt_memory_pressure_watch_t::count, DT_MEMORY_PRESSURE_MAX_LEVELS, FALSE, dt_memory_pressure_watch_t::fds, i, n, dt_memory_pressure_watch_t::stalled, dt_memory_pressure_watch_t::stop_fd, TRUE, and dt_memory_pressure_watch_t::user.
Referenced by dt_memory_pressure_watch_start().
| int dt_memory_pressure_read_full_stall | ( | uint64_t * | total_us, |
| int | max_levels | ||
| ) |
Definition at line 111 of file memory_pressure.c.
References _cgroup_below_root(), _cgroup_parent(), _own_cgroup_path(), _read_full_total(), IS_NULL_PTR, levels(), max_levels, and void().
Referenced by _window_share().
| int dt_memory_pressure_watch_levels | ( | const dt_memory_pressure_watch_t * | watch | ) |
Definition at line 286 of file memory_pressure.c.
References dt_memory_pressure_watch_t::count, IS_NULL_PTR, and void().
Referenced by dt_pixelpipe_cache_pressure_watch_start().
| dt_memory_pressure_watch_t * dt_memory_pressure_watch_start | ( | uint64_t | stall_us, |
| uint64_t | window_us, | ||
| void(*)(void *user) | stalled, | ||
| void * | user | ||
| ) |
Definition at line 227 of file memory_pressure.c.
References _triggers_open(), _watch_close(), _watch_thread(), dt_memory_pressure_watch_t::count, DT_MEMORY_PRESSURE_MAX_LEVELS, dt_memory_pressure_watch_t::fds, IS_NULL_PTR, dt_memory_pressure_watch_t::running, dt_memory_pressure_watch_t::stalled, dt_memory_pressure_watch_t::stop_fd, dt_memory_pressure_watch_t::thread, TRUE, dt_memory_pressure_watch_t::user, and void().
Referenced by dt_pixelpipe_cache_pressure_watch_start().
| void dt_memory_pressure_watch_stop | ( | dt_memory_pressure_watch_t ** | watch | ) |
Definition at line 266 of file memory_pressure.c.
References _watch_close(), IS_NULL_PTR, dt_memory_pressure_watch_t::running, dt_memory_pressure_watch_t::stop_fd, and dt_memory_pressure_watch_t::thread.
Referenced by dt_pixelpipe_cache_pressure_watch_stop().