Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
memory_pressure.c File Reference
#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_tdt_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)
 

Function Documentation

◆ _cgroup_below_root()

static gboolean _cgroup_below_root ( const char *  path)
static

Definition at line 81 of file memory_pressure.c.

Referenced by _triggers_open(), and dt_memory_pressure_read_full_stall().

◆ _cgroup_parent()

static gboolean _cgroup_parent ( char *  path)
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().

◆ _open_trigger()

static int _open_trigger ( const char *  file,
const char *  trigger 
)
static

Definition at line 96 of file memory_pressure.c.

Referenced by _triggers_open().

◆ _own_cgroup_path()

static void _own_cgroup_path ( char *  path,
const size_t  size 
)
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().

◆ _read_full_total()

static gboolean _read_full_total ( const char *  file,
uint64_t total_us 
)
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().

◆ _triggers_open()

static int _triggers_open ( int *  fds,
int  max_fds,
uint64_t  stall_us,
uint64_t  window_us 
)
static

◆ _watch_close()

◆ _watch_thread()

◆ dt_memory_pressure_read_full_stall()

int dt_memory_pressure_read_full_stall ( uint64_t total_us,
int  max_levels 
)

◆ dt_memory_pressure_watch_levels()

int dt_memory_pressure_watch_levels ( const dt_memory_pressure_watch_t watch)

◆ dt_memory_pressure_watch_start()

◆ dt_memory_pressure_watch_stop()