Delete the oldest entry when ringbuffer is full#579
Delete the oldest entry when ringbuffer is full#579jianjun-huang wants to merge 1 commit intoCOVESA:masterfrom
Conversation
|
Hello @jianjun-huang , Could you make this feature configurable via enviroment_variables (like the ringbuffer size already is)? The default behavior should be to keep the oldest logs. This enables to debug startup issues for example. |
|
Hello @jianjun-huang |
|
Hi @minminlittleshrimp Just like the discussion in #533, the same ringbuffer implementation is used in dlt-daemon and libdlt. It is easier to add a new configuration parameter in the dlt.conf to change the behavior on dlt-daemon site. But there is no good solution on the application side(libdlt). Environment variable is a potential application wide but not a system wide solution. The user may observe different ringbuffer behaviors among the applications and dlt-daemon. Also, in the AUTOSAR_SWS_LogAndTrace_R22_11.pdf, it mentions: It seems that we should always remove the oldest entries when ringbuffer is full. What are your thoughts on these questions? |
|
Hello @jianjun-huang |
|
1 more point: "Environment variable is a potential application wide but not a system wide solution. The user may observe different ringbuffer behaviors among the applications and dlt-daemon." I would say, libdlt ring buffer will be used by all users, and there already locking mechanism for the data safe, so I do not think that setting an environment variable will lead to different behavior. For instance,by export DLT_USER_RINGBUFFER_MAX=val |
add ringbuffer full strategy to control whether remove the oldest log entry or discard new message on dlt-daemon side in dlt.conf when RingbufferFullStrategy = 0: discard the new message when RingbufferFullStrategy = 1: remove the oldest entry in the ringbuffer on application side export DLT_USER_BUFFER_FULL_STRATEGY=0 to discard new message export DLT_USER_BUFFER_FULL_STRATEGY=1 to remove the oldest entry in the ringbuffer
5fa890a to
d98c70e
Compare
|
Sorry @jianjun-huang |
|
This feature is cool and I dont want to drop it, but it here for so long and need rework. |
The change will delete the oldest entries in the ringbuffer when the ringbuffer is full