-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
modules: lz4: add configurability #78652
base: main
Are you sure you want to change the base?
modules: lz4: add configurability #78652
Conversation
53fc264
to
f2f6d42
Compare
@mkaranki Thanks for the PR. As with external modules which doesn't have dependencies within zephyr, it needs to moved out. For the same reason we did for FlashDB: #78225 (comment)
Otherwise, am in travel after OSS, will review it during next week and write back. |
Thanks for sharing this info. My vision for lz4 use was to try to use it with Zephyr's fs logging backend so that old log files would get compressed. As there's no general compression API or any kind of "inotify" type of API in Zephyr (yet?), short-cutting here so that fs backend would use lz4, either directly or via a user settable custom callback, to compress the old files. This PR is btw related by accident to #73262. |
Nice idea 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to compress the old files.
Log rotation with compression is nicer option.
modules/lz4/CMakeLists.txt
Outdated
) | ||
|
||
zephyr_library_compile_definitions_ifdef(CONFIG_LZ4F_HEAPMODE_STACK | ||
LZ4F_HEAPMODE=0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is the default. So we can ignore this configuration option all together?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. Configuring same defines that what the defaults are removed for all of these.
They were added there for clarity. This is more minimal now, but it is fuzzier what's the active lz4 config.
zephyr_library_compile_definitions_ifdef(CONFIG_LZ4HC_HEAPMODE_HEAP | ||
LZ4HC_HEAPMODE=1 | ||
) | ||
zephyr_library_compile_definitions_ifdef(CONFIG_LZ4HC_HEAPMODE_STACK |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
- Add possibility to disable functions that use heap. This is to reduce code size and prevent accidental use of heap. - Add possibility to compile xxhash library, "Extremely Fast Hash algorithm" in. It might be sometimes needed as a standalone, but especially lz4frame requires it. - Add possibility to compile also hc and lz4frame modules. The config options include possibility to configure will heap or stack be used. Defaults are set according to lz4's current defaults. Signed-off-by: Miika Karanki <[email protected]>
f2f6d42
to
0345f00
Compare
Add possibility to disable functions that use heap. This is to reduce code size and prevent accidental use of heap.
Add possibility to compile xxhash library, "Extremely Fast Hash algorithm" in. It might be sometimes needed as a standalone, but especially lz4frame requires it.
Add possibility to compile also hc and lz4frame modules. The config options include possibility to configure will heap or stack be used. Defaults are set according to lz4's current defaults.