-
Notifications
You must be signed in to change notification settings - Fork 297
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Delete the oldest entry when ringbuffer is full #579
base: master
Are you sure you want to change the base?
Delete the oldest entry when ringbuffer is full #579
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 |
The change will delete the oldest entries in the ringbuffer when the ringbuffer is full