#include <hawktracer/base_types.h>
#include <hawktracer/ht_config.h>
Go to the source code of this file.
|
typedef typedefHT_DECLS_BEGIN struct _HT_CPUUsageContext | HT_CPUUsageContext |
| A forward declaration for CPU Usage context. More...
|
|
◆ HT_CPUUsageContext
A forward declaration for CPU Usage context.
This structure should be defined in the implementation file.
◆ ht_cpu_usage_context_create()
Creates a context for a CPU usage feature.
This context is used for getting percentage CPU usage, and the structure is platform specific. The context should always be destroyed using ht_cpu_usage_context_destroy().
- Parameters
-
process_id | a platform specific description of process ID, or NULL to get CPU usage of the current process. For linux-based platforms, it should be a pointer to a variable of type integer (int), which holds the process ID. |
- Returns
- the CPU Usage context.
◆ ht_cpu_usage_context_destroy()
Destroys CPU Usage context.
- Parameters
-
context | a pointer to the context. |
◆ ht_cpu_usage_get_percentage()
Gets a CPU usage percentage for a process.
The process ID should be specified in ht_cpu_usage_context_create().
- Parameters
-
context | a CPU Usage context. |
- Returns
- a CPU usage percentage of a specified process, or negative value on error.