4 * Copyright (c) 2013 Samsung Electronics Co., Ltd. All rights reserved.
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
22 * @desc intialize and start pthread for lowmem handler
25 #ifndef __PROC_MAIN_H__
26 #define __PROC_MAIN_H__
31 #include "daemon-options.h"
32 #include "resourced.h"
35 #define PROC_BUF_MAX 64
36 #define PROC_NAME_MAX 512
38 typedef GSList *pid_info_list;
40 enum application_type {
41 RESOURCED_APP_TYPE_UNKNOWN,
42 RESOURCED_APP_TYPE_GUI,
43 RESOURCED_APP_TYPE_SERVICE,
44 RESOURCED_APP_TYPE_GROUP,
49 enum application_type type; /* not so fancy */
52 struct proc_process_info_t {
53 char appid[MAX_PATH_LENGTH];
54 char pkgname[MAX_PATH_LENGTH];
66 struct proc_process_info_t *processinfo;
69 enum proc_exclude_type {
79 enum proc_prelaunch_flags {
80 PROC_LARGE_HEAP = 0x01u, /* for mark large heap */
81 PROC_SIGTERM = 0x02u, /* for make killer kill victim by SIGTERM */
84 extern int current_lcd_state;
87 void proc_add_pid_list(struct proc_process_info_t *process_info, int pid, enum application_type type);
89 int resourced_proc_init(const struct daemon_opts *opts);
92 * @desc This function handle PROC_ typs @see
94 int resourced_proc_action(int type, int argnum, char **arg);
96 int resourced_proc_excluded(const char *app_name);
98 int resourced_proc_status_change(int type, pid_t pid, char* app_name, char* pkg_name);
100 struct proc_process_info_t *find_process_info(const char *appid, const pid_t pid, const char *pkgid);
102 struct pid_info_t *new_pid_info(const pid_t pid, const int type);
104 void proc_set_process_info_memcg(struct proc_process_info_t *process_info, int memcg_idx);
105 resourced_ret_c proc_set_runtime_exclude_list(const int pid, int type);
106 struct proc_process_info_t *proc_add_process_list(const int type, const pid_t pid, const char *appid, const char *pkgid);
107 int proc_remove_process_list(const pid_t pid);
108 void proc_set_apptype(const char *appid, const char *pkgid, int type);
111 #endif /*__PROC_MAIN_H__ */