Remove direct header include and function call from lowmem and lowmem-controller modlue to process module.
This is problem because lowmem and lowmem-controller can access and call all functions in defined proc-main.h.
It means that there is strong dependency between them.
It is essential procedure to remove dependency between different modules.
Change-Id: Iad02d8fe3b54bc32b90f11e0ebe122e01463e8c7
Signed-off-by: Unsung Lee <unsung.lee@samsung.com>
struct proc_conf_info* fixed_app_and_service_exist_check(const char *name, enum proc_type proc_type);
enum proc_action fixed_app_and_service_watchdog_action(const char *name, enum proc_type proc_type);
+int proc_common_request_process_termination(pid_t pid, char *app_name, char *pkg_name, int app_type);
+
#ifdef __cplusplus
}
#endif /* __cplusplus */
return PROC_STATE_DEFAULT;
}
+int proc_common_request_process_termination(pid_t pid, char *app_name, char *pkg_name, int app_type)
+{
+ switch(app_type) {
+ case PROC_TYPE_NONE:
+ case PROC_TYPE_READY:
+ case PROC_TYPE_GUI:
+ case PROC_TYPE_SERVICE:
+ case PROC_TYPE_GROUP:
+ case PROC_TYPE_WATCH:
+ case PROC_TYPE_WIDGET:
+ break;
+ default:
+ _E("Failed to ask terminate request: invalid app_type (%d)", app_type);
+ return RESOURCED_ERROR_INVALID_PARAMETER;
+ }
+
+ return resourced_proc_status_change(PROC_CGROUP_SET_TERMINATE_REQUEST,
+ pid, app_name, pkg_name, app_type);
+}
+
int resourced_proc_status_change(int status, pid_t pid, char *app_name, char *pkg_name, int apptype)
{
int ret = 0, oom_score_adj = 0;
#include "lowmem.h"
#include "lowmem-limit.h"
#include "proc-common.h"
-#include "proc-main.h"
#include "resourced.h"
#include "procfs.h"
#include "trace.h"
* else proc_app_info_oom_killed is NULL.
*/
if (tsk->proc_app_info_oom_killed != NULL) {
- resourced_proc_status_change(PROC_CGROUP_SET_TERMINATE_REQUEST,
- pid, NULL, NULL, PROC_TYPE_NONE);
+ proc_common_request_process_termination(pid, NULL, NULL, PROC_TYPE_NONE);
if (tsk->oom_score_lru <= OOMADJ_BACKGRD_LOCKED) {
sigterm = 1;
#include "cgroup.h"
#include "memory-cgroup.h"
#include "heart-common.h"
-#include "proc-main.h"
#include "dbus-handler.h"
#include "util.h"
#include "fd-handler.h"