4 * Copyright (c) 2000 - 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.
23 * @desc Performance management API
26 * Created on: May 30, 2012
29 #ifndef _SYSTEM_RESOURCE_RESOURCED_H_
30 #define _SYSTEM_RESOURCE_RESOURCED_H_
32 #include <sys/types.h>
36 #endif /* __cplusplus */
38 #define RESOURCED_ALL_APP "RESOURCED_ALL_APPLICATION_IDENTIFIER"
39 #define TETHERING_APP_NAME "RESOURCED_TETHERING_APPLICATION_IDENTIFIER"
43 * @brief return code of the rsml's function
46 RESOURCED_ERROR_NONMONITOR = -9, /** < Process don't show watchdog popup */
47 RESOURCED_ERROR_NONFREEZABLE = -8, /** < Process is nonfrizable */
48 RESOURCED_ERROR_NOTIMPL = -7, /**< Not implemented yet error */
49 RESOURCED_ERROR_UNINITIALIZED = -6, /**< Cgroup doen't
50 mounted or daemon not started */
51 RESOURCED_ERROR_NO_DATA = -5, /**< Success, but no data */
52 RESOURCED_ERROR_INVALID_PARAMETER = -4,/**< Invalid parameter */
53 RESOURCED_ERROR_OUT_OF_MEMORY = -3, /**< Out of memory */
54 RESOURCED_ERROR_DB_FAILED = -2, /**< Database error */
55 RESOURCED_ERROR_FAIL = -1, /**< General error */
56 RESOURCED_ERROR_NONE = 0 /**< General success */
59 #define RESOURCED_ERROR_OK RESOURCED_ERROR_NONE
62 * @brief return type of the counters callback
65 RESOURCED_CANCEL = 0, /**< cancel */
66 RESOURCED_CONTINUE = 1, /**< continue */
70 * @desc After invoking this function, application will be in
71 * the monitored scope.
72 * @details It creates an appropriate cgroup,
73 * it generates classid for the network performance control.
74 * @param app_id[in] - application identifier, it's package name now
75 * @param pid - pid to put in to cgroup, or self pid of 0
76 * @return 0 if success or error code
78 resourced_ret_c join_app_performance(const char *app_id, const pid_t pid);
82 #endif /* __cplusplus */
84 #endif /* _SYSTEM_RESOURCE_RESOURCED_H_ */