+2
-2
@@ -1,7 +1,8 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
|
||||
#include <getopt.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "sd-bus.h"
|
||||
|
||||
#include "alloc-util.h"
|
||||
#include "build.h"
|
||||
@@ -12,7 +13,6 @@
|
||||
#include "main-func.h"
|
||||
#include "pager.h"
|
||||
#include "pretty-print.h"
|
||||
#include "terminal-util.h"
|
||||
#include "verbs.h"
|
||||
|
||||
static PagerFlags arg_pager_flags = 0;
|
||||
|
||||
@@ -4,6 +4,9 @@
|
||||
#include "log.h"
|
||||
#include "oomd-conf.h"
|
||||
#include "oomd-manager.h"
|
||||
#include "parse-util.h"
|
||||
#include "string-util.h"
|
||||
#include "time-util.h"
|
||||
|
||||
static int config_parse_duration(
|
||||
const char *unit,
|
||||
|
||||
+1
-2
@@ -1,8 +1,7 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
#pragma once
|
||||
|
||||
#include "conf-parser.h"
|
||||
#include "oomd-manager.h"
|
||||
typedef struct Manager Manager;
|
||||
|
||||
void manager_set_defaults(Manager *m);
|
||||
|
||||
|
||||
@@ -1,15 +1,13 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
|
||||
#include <linux/capability.h>
|
||||
#include "sd-bus.h"
|
||||
|
||||
#include "alloc-util.h"
|
||||
#include "bus-common-errors.h"
|
||||
#include "bus-polkit.h"
|
||||
#include "bus-object.h"
|
||||
#include "fd-util.h"
|
||||
#include "memfd-util.h"
|
||||
#include "oomd-manager.h"
|
||||
#include "oomd-manager-bus.h"
|
||||
#include "user-util.h"
|
||||
|
||||
static int bus_method_dump_by_fd(sd_bus_message *message, void *userdata, sd_bus_error *error) {
|
||||
_cleanup_free_ char *dump = NULL;
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
#pragma once
|
||||
|
||||
#include "bus-object.h"
|
||||
|
||||
typedef struct Manager Manager;
|
||||
#include "forward.h"
|
||||
|
||||
extern const BusObjectImplementation manager_object;
|
||||
|
||||
@@ -1,25 +1,30 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
|
||||
#include "sd-bus.h"
|
||||
#include "sd-daemon.h"
|
||||
#include "sd-event.h"
|
||||
#include "sd-json.h"
|
||||
|
||||
#include "alloc-util.h"
|
||||
#include "bus-log-control-api.h"
|
||||
#include "bus-polkit.h"
|
||||
#include "bus-object.h"
|
||||
#include "bus-util.h"
|
||||
#include "cgroup-util.h"
|
||||
#include "constants.h"
|
||||
#include "daemon-util.h"
|
||||
#include "fd-util.h"
|
||||
#include "fileio.h"
|
||||
#include "format-util.h"
|
||||
#include "json-util.h"
|
||||
#include "memory-util.h"
|
||||
#include "memstream-util.h"
|
||||
#include "oomd-conf.h"
|
||||
#include "oomd-manager.h"
|
||||
#include "oomd-manager-bus.h"
|
||||
#include "parse-util.h"
|
||||
#include "path-util.h"
|
||||
#include "percent-util.h"
|
||||
#include "set.h"
|
||||
#include "string-util.h"
|
||||
#include "time-util.h"
|
||||
#include "varlink-io.systemd.oom.h"
|
||||
#include "varlink-io.systemd.service.h"
|
||||
#include "varlink-util.h"
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
#pragma once
|
||||
|
||||
#include "sd-bus.h"
|
||||
#include "sd-event.h"
|
||||
#include "sd-varlink.h"
|
||||
|
||||
#include "conf-parser.h"
|
||||
#include "conf-parser-forward.h"
|
||||
#include "forward.h"
|
||||
#include "oomd-util.h"
|
||||
|
||||
/* Polling interval for monitoring stats */
|
||||
@@ -27,9 +24,7 @@
|
||||
#define RECLAIM_DURATION_USEC (30 * USEC_PER_SEC)
|
||||
#define POST_ACTION_DELAY_USEC (15 * USEC_PER_SEC)
|
||||
|
||||
typedef struct Manager Manager;
|
||||
|
||||
struct Manager {
|
||||
typedef struct Manager {
|
||||
sd_bus *bus;
|
||||
sd_event *event;
|
||||
|
||||
@@ -59,7 +54,7 @@ struct Manager {
|
||||
/* This varlink server object is used to manage systemd-oomd's varlink server which is used by user
|
||||
* managers to report changes in ManagedOOM settings (oomd server - systemd client). */
|
||||
sd_varlink_server *varlink_server;
|
||||
};
|
||||
} Manager;
|
||||
|
||||
Manager* manager_free(Manager *m);
|
||||
DEFINE_TRIVIAL_CLEANUP_FUNC(Manager*, manager_free);
|
||||
|
||||
+5
-5
@@ -1,8 +1,6 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
|
||||
#include <sys/xattr.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "alloc-util.h"
|
||||
#include "errno-util.h"
|
||||
#include "fd-util.h"
|
||||
#include "fileio.h"
|
||||
@@ -12,12 +10,14 @@
|
||||
#include "oomd-util.h"
|
||||
#include "parse-util.h"
|
||||
#include "path-util.h"
|
||||
#include "pidref.h"
|
||||
#include "procfs-util.h"
|
||||
#include "set.h"
|
||||
#include "signal-util.h"
|
||||
#include "sort-util.h"
|
||||
#include "stat-util.h"
|
||||
#include "stdio-util.h"
|
||||
#include "user-util.h"
|
||||
#include "string-util.h"
|
||||
#include "time-util.h"
|
||||
|
||||
DEFINE_HASH_OPS_WITH_VALUE_DESTRUCTOR(
|
||||
oomd_cgroup_ctx_hash_ops,
|
||||
|
||||
+1
-3
@@ -1,10 +1,8 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
#pragma once
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
#include "cgroup-util.h"
|
||||
#include "hashmap.h"
|
||||
#include "forward.h"
|
||||
#include "psi-util.h"
|
||||
|
||||
#define DUMP_ON_KILL_COUNT 10u
|
||||
|
||||
+2
-2
@@ -2,12 +2,13 @@
|
||||
|
||||
#include <getopt.h>
|
||||
|
||||
#include "sd-event.h"
|
||||
|
||||
#include "alloc-util.h"
|
||||
#include "build.h"
|
||||
#include "bus-log-control-api.h"
|
||||
#include "bus-object.h"
|
||||
#include "cgroup-util.h"
|
||||
#include "conf-parser.h"
|
||||
#include "daemon-util.h"
|
||||
#include "fileio.h"
|
||||
#include "log.h"
|
||||
@@ -18,7 +19,6 @@
|
||||
#include "parse-util.h"
|
||||
#include "pretty-print.h"
|
||||
#include "psi-util.h"
|
||||
#include "signal-util.h"
|
||||
|
||||
static bool arg_dry_run = false;
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "alloc-util.h"
|
||||
@@ -7,13 +8,12 @@
|
||||
#include "cgroup-util.h"
|
||||
#include "fd-util.h"
|
||||
#include "fileio.h"
|
||||
#include "fs-util.h"
|
||||
#include "oomd-util.h"
|
||||
#include "parse-util.h"
|
||||
#include "path-util.h"
|
||||
#include "string-util.h"
|
||||
#include "strv.h"
|
||||
#include "set.h"
|
||||
#include "tests.h"
|
||||
#include "time-util.h"
|
||||
#include "tmpfile-util.h"
|
||||
|
||||
static int fork_and_sleep(unsigned sleep_min) {
|
||||
|
||||
Reference in New Issue
Block a user