diff options
Diffstat (limited to 'src/process.h')
-rw-r--r-- | src/process.h | 33 |
1 files changed, 28 insertions, 5 deletions
diff --git a/src/process.h b/src/process.h index 7d13938..12344ee 100644 --- a/src/process.h +++ b/src/process.h @@ -17,10 +17,6 @@ #ifndef __PROCESS_H #define __PROCESS_H -#include <stdbool.h> - -#include "stats.h" - /** * @brief The process structure. * @@ -35,9 +31,16 @@ struct process unsigned long long total_ticks_used; unsigned long long frame_ticks_used; int memory_used; + float update_time; + float frame_time_inverted; }; /** + * @brief Initialize process module. + */ +int process_init(); + +/** * @brief Gets last read process memory usage * * @param[in]: proc process @@ -74,7 +77,7 @@ int process_update(struct process *proc); * * @return 0 on success, other value on error. */ -void process_init(int pid, struct process *proc); +void process_init_process(int pid, struct process *proc); /** * @brief Shutdown process structure @@ -122,4 +125,24 @@ const char *process_get_exe(struct process *proc); */ void process_move(struct process *dst, struct process *src); +/** + * @brief Gets average CPU usage percentage since last update. + * + * @param[in]: proc process + * @param[out]: usage the cpu usage percentage + * + * @return 0 on success, other value on error. + */ +int process_get_cpu_usage_percentage(struct process *proc, float *usage); + +/** + * @brief Gets average memory usage percentage on last update. + * + * @param[in]: proc process + * @param[out]: usage the memory usage percentage + * + * @return 0 on success, other value on error. + */ +int process_get_memory_usage_percentage(struct process *dst, float *usage); + #endif |