Skip to content

tetragon: Use lru.Cache for data events storage #382

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

Merged
merged 2 commits into from
Feb 2, 2023

Conversation

olsajiri
Copy link
Contributor

@olsajiri olsajiri commented Sep 4, 2022

There's a chance that by losing events (in perf ring buffer)
we would never use data stored by data events. Adding the data
into lru cache so we eventually remove unused entries to make
space for new ones and don't grow endlessly.

Signed-off-by: Jiri Olsa [email protected]

@olsajiri olsajiri force-pushed the data_events_fix branch 4 times, most recently from 38bd06d to b549f4b Compare September 8, 2022 13:59
@olsajiri olsajiri force-pushed the data_events_fix branch 4 times, most recently from c37b2a6 to fa44c1c Compare December 27, 2022 14:34
@olsajiri olsajiri marked this pull request as ready for review December 27, 2022 15:34
@olsajiri olsajiri requested a review from a team as a code owner December 27, 2022 15:34
@olsajiri olsajiri requested a review from tixxdz December 27, 2022 15:34
Copy link
Contributor

@kkourt kkourt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool! Thanks!

@jrfastab jrfastab self-requested a review January 6, 2023 02:49
@olsajiri olsajiri force-pushed the data_events_fix branch 5 times, most recently from 38a877b to 5b28739 Compare January 10, 2023 13:50
@kkourt
Copy link
Contributor

kkourt commented Jan 18, 2023

@olsajiri maybe it's worth rebasing this one?

@olsajiri olsajiri force-pushed the data_events_fix branch 4 times, most recently from 8fbc14d to 83d8fd5 Compare January 24, 2023 15:22
Moving data object to observer. It helps following change
not to create golang dependency cycles when initializing
data cache.

Signed-off-by: Jiri Olsa <[email protected]>
There's a chance that by losing events (in perf ring buffer)
we would never use data stored by data events. Adding the data
into lru cache so we eventually remove unused entries to make
space for new ones and don't grow endlessly.

Signed-off-by: Jiri Olsa <[email protected]>
Copy link
Member

@tixxdz tixxdz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @olsajiri ! Minor suggestion: later we can print the stats of the cache and suggest to user to increase in case it is full

@tixxdz tixxdz merged commit 04e3bc3 into cilium:main Feb 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants