automotive-dlt
|
#include "dlt-kpi.h"
#include <signal.h>
#include <dirent.h>
#include <time.h>
#include <unistd.h>
#include <pthread.h>
Go to the source code of this file.
Functions | |
DLT_DECLARE_CONTEXT (kpi_ctx) | |
void | dlt_kpi_stop_loops (int sig) |
void | dlt_kpi_init_sigterm_handler () |
DltReturnValue | dlt_kpi_init_process_lists () |
DltReturnValue | dlt_kpi_free_process_lists () |
void * | dlt_kpi_start_process_thread () |
DltReturnValue | dlt_kpi_process_loop () |
DltReturnValue | dlt_kpi_update_process_list (DltKpiProcessList *list, unsigned long int time_dif_ms) |
void * | dlt_kpi_start_irq_thread () |
DltReturnValue | dlt_kpi_irq_loop () |
void * | dlt_kpi_start_check_thread () |
DltReturnValue | dlt_kpi_check_loop () |
DltReturnValue | dlt_kpi_log_check_commandlines () |
unsigned long int | timespec_to_millis (struct timespec *time) |
unsigned long int | get_millis () |
int | main (int argc, char **argv) |
DltReturnValue | dlt_kpi_log_list (DltKpiProcessList *list, DltReturnValue(*process_callback)(DltKpiProcess *, char *, int), char *title, int delete_elements) |
Variables | |
DltKpiConfig | config |
static volatile sig_atomic_t | stop_loop = 0 |
static DltKpiProcessList * | list |
static DltKpiProcessList * | new_process_list |
static DltKpiProcessList * | stopped_process_list |
static DltKpiProcessList * | update_process_list |
static struct timespec | _tmp_time |
static pthread_mutex_t | process_list_mutex |
Definition in file dlt-kpi.c.
DLT_DECLARE_CONTEXT | ( | kpi_ctx | ) |
DltReturnValue dlt_kpi_check_loop | ( | ) |
Definition at line 468 of file dlt-kpi.c.
References DltKpiConfig::check_log_interval, dlt_kpi_log_check_commandlines(), DLT_RETURN_OK, get_millis(), and stop_loop.
Referenced by dlt_kpi_start_check_thread().
DltReturnValue dlt_kpi_free_process_lists | ( | ) |
Definition at line 160 of file dlt-kpi.c.
References dlt_kpi_free_process_list(), DLT_RETURN_ERROR, and DLT_RETURN_OK.
Referenced by main().
DltReturnValue dlt_kpi_init_process_lists | ( | ) |
Definition at line 150 of file dlt-kpi.c.
References dlt_kpi_create_process_list(), DLT_RETURN_ERROR, DLT_RETURN_OK, and NULL.
Referenced by main().
void dlt_kpi_init_sigterm_handler | ( | ) |
Definition at line 131 of file dlt-kpi.c.
References dlt_kpi_stop_loops(), and NULL.
Referenced by main().
DltReturnValue dlt_kpi_irq_loop | ( | ) |
Definition at line 433 of file dlt-kpi.c.
References dlt_kpi_log_interrupts(), DLT_RETURN_OK, get_millis(), DltKpiConfig::irq_log_interval, DltKpiConfig::log_level, and stop_loop.
Referenced by dlt_kpi_start_irq_thread().
DltReturnValue dlt_kpi_log_check_commandlines | ( | ) |
Definition at line 495 of file dlt-kpi.c.
References dlt_kpi_get_msg_process_commandline(), dlt_kpi_log_list(), DLT_RETURN_ERROR, and process_list_mutex.
Referenced by dlt_kpi_check_loop().
DltReturnValue dlt_kpi_log_list | ( | DltKpiProcessList * | list, |
DltReturnValue(*)(DltKpiProcess *, char *, int) | process_callback, | ||
char * | title, | ||
int | delete_elements | ||
) |
Definition at line 214 of file dlt-kpi.c.
References buffer, BUFFER_SIZE, DltKpiProcessList::cursor, data, dlt_kpi_remove_process_at_cursor(), dlt_kpi_reset_cursor(), DLT_LOG, DLT_RETURN_OK, DLT_RETURN_WRONG_PARAMETER, DLT_STRING, dlt_user_log_write_finish(), dlt_user_log_write_start(), dlt_user_log_write_string(), DltKpiConfig::log_level, DltKpiProcess::next, and NULL.
Referenced by dlt_kpi_log_check_commandlines(), and dlt_kpi_update_process_list().
DltReturnValue dlt_kpi_process_loop | ( | ) |
Definition at line 187 of file dlt-kpi.c.
References dlt_kpi_update_process_list(), DLT_RETURN_OK, get_millis(), DltKpiConfig::process_log_interval, and stop_loop.
Referenced by dlt_kpi_start_process_thread().
void * dlt_kpi_start_check_thread | ( | ) |
Definition at line 460 of file dlt-kpi.c.
References dlt_kpi_check_loop(), dlt_kpi_stop_loops(), DLT_RETURN_OK, and NULL.
Referenced by main().
void * dlt_kpi_start_irq_thread | ( | ) |
Definition at line 425 of file dlt-kpi.c.
References dlt_kpi_irq_loop(), dlt_kpi_stop_loops(), DLT_RETURN_OK, and NULL.
Referenced by main().
void * dlt_kpi_start_process_thread | ( | ) |
Definition at line 179 of file dlt-kpi.c.
References dlt_kpi_process_loop(), dlt_kpi_stop_loops(), DLT_RETURN_OK, and NULL.
Referenced by main().
void dlt_kpi_stop_loops | ( | int | sig | ) |
Definition at line 140 of file dlt-kpi.c.
References stop_loop.
Referenced by dlt_kpi_init_sigterm_handler(), dlt_kpi_start_check_thread(), dlt_kpi_start_irq_thread(), and dlt_kpi_start_process_thread().
DltReturnValue dlt_kpi_update_process_list | ( | DltKpiProcessList * | list, |
unsigned long int | time_dif_ms | ||
) |
Definition at line 297 of file dlt-kpi.c.
References DltKpiProcess::cpu_time, DltKpiProcessList::cursor, dlt_kpi_add_process_after_cursor(), dlt_kpi_add_process_before_cursor(), dlt_kpi_clone_process(), dlt_kpi_create_process(), dlt_kpi_get_msg_process_new(), dlt_kpi_get_msg_process_stop(), dlt_kpi_get_msg_process_update(), dlt_kpi_increment_cursor(), dlt_kpi_log_list(), dlt_kpi_remove_process_at_cursor(), dlt_kpi_reset_cursor(), dlt_kpi_update_process(), dlt_log(), DLT_RETURN_ERROR, DLT_RETURN_OK, DLT_RETURN_WRONG_PARAMETER, NULL, DltKpiProcess::pid, and process_list_mutex.
Referenced by dlt_kpi_process_loop().
unsigned long int get_millis | ( | ) |
Definition at line 62 of file dlt-kpi.c.
References _tmp_time, and timespec_to_millis().
Referenced by dlt_kpi_check_loop(), dlt_kpi_irq_loop(), and dlt_kpi_process_loop().
int main | ( | int | argc, |
char ** | argv | ||
) |
Definition at line 68 of file dlt-kpi.c.
References dlt_kpi_free_process_lists(), dlt_kpi_init(), dlt_kpi_init_process_lists(), dlt_kpi_init_sigterm_handler(), dlt_kpi_start_check_thread(), dlt_kpi_start_irq_thread(), dlt_kpi_start_process_thread(), DLT_REGISTER_APP, DLT_REGISTER_CONTEXT_LL_TS, DLT_RETURN_OK, DLT_UNREGISTER_APP, DLT_UNREGISTER_CONTEXT, DltKpiConfig::log_level, NULL, and process_list_mutex.
unsigned long int timespec_to_millis | ( | struct timespec * | time | ) |
Definition at line 57 of file dlt-kpi.c.
Referenced by get_millis().
|
static |
Definition at line 41 of file dlt-kpi.c.
Referenced by get_millis().
DltKpiConfig config |
Definition at line 37 of file dlt-kpi.c.
Referenced by dlt_daemon_logstorage_get_loglevel(), DLT_DECLARE_CONTEXT(), dlt_logstorage_filter(), dlt_logstorage_get_config(), dlt_logstorage_get_loglevel_by_key(), dlt_logstorage_store_filters(), dlt_logstorage_write(), and main().
|
static |
|
static |
|
static |
Definition at line 42 of file dlt-kpi.c.
Referenced by dlt_kpi_log_check_commandlines(), dlt_kpi_update_process_list(), and main().
|
static |
Definition at line 39 of file dlt-kpi.c.
Referenced by dlt_kpi_check_loop(), dlt_kpi_irq_loop(), dlt_kpi_process_loop(), and dlt_kpi_stop_loops().
|
static |
|
static |