2 * Copyright (c) 2011 - 2015 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the License);
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an AS IS BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #ifndef __TIZEN_SYSTEM_RUNTIME_INFO_H__
18 #define __TIZEN_SYSTEM_RUNTIME_INFO_H__
29 * @addtogroup CAPI_SYSTEM_RUNTIME_INFO_MODULE
35 * @brief Enumeration for error codes for runtime information.
36 * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
39 RUNTIME_INFO_ERROR_NONE = TIZEN_ERROR_NONE, /**< Successful */
40 RUNTIME_INFO_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER, /**< Invalid parameter */
41 RUNTIME_INFO_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY, /**< Out of memory */
42 RUNTIME_INFO_ERROR_IO_ERROR = TIZEN_ERROR_IO_ERROR, /**< An input/output error occurred when read value from system */
43 RUNTIME_INFO_ERROR_REMOTE_IO = TIZEN_ERROR_REMOTE_IO, /**< Remote I/O error occurred */
44 RUNTIME_INFO_ERROR_PERMISSION_DENIED = TIZEN_ERROR_PERMISSION_DENIED, /**< No permission to use the api */
45 RUNTIME_INFO_ERROR_NOT_SUPPORTED = TIZEN_ERROR_NOT_SUPPORTED, /**< Not supported parameter */
46 RUNTIME_INFO_ERROR_NO_DATA = TIZEN_ERROR_NO_DATA /**< No data available (Since 3.0) */
47 } runtime_info_error_e;
51 * @brief Enumeration for keys for runtime information.
52 * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
55 RUNTIME_INFO_KEY_BLUETOOTH_ENABLED = 2, /**<Indicates whether Bluetooth is enabled. */
56 RUNTIME_INFO_KEY_WIFI_HOTSPOT_ENABLED = 3, /**<Indicates whether Wi-Fi hotspot is enabled. */
57 RUNTIME_INFO_KEY_BLUETOOTH_TETHERING_ENABLED = 4, /**<Indicates whether Bluetooth tethering is enabled. */
58 RUNTIME_INFO_KEY_USB_TETHERING_ENABLED = 5, /**<Indicates whether USB tethering is enabled. */
59 RUNTIME_INFO_KEY_PACKET_DATA_ENABLED = 9, /**<Indicates Whether the packet data through 3G network is enabled. */
60 RUNTIME_INFO_KEY_DATA_ROAMING_ENABLED = 10, /**<Indicates whether data roaming is enabled. */
61 RUNTIME_INFO_KEY_VIBRATION_ENABLED = 12, /**<Indicates whether vibration is enabled. */
62 RUNTIME_INFO_KEY_AUDIO_JACK_CONNECTED = 17, /**<Indicates whether audio jack is connected. */
63 RUNTIME_INFO_KEY_GPS_STATUS = 18, /**<Indicates the current status of GPS. */
64 RUNTIME_INFO_KEY_BATTERY_IS_CHARGING = 19, /**<Indicates the battery is currently charging. */
65 RUNTIME_INFO_KEY_TV_OUT_CONNECTED = 20, /**<Indicates whether TV out is connected. */
66 RUNTIME_INFO_KEY_AUDIO_JACK_STATUS = 21, /**<Indicates the current status of audio jack. */
67 RUNTIME_INFO_KEY_USB_CONNECTED = 23, /**<Indicates whether USB is connected. */
68 RUNTIME_INFO_KEY_CHARGER_CONNECTED = 24, /**<Indicates whether charger is connected. */
69 RUNTIME_INFO_KEY_AUTO_ROTATION_ENABLED = 26, /**<Indicates whether auto rotation is enabled. */
74 * @brief Enumeration for Wi-Fi status.
75 * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
78 RUNTIME_INFO_WIFI_STATUS_DISABLED, /**< Wi-Fi is disabled. */
79 RUNTIME_INFO_WIFI_STATUS_UNCONNECTED, /**< Wi-Fi is enabled and network connection is not established. */
80 RUNTIME_INFO_WIFI_STATUS_CONNECTED, /**< Network connection is established in Wi-Fi network. */
81 } runtime_info_wifi_status_e;
85 * @brief Enumeration for GPS status.
86 * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
89 RUNTIME_INFO_GPS_STATUS_DISABLED, /**< GPS is disabled. */
90 RUNTIME_INFO_GPS_STATUS_SEARCHING, /**< GPS is searching for satellites. */
91 RUNTIME_INFO_GPS_STATUS_CONNECTED, /**< GPS connection is established. */
92 } runtime_info_gps_status_e;
95 * @brief Enumeration for audio jack status.
96 * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
99 RUNTIME_INFO_AUDIO_JACK_STATUS_UNCONNECTED, /**< Audio jack is not connected */
100 RUNTIME_INFO_AUDIO_JACK_STATUS_CONNECTED_3WIRE, /**< 3-conductor wire is connected. */
101 RUNTIME_INFO_AUDIO_JACK_STATUS_CONNECTED_4WIRE, /**< 4-conductor wire is connected. */
102 } runtime_info_audio_jack_status_e;
106 * @brief Called when the runtime information changes.
107 * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
109 * @param[in] key The type of notification
110 * @param[in] user_data The user data passed from the callback registration function
112 * @pre runtime_info_set_changed_cb() will invoke this callback function.
113 * @see runtime_info_set_changed_cb()
114 * @see runtime_info_unset_changed_cb()
116 typedef void (*runtime_info_changed_cb)(runtime_info_key_e key, void *user_data);
120 * @brief Gets the integer value of the runtime information.
121 * @details This function gets current state of the given key which represents specific runtime information.
122 * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
124 * @param[in] key The runtime information status key from which data should be read
125 * @param[out] value The current value of the given key
127 * @return @c 0 on success,
128 * otherwise a negative error value
129 * @retval #RUNTIME_INFO_ERROR_NONE Successful
130 * @retval #RUNTIME_INFO_ERROR_INVALID_PARAMETER Invalid parameter
131 * @retval #RUNTIME_INFO_ERROR_IO_ERROR An input/output error occurred when read value from system
132 * @retval #RUNTIME_INFO_ERROR_PERMISSION_DENIED No permission to use the api
133 * @retval #RUNTIME_INFO_ERROR_NOT_SUPPORTED Not supported parameter
135 int runtime_info_get_value_int(runtime_info_key_e key, int *value);
139 * @brief Gets the boolean value from the runtime information.
140 * @details This function gets current state of the given key which represents specific runtime information.
141 * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
143 * @param[in] key The runtime information key from which data should be read
144 * @param[out] value The current value of the given key
146 * @return @c 0 on success,
147 * otherwise a negative error value
148 * @retval #RUNTIME_INFO_ERROR_NONE Successful
149 * @retval #RUNTIME_INFO_ERROR_INVALID_PARAMETER Invalid parameter
150 * @retval #RUNTIME_INFO_ERROR_IO_ERROR An input/output error occurred when read value from system
151 * @retval #RUNTIME_INFO_ERROR_PERMISSION_DENIED No permission to use the api
152 * @retval #RUNTIME_INFO_ERROR_NOT_SUPPORTED Not supported parameter
154 int runtime_info_get_value_bool(runtime_info_key_e key, bool *value);
158 * @brief Gets the double value from the runtime information.
159 * @details This function gets current state of the given key which represents specific runtime information.
160 * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
162 * @param[in] key The runtime information key from which data should be read
163 * @param[out] value The current value of the given key
165 * @return @c 0 on success,
166 * otherwise a negative error value
167 * @retval #RUNTIME_INFO_ERROR_NONE Successful
168 * @retval #RUNTIME_INFO_ERROR_INVALID_PARAMETER Invalid parameter
169 * @retval #RUNTIME_INFO_ERROR_IO_ERROR An input/output error occurred when read value from system
170 * @retval #RUNTIME_INFO_ERROR_PERMISSION_DENIED No permission to use the api
171 * @retval #RUNTIME_INFO_ERROR_NOT_SUPPORTED Not supported parameter
173 int runtime_info_get_value_double(runtime_info_key_e key, double *value);
177 * @brief Gets the string value for specified runtime information.
178 * @details This function gets current state of the given key which represents specific runtime information.
179 * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
181 * @remarks You must release @a value using free().
183 * @param[in] key The runtime information key from which data should be read
184 * @param[out] value The current value of the given key
186 * @return @c 0 on success,
187 * otherwise a negative error value
188 * @retval #RUNTIME_INFO_ERROR_NONE Successful
189 * @retval #RUNTIME_INFO_ERROR_INVALID_PARAMETER Invalid parameter
190 * @retval #RUNTIME_INFO_ERROR_IO_ERROR An input/output error occurred when read value from system
191 * @retval #RUNTIME_INFO_ERROR_OUT_OF_MEMORY Out of memory
192 * @retval #RUNTIME_INFO_ERROR_PERMISSION_DENIED No permission to use the api
193 * @retval #RUNTIME_INFO_ERROR_NOT_SUPPORTED Not supported parameter
195 int runtime_info_get_value_string(runtime_info_key_e key, char **value);
199 * @brief Registers a change event callback for given runtime information key.
200 * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
202 * @param[in] key The runtime information type
203 * @param[in] callback The callback function to invoke
204 * @param[in] user_data The user data to be passed to the callback function
206 * @return @c 0 on success,
207 * otherwise a negative error value
208 * @retval #RUNTIME_INFO_ERROR_NONE Successful
209 * @retval #RUNTIME_INFO_ERROR_INVALID_PARAMETER Invalid parameter
210 * @retval #RUNTIME_INFO_ERROR_PERMISSION_DENIED No permission to use the api
211 * @retval #RUNTIME_INFO_ERROR_NOT_SUPPORTED Not supported parameter
213 * @post runtime_info_changed_cb() will be invoked.
214 * @see runtime_info_unset_changed_cb()
215 * @see runtime_info_changed_cb()
217 int runtime_info_set_changed_cb(runtime_info_key_e key, runtime_info_changed_cb callback, void *user_data);
221 * @brief Unregisters the callback function.
222 * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
224 * @param[in] key The runtime information type
226 * @return @c 0 on success,
227 * otherwise a negative error value
228 * @retval #RUNTIME_INFO_ERROR_NONE Successful
229 * @retval #RUNTIME_INFO_ERROR_INVALID_PARAMETER Invalid parameter
231 * @see runtime_info_set_changed_cb()
233 int runtime_info_unset_changed_cb(runtime_info_key_e key);
237 * @brief Structure for memory information.
238 * @since_tizen @if WEARABLE 3.0 @else 2.4 @endif
241 int total; /**< Total memory (KiB) */
242 int used; /**< Used memory (KiB) */
243 int free; /**< Free memory (KiB) */
244 int cache; /**< Cache memory (KiB) */
245 int swap; /**< Swap memory (KiB) */
246 } runtime_memory_info_s;
250 * @brief Gets system memory information.
251 * @since_tizen @if WEARABLE 3.0 @else 2.4 @endif
253 * @param[out] info The system memory information structure
255 * @return @c 0 on success,
256 * otherwise a negative error value
257 * @retval #RUNTIME_INFO_ERROR_NONE Successful
258 * @retval #RUNTIME_INFO_ERROR_INVALID_PARAMETER Invalid parameter
259 * @retval #RUNTIME_INFO_ERROR_IO_ERROR An Input/Output error occurred while reading from system
261 * @see runtime_info_get_process_memory_info()
263 int runtime_info_get_system_memory_info(runtime_memory_info_s *info);
267 * @brief Structure for memory information per process.
268 * @since_tizen @if WEARABLE 3.0 @else 2.4 @endif
271 int vsz; /**< Virtual memory size (KiB) */
272 int rss; /**< Resident set size (KiB) */
273 int pss; /**< Proportional set size (KiB) */
274 int shared_clean; /**< Not modified and mapped by other processes (KiB) */
275 int shared_dirty; /**< Modified and mapped by other processes (KiB) */
276 int private_clean; /**< Not modified and available only to that process (KiB) */
277 int private_dirty; /**< Modified and available only to that process (KiB) */
278 } process_memory_info_s;
282 * @brief Gets memory information per process.
283 * @since_tizen @if WEARABLE 3.0 @else 2.4 @endif
286 * @privilege %http://tizen.org/privilege/systemmonitor
287 * @remarks You must release @a s value using free(). \n
288 * The size of @a s is the same with @a size.
290 * @param[in] pid The process unique id array
291 * @param[in] size The size of pid array
292 * @param[out] info The memory information structure array of the processes
294 * @return @c 0 on success,
295 * otherwise a negative error value
296 * @retval #RUNTIME_INFO_ERROR_NONE Successful
297 * @retval #RUNTIME_INFO_ERROR_INVALID_PARAMETER Invalid parameter
298 * @retval #RUNTIME_INFO_ERROR_OUT_OF_MEMORY Not able to allocate memory (for output param/other operations)
299 * @retval #RUNTIME_INFO_ERROR_REMOTE_IO Call to resource daemon failed (dbus errors/resource daemon errors)
300 * @retval #RUNTIME_INFO_ERROR_IO_ERROR An I/O error during dbus message operations
301 * @retval #RUNTIME_INFO_ERROR_PERMISSION_DENIED Process not authorized to request process usage info
303 * @see runtime_info_get_system_memory_info()
305 int runtime_info_get_process_memory_info(int *pid, int size, process_memory_info_s **info);
309 * @brief Structure for CPU usage.
310 * @since_tizen @if WEARABLE 3.0 @else 2.4 @endif
313 double user; /**< Time running un-niced user processes (Percent) */
314 double system; /**< Time running kernel processes (Percent) */
315 double nice; /**< Time running niced user processes (Percent) */
316 double iowait; /**< Time waiting for I/O completion (Percent) */
317 } runtime_cpu_usage_s;
321 * @brief Gets CPU information.
322 * @since_tizen @if WEARABLE 3.0 @else 2.4 @endif
324 * @param[out] usage The CPU usage structure
326 * @return @c 0 on success,
327 * otherwise a negative error value
328 * @retval #RUNTIME_INFO_ERROR_NONE Successful
329 * @retval #RUNTIME_INFO_ERROR_INVALID_PARAMETER Invalid parameter
330 * @retval #RUNTIME_INFO_ERROR_IO_ERROR An input/output error occurred while reading from system
332 * @see runtime_info_get_process_cpu_usage()
334 int runtime_info_get_cpu_usage(runtime_cpu_usage_s *usage);
338 * @brief Structure for CPU usage per process.
339 * @since_tizen @if WEARABLE 3.0 @else 2.4 @endif
342 int utime; /**< Amount of time that this process has been scheduled in user mode (clock ticks) */
343 int stime; /**< Amount of time that this process has been scheduled in kernel mode (clock ticks) */
344 } process_cpu_usage_s;
348 * @brief Gets CPU usage per process.
349 * @since_tizen @if WEARABLE 3.0 @else 2.4 @endif
352 * @privilege %http://tizen.org/privilege/systemmonitor
353 * @remarks You must release @a s value using free(). \n
354 * The size of @a s is the same with @a size.
356 * @param[in] pid The process unique id array
357 * @param[in] size The size of pid array
358 * @param[out] usage The CPU usage structure array of the processes
360 * @return @c 0 on success,
361 * otherwise a negative error value
362 * @retval #RUNTIME_INFO_ERROR_NONE Successful
363 * @retval #RUNTIME_INFO_ERROR_INVALID_PARAMETER Invalid parameter
364 * @retval #RUNTIME_INFO_ERROR_OUT_OF_MEMORY Not able to allocate memory (for output param/other operations)
365 * @retval #RUNTIME_INFO_ERROR_REMOTE_IO Call to resource daemon failed (dbus errors/resource daemon errors)
366 * @retval #RUNTIME_INFO_ERROR_IO_ERROR An I/O error occurred (during dbus message operations/other IO operations)
367 * @retval #RUNTIME_INFO_ERROR_PERMISSION_DENIED Process not authorized to request process usage info
369 * @see runtime_info_get_cpu_usage()
371 int runtime_info_get_process_cpu_usage(int *pid, int size, process_cpu_usage_s **usage);
375 * @brief Gets the number of processors.
378 * @param[out] num_core The number of whole processors
380 * @return @c 0 on success,
381 * otherwise a negative error value
382 * @retval #RUNTIME_INFO_ERROR_NONE Successful
383 * @retval #RUNTIME_INFO_ERROR_INVALID_PARAMETER Invalid parameter
384 * @retval #RUNTIME_INFO_ERROR_IO_ERROR An I/O error occurred (during file open operation)
386 int runtime_info_get_processor_count(int *num_core);
390 * @brief Gets the current frequency of processor.
393 * @param[in] core_idx The index (from 0) of CPU core that you want to know the frequency
394 * @param[out] cpu_freq The current frequency(MHz) of processor
396 * @return @c 0 on success,
397 * otherwise a negative error value
398 * @retval #RUNTIME_INFO_ERROR_NONE Successful
399 * @retval #RUNTIME_INFO_ERROR_INVALID_PARAMETER Invalid parameter
400 * @retval #RUNTIME_INFO_ERROR_IO_ERROR An I/O error occurred (during file open operation)
401 * @retval #RUNTIME_INFO_ERROR_NO_DATA No data available (Since 3.0)
403 int runtime_info_get_processor_current_frequency(int core_idx, int *cpu_freq);
407 * @brief Gets the max frequency of processor.
410 * @param[in] core_idx The index (from 0) of CPU core that you want to know the frequency
411 * @param[out] cpu_freq The max frequency(MHz) of processor
413 * @return @c 0 on success,
414 * otherwise a negative error value
415 * @retval #RUNTIME_INFO_ERROR_NONE Successful
416 * @retval #RUNTIME_INFO_ERROR_INVALID_PARAMETER Invalid parameter
417 * @retval #RUNTIME_INFO_ERROR_IO_ERROR An I/O error occurred (during file open operation)
418 * @retval #RUNTIME_INFO_ERROR_NO_DATA No data available (Since 3.0)
420 int runtime_info_get_processor_max_frequency(int core_idx, int *cpu_freq);
424 * @brief Gets the physical memory size.
427 * @param[out] size Physical memory size (KiB)
429 * @return @c 0 on success,
430 * otherwise a negative error value
431 * @retval #RUNTIME_INFO_ERROR_NONE Successful
432 * @retval #RUNTIME_INFO_ERROR_INVALID_PARAMETER Invalid parameter
433 * @retval #RUNTIME_INFO_ERROR_IO_ERROR An I/O error occurred (during file open operation)
435 int runtime_info_get_physical_memory_size(int *size);
439 * @brief Handle for app usage information.
442 typedef struct app_usages_s *app_usage_h;
446 * @brief Frees an app usage handle.
449 * @param[in] handle App usage handle to free
451 * @return @c 0 on success,
452 * otherwise a negative error value
453 * @retval #RUNTIME_INFO_ERROR_NONE Successful
454 * @retval #RUNTIME_INFO_ERROR_INVALID_PARAMETER Invalid parameter
456 int runtime_info_app_usage_destroy(app_usage_h handle);
460 * @brief Gets the app count from an app usage handle.
463 * @param[in] handle The app usage handle
464 * @param[out] count The number of apps on the app list
466 * @return @c 0 on success,
467 * otherwise a negative error value
468 * @retval #RUNTIME_INFO_ERROR_NONE Successful
469 * @retval #RUNTIME_INFO_ERROR_INVALID_PARAMETER Invalid parameter
471 * @see runtime_info_get_all_apps_memory_usage()
472 * @see runtime_info_get_all_apps_cpu_rate()
474 int runtime_info_app_usage_get_count(app_usage_h handle, int *count);
478 * @brief Gets the app ID from an app usage handle.
481 * @remarks You must release @a appid using free().
483 * @param[in] handle The app usage handle
484 * @param[in] index The index in the app list; should be between 0 and @a count - 1 (inclusive), \n
485 * where @a count is provided by runtime_info_app_usage_get_count()
486 * @param[out] appid The app ID
488 * @return @c 0 on success,
489 * otherwise a negative error value
490 * @retval #RUNTIME_INFO_ERROR_NONE Successful
491 * @retval #RUNTIME_INFO_ERROR_INVALID_PARAMETER Invalid parameter
493 * @see runtime_info_get_all_apps_memory_usage()
494 * @see runtime_info_get_all_apps_cpu_rate()
496 int runtime_info_app_usage_get_appid(app_usage_h handle, int index, char **appid);
500 * @brief Gets resource usage from an app usage handle.
503 * @remarks The meaning of @a usage depends on which function was used to create @a handle.
505 * @param[in] handle The app usage handle
506 * @param[in] index The index in the app list; should be between 0 and @a count - 1 (inclusive), \n
507 * where @a count is provided by runtime_info_app_usage_get_count()
508 * @param[out] usage Resource usage
510 * @return @c 0 on success,
511 * otherwise a negative error value
512 * @retval #RUNTIME_INFO_ERROR_NONE Successful
513 * @retval #RUNTIME_INFO_ERROR_INVALID_PARAMETER Invalid parameter
515 * @see runtime_info_get_all_apps_memory_usage()
516 * @see runtime_info_get_all_apps_cpu_rate()
518 int runtime_info_app_usage_get_usage(app_usage_h handle, int index, unsigned int *usage);
522 * @brief Gets memory usage of all apps.
526 * @privilege %http://tizen.org/privilege/systemmonitor
527 * @remarks You must release @a usage using runtime_info_app_usage_destroy().
529 * @param[out] usage An array of each app's memory usage (KB)
531 * @return @c 0 on success,
532 * otherwise a negative error value
533 * @retval #RUNTIME_INFO_ERROR_NONE Successful
534 * @retval #RUNTIME_INFO_ERROR_INVALID_PARAMETER Invalid parameter
535 * @retval #RUNTIME_INFO_ERROR_OUT_OF_MEMORY Not able to allocate memory (for output param/other operations)
536 * @retval #RUNTIME_INFO_ERROR_REMOTE_IO Call to resource daemon failed (dbus errors/resource daemon errors)
537 * @retval #RUNTIME_INFO_ERROR_IO_ERROR An I/O error during dbus message operations
538 * @retval #RUNTIME_INFO_ERROR_PERMISSION_DENIED Process not authorized to request app usage info
539 * @retval #RUNTIME_INFO_ERROR_NO_DATA No app running
542 * #include <runtime_info.h>
544 * void print_memory_usage(void)
548 * app_usage_h mem_usage_handle;
550 * unsigned int usage;
552 * runtime_info_get_all_apps_memory_usage(&mem_usage_handle);
553 * runtime_info_app_usage_get_count(mem_usage_handle, &count);
555 * for (i = 0; i < count; i++) {
556 * runtime_info_app_usage_get_appid(mem_usage_handle, i, &appid);
557 * runtime_info_app_usage_get_usage(mem_usage_handle, i, &usage);
558 * printf("appid = %s, usage = %u KB\n", appid, usage);
562 * runtime_info_app_usage_destroy(mem_usage_handle);
567 int runtime_info_get_all_apps_memory_usage(app_usage_h *usage);
571 * @brief Gets CPU rate of all apps.
575 * @privilege %http://tizen.org/privilege/systemmonitor
576 * @remarks You must release @a rate using runtime_info_app_usage_destroy().
578 * @param[out] rate An array of each app's CPU usage rate (%), the values are rounded down.
580 * @return @c 0 on success,
581 * otherwise a negative error value
582 * @retval #RUNTIME_INFO_ERROR_NONE Successful
583 * @retval #RUNTIME_INFO_ERROR_INVALID_PARAMETER Invalid parameter
584 * @retval #RUNTIME_INFO_ERROR_OUT_OF_MEMORY Not able to allocate memory (for output param/other operations)
585 * @retval #RUNTIME_INFO_ERROR_REMOTE_IO Call to resource daemon failed (dbus errors/resource daemon errors)
586 * @retval #RUNTIME_INFO_ERROR_IO_ERROR An I/O error during dbus message operations
587 * @retval #RUNTIME_INFO_ERROR_PERMISSION_DENIED Process not authorized to request app usage info
588 * @retval #RUNTIME_INFO_ERROR_NO_DATA No app running
591 * #include <runtime_info.h>
593 * void print_cpu_usage(void)
597 * app_usage_h cpu_rate_handle;
601 * runtime_info_get_all_apps_cpu_rate(&cpu_rate_handle);
602 * runtime_info_app_usage_get_count(cpu_rate_handle, &count);
604 * for (i = 0; i < count; i++) {
605 * runtime_info_app_usage_get_appid(cpu_rate_handle, i, &appid);
606 * runtime_info_app_usage_get_usage(cpu_rate_handle, i, &rate);
607 * printf("appid = %s, rate = %u %%\n", appid, rate);
611 * runtime_info_app_usage_destroy(cpu_rate_handle);
616 int runtime_info_get_all_apps_cpu_rate(app_usage_h *rate);
627 #endif /** __TIZEN_SYSTEM_RUNTIME_INFO_H__ */