Debian Codegraph @

src/log.h

raw symbols SCIP
1 /* SPDX-License-Identifier: BSD-2-Clause */cxx . . $ `<file>/src/log.h`/
2 /*
3 * Copyright (C) 2020-2024 Linutronix GmbH
4 * Author Kurt Kanzenbach <[email protected]>
5 */
6
7 #ifndef _LOG_H_
8 #define _LOG_H_cxx . . $ `src/log.h:8:9`!
9
10 #include <pthread.h>
11 #include <stdio.h>
12 #include <stdlib.h>
13
14 #include "ring_buffer.h"cxx . . $ `<file>/src/ring_buffer.h`/
15
16 /* 1 MiB per traffic class */
17 #define LOG_BUFFER_SIZEcxx . . $ `src/log.h:17:9`! (8 * 1024 * 1024)
18
19 enum log_levelcxx . . $ log_level# {
20 LOG_LEVEL_ERRORcxx . . $ LOG_LEVEL_ERROR. = 1,
21 LOG_LEVEL_WARNINGcxx . . $ LOG_LEVEL_WARNING.,
22 LOG_LEVEL_INFOcxx . . $ LOG_LEVEL_INFO.,
23 LOG_LEVEL_DEBUGcxx . . $ LOG_LEVEL_DEBUG.
24 };
25
26 struct log_thread_contextcxx . . $ log_thread_context# {
27 pthread_tcxx . . $ pthread_t# log_task_idcxx . . $ log_thread_context#log_task_id.;
28 struct ring_buffercxx . . $ ring_buffer# *log_ring_buffercxx . . $ log_thread_context#log_ring_buffer.;
29 unsigned char *log_datacxx . . $ log_thread_context#log_data.;
30 volatile int stopcxx . . $ log_thread_context#stop.;
31 FILEcxx . . $ FILE# *file_handlecxx . . $ log_thread_context#file_handle.;
32 };
33
34 struct log_thread_contextcxx . . $ log_thread_context# *log_thread_createcxx . . $ log_thread_create(3ed95045a9d7f639).(void);
35 void log_thread_stopcxx . . $ log_thread_stop(5f50a2fc789db767).(struct log_thread_contextcxx . . $ log_thread_context# *thread_context);
36 void log_thread_freecxx . . $ log_thread_free(5f50a2fc789db767).(struct log_thread_contextcxx . . $ log_thread_context# *thread_context);
37 void log_thread_wait_for_finishcxx . . $ log_thread_wait_for_finish(5f50a2fc789db767).(struct log_thread_contextcxx . . $ log_thread_context# *thread_context);
38
39 int log_initcxx . . $ log_init(b126dc7c1de90089).(void);
40 void log_messagecxx . . $ log_message(171546b8a219727a).(enum log_levelcxx . . $ log_level# level, const char *format, ...)
41 __attribute__((__format__(printf, 2, 3)));
42 void log_freecxx . . $ log_free(49f6e7a06ebc5aa8).(void);
43
44 #endif /* _LOG_H_ */