diff options
-rw-r--r-- | src/common/appid-helper.h | 2 | ||||
-rw-r--r-- | src/common/cgroup.h | 1 | ||||
-rw-r--r-- | src/common/const.h | 15 | ||||
-rw-r--r-- | src/common/dbus-handler.c | 2 | ||||
-rw-r--r-- | src/common/dbus-handler.h | 2 | ||||
-rw-r--r-- | src/common/dbus-names-external.h | 10 | ||||
-rw-r--r-- | src/common/filemap.h | 1 | ||||
-rw-r--r-- | src/common/macro.h | 6 | ||||
-rw-r--r-- | src/common/memory-common.h | 6 | ||||
-rw-r--r-- | src/common/procfs.h | 3 | ||||
-rw-r--r-- | src/common/resourced-helper-worker.c | 1 | ||||
-rw-r--r-- | src/common/resourced-helper-worker.h | 5 | ||||
-rw-r--r-- | src/common/smaps.h | 11 | ||||
-rw-r--r-- | src/common/trace.h | 22 | ||||
-rw-r--r-- | src/common/userinfo-list.h | 3 | ||||
-rw-r--r-- | src/common/util.h | 10 | ||||
-rw-r--r-- | src/cpu/cpu.c | 2 | ||||
-rw-r--r-- | src/heart/heart-battery.c | 1 | ||||
-rw-r--r-- | src/heart/heart-storage.c | 1 | ||||
-rw-r--r-- | src/heart/include/logging.h | 3 | ||||
-rw-r--r-- | src/memory/compaction.c | 3 | ||||
-rw-r--r-- | src/memory/vmpressure-lowmem-handler.c | 2 | ||||
-rw-r--r-- | src/proc-stat/proc-monitor.c | 2 | ||||
-rw-r--r-- | src/swap/swap.c | 2 | ||||
-rw-r--r-- | tests/watchdog-test.c | 1 |
25 files changed, 1 insertions, 116 deletions
diff --git a/src/common/appid-helper.h b/src/common/appid-helper.h index 3558cc28..818434d8 100644 --- a/src/common/appid-helper.h +++ b/src/common/appid-helper.h @@ -18,8 +18,6 @@ */ -#define PKGNAME_SIZE MAX_NAME_SIZE - /** * Get package name from appid. * For base (rpm) packages it's the same name as appid, diff --git a/src/common/cgroup.h b/src/common/cgroup.h index 9a2f10eb..76a54d7f 100644 --- a/src/common/cgroup.h +++ b/src/common/cgroup.h @@ -33,7 +33,6 @@ #define _CGROUP_LIBRARY_CGROUP_H_ #define DEFAULT_CGROUP "/sys/fs/cgroup" -#define CGROUP_CPU DEFAULT_CGROUP "/cpu" #define CGROUP_MEMORY DEFAULT_CGROUP "/memory" #define PROC_TASK_CHILDREN "/proc/%d/task/%d/children" diff --git a/src/common/const.h b/src/common/const.h index 57083d50..71486178 100644 --- a/src/common/const.h +++ b/src/common/const.h @@ -27,11 +27,9 @@ #define TASK_FILE_NAME "/tasks" #define CGROUP_FILE_NAME "/cgroup.procs" -#define UNKNOWN_APP "(unknown)" #define MAX_PATH_LENGTH 512 #define MAX_NAME_LENGTH 256 -#define MAX_IFACE_LENGTH 32 #define MAX_APPID_LENGTH 128 #define MAX_PKGNAME_LENGTH 128 #define MAX_TYPE_LENGTH 16 @@ -48,21 +46,8 @@ #define PROC_BUF_MAX 64 #define PROC_NAME_MAX 1024 -#define COMMA_DELIMETER "," - -#define COUNTER_UPDATE_PERIOD 60 -#define COUNTER_FLUSH_PERIOD 60 - -#define NONE_QUOTA_ID 0 - #define TIME_TO_SAFE_DATA 1 /* one second */ -#define PAGE_SIZE_KB 4 -#define SZ_1 0x00000001 -#define SZ_1K 0x00000400 -#define SZ_1M 0x00100000 -#define SZ_1G 0x40000000 - #define PAGE_SHIFT 12 #define PAGE_SIZE (1 << PAGE_SHIFT) diff --git a/src/common/dbus-handler.c b/src/common/dbus-handler.c index 115cb01c..57c1d319 100644 --- a/src/common/dbus-handler.c +++ b/src/common/dbus-handler.c @@ -35,8 +35,6 @@ #include "util.h" #include "fd-handler.h" -#define D_BUS_INIT_RETRY_COUNT 5 - static guint owner_id; static GList *dbus_signal_list; static GList *dbus_method_handle_list; diff --git a/src/common/dbus-handler.h b/src/common/dbus-handler.h index 40312d09..262426d9 100644 --- a/src/common/dbus-handler.h +++ b/src/common/dbus-handler.h @@ -76,8 +76,6 @@ struct d_bus_signal { g_object_unref(ivc); \ } -#define D_BUS_REPLY_TIMEOUT (120 * 1000) - /* * @desc helper function for filling params array * That params array is used in d_bus_method_sync/d_bus_method_async diff --git a/src/common/dbus-names-external.h b/src/common/dbus-names-external.h index 0c6bc661..2be2b071 100644 --- a/src/common/dbus-names-external.h +++ b/src/common/dbus-names-external.h @@ -25,14 +25,10 @@ */ #define SYSTEM_POPUP_BUS_NAME "org.tizen.system.popup" #define SYSTEM_POPUP_PATH_NAME "/Org/Tizen/System/Popup" -#define SYSTEM_POPUP_IFACE_NAME SYSTEM_POPUP_BUS_NAME #define SYSTEM_POPUP_PATH_SYSTEM SYSTEM_POPUP_PATH_NAME"/System" #define SYSTEM_POPUP_IFACE_SYSTEM SYSTEM_POPUP_BUS_NAME".System" -#define SYSTEM_POPUP_PATH_DATAUSAGE SYSTEM_POPUP_PATH_NAME"/DataUsage" -#define SYSTEM_POPUP_IFACE_DATAUSAGE SYSTEM_POPUP_BUS_NAME".DataUsage" - /* * Deviced */ @@ -48,9 +44,6 @@ #define DEVICED_PATH_BATTERY DEVICED_OBJECT_PATH"/Battery" #define DEVICED_INTERFACE_BATTERY DEVICED_BUS_NAME".Battery" -#define DEVICED_PATH_CORE DEVICED_OBJECT_PATH"/Core" -#define DEVICED_INTERFACE_CORE DEVICED_BUS_NAME".core" - #define DEVICED_PATH_POWEROFF DEVICED_OBJECT_PATH"/PowerOff" #define DEVICED_INTERFACE_POWEROFF DEVICED_BUS_NAME".PowerOff" @@ -61,11 +54,9 @@ #define SIGNAL_DEVICED_LCDON "LCDOn" #define SIGNAL_DEVICED_LCDOFF "LCDOff" #define SIGNAL_DEVICED_LCDONCOMPLETE "LCDOnCompleted" -#define SIGNAL_DEVICED_BOOTINGDONE "BootingDone" #define SIGNAL_DEVICED_POWEROFF_STATE "ChangeState" #define SIGNAL_DEVICED_SYSTEMTIME_CHANGED "SystemTimeChanged" #define SIGNAL_DEVICED_LOW_BATTERY "BatteryStatusLow" -#define SIGNAL_DEVICED_EARLY_BOOTING_DONE "EarlyBootingDone" #define SIGNAL_DEVICED_SUSPEND "sleep" #define SIGNAL_DEVICED_WAKEUP "wakeup" @@ -117,7 +108,6 @@ #define DBUS_INTERFACE_NAME DBUS_BUS_NAME #define METHOD_DBUS_GET_PID "GetConnectionUnixProcessID" -#define METHOD_DBUS_GET_UID "GetConnectionUnixUser" /* * booting diff --git a/src/common/filemap.h b/src/common/filemap.h index aa954e4e..e90bb73f 100644 --- a/src/common/filemap.h +++ b/src/common/filemap.h @@ -25,7 +25,6 @@ #ifndef __FILEMAP_HELPER_H_ #define __FILEMAP_HELPER_H__ -#define FILEMAP_DEFAULT_SIZE #define FILEMAP_MAX_KEY_LEN 1024 #define FILEMAP_MAX_VALUE_LEN 1024 diff --git a/src/common/macro.h b/src/common/macro.h index 9c7805d3..f67a94da 100644 --- a/src/common/macro.h +++ b/src/common/macro.h @@ -58,12 +58,6 @@ sizeof(type) <= 8 ? 20 : \ sizeof(int[-2*(sizeof(type) > 8)]))) -#define SET_BIT(a, bit) \ - ((a) |= (bit)) - -#define UNSET_BIT(a, bit) \ - ((a) &= ~(bit)) - #define CHECK_BIT(a, bit) \ ((a) & (bit)) diff --git a/src/common/memory-common.h b/src/common/memory-common.h index 2f723478..f1ef2d5d 100644 --- a/src/common/memory-common.h +++ b/src/common/memory-common.h @@ -69,20 +69,14 @@ enum lowmem_control_type { }; /* number of memory cgroups */ -#define MEMCG_DEFAULT_NUM_SUBCGROUP 0 #define MEMCG_DEFAULT_EVENT_LEVEL "low" #define MEMCG_DEFAULT_USE_HIERARCHY 0 -#define MEMCG_LOW_RATIO 0.8 -#define MEMCG_MEDIUM_RATIO 0.96 -#define MEMCG_FOREGROUND_LEAVE_RATIO 0.25 - #define LOWMEM_ROOT_CGROUP "/sys/fs/cgroup/memory" #define LOWMEM_APPS_CGROUP LOWMEM_ROOT_CGROUP"/Apps" #define LOWMEM_BGLOCKED_CGROUP LOWMEM_ROOT_CGROUP"/Apps/BgLocked" #define LOWMEM_MEMLIMIT_CGROUP LOWMEM_ROOT_CGROUP"/MemLimit" #define LOWMEM_SWAP_CGROUP LOWMEM_ROOT_CGROUP"/Swap" -#define LOWMEM_SYSTEMD_CGROUP LOWMEM_ROOT_CGROUP"/system.slice" #define MEMCG_OOM_CONTROL_PATH "memory.oom_control" #define MEMCG_EVENTFD_CONTROL "cgroup.event_control" diff --git a/src/common/procfs.h b/src/common/procfs.h index 59cbe180..3a544247 100644 --- a/src/common/procfs.h +++ b/src/common/procfs.h @@ -28,7 +28,6 @@ #include <assert.h> #include <string.h> -#define OOMADJ_DISABLE (-1000) #define OOMADJ_SERVICE_MIN (-900) #define OOMADJ_SU (0) #define OOMADJ_INIT (100) @@ -40,7 +39,6 @@ #define OOMADJ_BACKGRD_UNLOCKED (300) #define OOMADJ_RECENTLY_USED (430) #define OOMADJ_BACKGRD_OLD (450) -#define OOMADJ_APP_LIMIT OOMADJ_INIT #define OOMADJ_APP_MAX (990) #define OOMADJ_APP_INCREASE (30) @@ -59,7 +57,6 @@ */ #define OOMADJ_PREVIOUS_GAP (10) #define OOMADJ_PREVIOUS_DEFAULT (OOMADJ_BACKGRD_LOCKED - OOMADJ_PREVIOUS_GAP) -#define OOMADJ_PREVIOUS_FOREGRD (OOMADJ_FOREGRD_UNLOCKED - OOMADJ_PREVIOUS_GAP) #define OOMADJ_PREVIOUS_BACKGRD (OOMADJ_BACKGRD_UNLOCKED - OOMADJ_PREVIOUS_GAP) diff --git a/src/common/resourced-helper-worker.c b/src/common/resourced-helper-worker.c index cb6926cc..0ed382ca 100644 --- a/src/common/resourced-helper-worker.c +++ b/src/common/resourced-helper-worker.c @@ -39,7 +39,6 @@ static fd_handler_h phandler; #define PTHREAD_WORKER_ACTIVATE(_pthw) g_atomic_int_set(&(_pthw)->active, 1) #define PTHREAD_WORKER_DEACTIVATE(_pthw) g_atomic_int_set(&(_pthw)->active, 0) -#define PTHREAD_WORKER_IS_RUNNING(_pthw) g_atomic_int_get(&(_pthw)->running) #define PTHREAD_WORKER_RUN(_pthw) g_atomic_int_set(&(_pthw)->running, 1) #define PTHREAD_WORKER_IDLE(_pthw) g_atomic_int_set(&(_pthw)->running, 0) diff --git a/src/common/resourced-helper-worker.h b/src/common/resourced-helper-worker.h index 49ce8f83..e65d8d7c 100644 --- a/src/common/resourced-helper-worker.h +++ b/src/common/resourced-helper-worker.h @@ -47,7 +47,4 @@ struct resourced_helper_data { int request_helper_worker(enum helper_worker_operation op, void *data, int (*function) (void *data), void *callback); -#define NEW_OBJECT(_ctl) g_slice_new0(typeof(*(_ctl))) -#define DESTROY_OBJECT(_ctl) g_slice_free(typeof(*(_ctl)), _ctl) - -#endif /* __RESOURCED_HELPER_WORKER_H__ */
\ No newline at end of file +#endif /* __RESOURCED_HELPER_WORKER_H__ */ diff --git a/src/common/smaps.h b/src/common/smaps.h index 57a21391..92ba05bb 100644 --- a/src/common/smaps.h +++ b/src/common/smaps.h @@ -74,17 +74,6 @@ enum smap_mask { | SMAPS_MASK_ANON_HUGE_PAGES | SMAPS_MASK_SWAP }; -#define SMAPS_MASK_DEFAULT \ - (SMAPS_MASK_SIZE | \ - SMAPS_MASK_RSS | \ - SMAPS_MASK_PSS | \ - SMAPS_MASK_SHARED_CLEAN | \ - SMAPS_MASK_SHARED_DIRTY | \ - SMAPS_MASK_PRIVATE_CLEAN | \ - SMAPS_MASK_PRIVATE_DIRTY | \ - SMAPS_MASK_SWAP | \ - SMAPS_MASK_PSWAP) - struct smap_mapping { const char* name; enum smap_id id; diff --git a/src/common/trace.h b/src/common/trace.h index 0533742d..31817b37 100644 --- a/src/common/trace.h +++ b/src/common/trace.h @@ -39,8 +39,6 @@ #undef LOG_TAG #define LOG_TAG "RESOURCED" -#define WALK_TREE(list, func) g_tree_foreach((GTree *)list, func, NULL) - enum log_type { LOG_TYPE_STANDARD = 0, LOG_TYPE_FILE, @@ -71,39 +69,19 @@ extern enum log_type logtype; #define _SD(fmt, arg...) SECURE_LOGD(fmt, ##arg) #define _SI(fmt, arg...) SECURE_LOGI(fmt, ##arg) -#define TRACE_DB_ERR(a) if (a != NULL) { \ - _D("%s\n", a); \ - sqlite3_free(a); \ -} - #define TRACE_RET_ERRCODE(type, error_code) \ do { \ _##type("errno %d, errmsg %m", error_code); \ } while (0) -#define DTRACE_RET_ERRCODE(error_code) TRACE_RET_ERRCODE(D, error_code) - -#define ETRACE_RET_ERRCODE(error_code) TRACE_RET_ERRCODE(E, error_code) - #define TRACE_RET_ERRCODE_MSG(type, error_code, fmt, arg...) \ do { \ _##type(fmt, ##arg); \ _##type("errno %d, errmsg %m", error_code); \ } while (0) -#define DTRACE_RET_ERRCODE_MSG(error_code, fmt, arg...) \ - TRACE_RET_ERRCODE_MSG(D, error_code, fmt, ##arg) - -#define ETRACE_RET_ERRCODE_MSG(error_code, fmt, arg...) \ - TRACE_RET_ERRCODE_MSG(E, error_code, fmt, ##arg) - -#define DTRACE_ERRNO() TRACE_RET_ERRCODE(D, -errno) - #define ETRACE_ERRNO() TRACE_RET_ERRCODE(E, -errno) -#define DTRACE_ERRNO_MSG(fmt, arg...) \ - TRACE_RET_ERRCODE_MSG(D, -errno, fmt, ##arg) - #define ETRACE_ERRNO_MSG(fmt, arg...) \ TRACE_RET_ERRCODE_MSG(E, -errno, fmt, ##arg) diff --git a/src/common/userinfo-list.h b/src/common/userinfo-list.h index ce24113d..b60691e6 100644 --- a/src/common/userinfo-list.h +++ b/src/common/userinfo-list.h @@ -30,9 +30,6 @@ #include "resourced.h" -#define DEFAULT_USER_SIZE 16 -#define USER_BASE_UID 5001 - #define userinfo_for_each(elem, list) \ guint _ui_idx; \ struct user_info *elem; \ diff --git a/src/common/util.h b/src/common/util.h index 24a45836..25745c73 100644 --- a/src/common/util.h +++ b/src/common/util.h @@ -72,36 +72,26 @@ static inline void closedirp(DIR **d) #define _cleanup_free_ _cleanup_(freep) #define _cleanup_close_ _cleanup_(closep) #define _cleanup_fclose_ _cleanup_(fclosep) -#define _cleanup_pclose_ _cleanup_(pclosep) #define _cleanup_closedir_ _cleanup_(closedirp) #define NUM_DIFF(x, y) ((x > y) ? (x - y) : (y -x)) #define BYTE_TO_KBYTE(b) ((b) >> 10) #define BYTE_TO_MBYTE(b) ((b) >> 20) -#define BYTE_TO_GBYTE(b) ((b) >> 30) #define BYTE_TO_PAGE(b) ((b) >> 12) #define KBYTE_TO_BYTE(k) ((k) << 10) #define KBYTE_TO_MBYTE(k) ((k) >> 10) -#define KBYTE_TO_GBYTE(k) ((k) >> 20) #define MBYTE_TO_BYTE(m) ((m) << 20) #define MBYTE_TO_KBYTE(m) ((m) << 10) -#define MBYTE_TO_GBYTE(m) ((m) >> 10) - -#define GBYTE_TO_BYTE(g) ((g) << 30) -#define GBYTE_TO_KBYTE(g) ((g) << 20) -#define GBYTE_TO_MBYTE(g) ((g) << 10) #define streq(a, b) (strncmp((a), (b), strlen(b)+1) == 0) #define strneq(a, b, n) (strncmp((a), (b), (n)) == 0) #define strcaseeq(a, b) (strcasecmp((a), (b)) == 0) -#define strncaseeq(a, b, n) (strncasecmp((a), (b), (n)) == 0) #define new(t, n) ((t*) malloc(sizeof(t) * (n))) #define new0(t, n) ((t*) calloc((n), sizeof(t))) -#define malloc0(n) (calloc((n), 1)) static inline bool is_empty(const char *p) { diff --git a/src/cpu/cpu.c b/src/cpu/cpu.c index 61880442..b7bad098 100644 --- a/src/cpu/cpu.c +++ b/src/cpu/cpu.c @@ -64,8 +64,6 @@ #define CPU_DEFAULT_PRI 0 #define CPU_BACKGROUND_PRI 1 #define CPU_CONTROL_PRI 10 -#define CPU_HIGHAPP_PRI -5 -#define CPU_QUOTA_PERIOD_USEC 1000 static GSource *cpu_predefined_timer; static bool bCPUQuota; diff --git a/src/heart/heart-battery.c b/src/heart/heart-battery.c index e2e8ad0e..682bb16c 100644 --- a/src/heart/heart-battery.c +++ b/src/heart/heart-battery.c @@ -59,7 +59,6 @@ #define BATTERY_HISTORY_DAY_MAX 7 #define BATTERY_HISTORY_RESET_MAX 5 #define BATTERY_HISTORY_RESET_CURRENT (BATTERY_HISTORY_RESET_MAX - 1) -#define BATTERY_HISTORY_SECONDS_MAX DAY_TO_SEC(BATTERY_HISTORY_DAY_MAX) #define BATTERY_HISTORY_COUNT_MAX 1000 #define HEART_BATTERY_UPDATE_INTERVAL HALF_HOUR #define HEART_BATTERY_SAVE_INTERVAL HALF_HOUR diff --git a/src/heart/heart-storage.c b/src/heart/heart-storage.c index 6c3b35fb..43d99be8 100644 --- a/src/heart/heart-storage.c +++ b/src/heart/heart-storage.c @@ -45,7 +45,6 @@ #include <sqlite3.h> -#define HEART_STORAGE_DB RD_SYS_DB"/.resourced-logging-storage.db" #define STORAGE_NAME "storage" static bool heart_storage_initailized = false; diff --git a/src/heart/include/logging.h b/src/heart/include/logging.h index 46ec948c..09092432 100644 --- a/src/heart/include/logging.h +++ b/src/heart/include/logging.h @@ -35,9 +35,6 @@ #define CLOCK_BOOTTIME 7 #endif -#define STRINGFY(x) #x -#define KEY_TO_STRING(x) STRINGFY(x) - #define DEFAULT_DB_NAME ".resourced-heart-default.db" #define OWN_DB_NAME ".resourced-heart-%s.db" #define SYSTEM_DEFAULT_DB_NAME RD_SYS_DB"/"DEFAULT_DB_NAME diff --git a/src/memory/compaction.c b/src/memory/compaction.c index 357ae075..f42f53eb 100644 --- a/src/memory/compaction.c +++ b/src/memory/compaction.c @@ -45,7 +45,6 @@ * when the fragmentation level reaches specified * value for at least one of supported page orders. */ -#define ZONE_FRAG_WARN_NONE (0) #define ZONE_FRAG_WARN_RAISE (0x1 << 0) /* Internal compaction module states */ @@ -71,8 +70,6 @@ #define MAX_PAGE_ORDER 0xa #define ZONE_MAX_NR 4 -#define HIGH_ORDER_SHIFT 0x5 -#define LOW_ORDER_MASK 0xfe #define PROC_COMPACT_ENTRY "/proc/sys/vm/compact_memory" #define MEM_CONF_FILE RD_CONFIG_FILE(memory) diff --git a/src/memory/vmpressure-lowmem-handler.c b/src/memory/vmpressure-lowmem-handler.c index 9837d2c4..ed3ad3a4 100644 --- a/src/memory/vmpressure-lowmem-handler.c +++ b/src/memory/vmpressure-lowmem-handler.c @@ -83,7 +83,6 @@ #define BUF_MAX 1024 #define MAX_VICTIMS_BETWEEN_CHECK 3 #define MAX_PROACTIVE_HIGH_VICTIMS 4 -#define MAX_PROACTIVE_LOW_VICTIMS 2 #define OOM_TIMER_INTERVAL 2 #define OOM_KILLER_PRIORITY -20 #define MAX_MEMPS_LOGS 50 @@ -96,7 +95,6 @@ #define MEM_SIZE_512 512 /* MB */ #define MEM_SIZE_768 768 /* MB */ #define MEM_SIZE_1024 1024 /* MB */ -#define MEM_SIZE_2048 2048 /* MB */ /* thresholds for 64M RAM*/ #define PROACTIVE_64_THRES 10 /* MB */ diff --git a/src/proc-stat/proc-monitor.c b/src/proc-stat/proc-monitor.c index a27d05a3..8c7bb8fa 100644 --- a/src/proc-stat/proc-monitor.c +++ b/src/proc-stat/proc-monitor.c @@ -55,8 +55,6 @@ #define DEFAULT_APPID "NULL" #define INIT_PID 1 -#define INIT_PROC_VAL -1 -#define HZ 100 #define POWER_OFF_DIRECT 2 static int current_lcd_state; diff --git a/src/swap/swap.c b/src/swap/swap.c index 945a1bbb..29909fc8 100644 --- a/src/swap/swap.c +++ b/src/swap/swap.c @@ -61,8 +61,6 @@ #define MOVE_CHARGE "memory.move_charge_at_immigrate" #define SWAP_PRIORITY 20 -#define SWAP_SORT_MAX 10 -#define MAX_PIDS 3 #define SWAP_HARD_LIMIT_DEFAULT 0.5 #define SWAP_FORCE_RECLAIM_NUM_MAX 5 #define SWAP_RECLAIM_PAGES_MAX 2560 diff --git a/tests/watchdog-test.c b/tests/watchdog-test.c index 7deff90c..5f9e88bb 100644 --- a/tests/watchdog-test.c +++ b/tests/watchdog-test.c @@ -33,7 +33,6 @@ #define EXIT_OK 0 /* test passed */ #define EXIT_ERROR 1 /* test failed */ #define EXIT_FAIL 2 /* testing framework failed */ -#define EXIT_SKIP 7 /* test skipped */ #define DESTINATION "org.tizen.resourced" #define PATH "/Org/Tizen/ResourceD/Watchdog" |