1 /* SPDX-License-Identifier: LGPL-2.1-or-later */ 2 #pragma once 3 4 #include "macro.h" 5 6 typedef enum CoredumpFilter { 7 COREDUMP_FILTER_PRIVATE_ANONYMOUS = 0, 8 COREDUMP_FILTER_SHARED_ANONYMOUS, 9 COREDUMP_FILTER_PRIVATE_FILE_BACKED, 10 COREDUMP_FILTER_SHARED_FILE_BACKED, 11 COREDUMP_FILTER_ELF_HEADERS, 12 COREDUMP_FILTER_PRIVATE_HUGE, 13 COREDUMP_FILTER_SHARED_HUGE, 14 COREDUMP_FILTER_PRIVATE_DAX, 15 COREDUMP_FILTER_SHARED_DAX, 16 _COREDUMP_FILTER_MAX, 17 _COREDUMP_FILTER_INVALID = -EINVAL, 18 } CoredumpFilter; 19 20 #define COREDUMP_FILTER_MASK_DEFAULT (1u << COREDUMP_FILTER_PRIVATE_ANONYMOUS | \ 21 1u << COREDUMP_FILTER_SHARED_ANONYMOUS | \ 22 1u << COREDUMP_FILTER_ELF_HEADERS | \ 23 1u << COREDUMP_FILTER_PRIVATE_HUGE) 24 25 const char* coredump_filter_to_string(CoredumpFilter i) _const_; 26 CoredumpFilter coredump_filter_from_string(const char *s) _pure_; 27 int coredump_filter_mask_from_string(const char *s, uint64_t *ret); 28 29 int set_coredump_filter(uint64_t value); 30