Repository navigation
Expand file tree
/
Copy pathnote.txt
More file actions
96 lines (76 loc) · 1.92 KB
/
Copy pathnote.txt
File metadata and controls
96 lines (76 loc) · 1.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
notes
==========
new w thread
thread local data:
thread const data, (pid, thread name
per print:
tmp store, func, file, line, level
va_list(stack), format string, ts
category
perf conf data:
fifo buf
init
global config
new rules
format 2 layers:
1st defined in conf.[rule], convert to serial of func calls
2nd, %m userdata, per print
per thread
log
r lock // for global config
-> init set once thread local data.
* cache func,file...,level to a_thread.event
va_list(stack), format string,
-> need to save to fifo
out log
category for each rule
zlog_format_gen_msg(rule.format
for each format.pattern_specs // parsed conf rule
zlog_spec_gen_msg, zlog_spec_gen_msg_direct, zlog_spec_write*
save to buf
sig -> wthread
// buf -> shared file
if ver diff
rebuild msgbuf, event
unlock
check if reload global config
w thread:
iter threads
category
format log
buf -> file
check if reload config
category -> standalone, per print, shared by threads
rule * n // ref conf.rules
conf.formats
n * spec
pthread_cond
lock
set
signal
unlock
lock
check
wait,unlock
unlock
TODO
==================
todo:
conf reload -> done
remove thread msg buf for consumer enabled. -> done
test:
add per zlog_spec_write_* -> done
multi thread test -> done
add mdc test
reload cover all case test -> done
fd lead check -> done
doc to md -> done
test optimize
consumer fifo size config -> done
perf:
perf record -F 999 -g -- ./test_consumer_static_file_single
localtime_r/strftime per log call overhead.
asan:
LD_PRELOAD=/usr/lib/gcc/x86_64-linux-gnu/11/libasan.so ASAN_OPTIONS=detect_leaks=1 ./test_consumer_static_record
bug:
circle buf boundary -> done by double map