Skip to content
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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mkaranki
Copy link

  • 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.

@mkaranki mkaranki force-pushed the lz4-kconfig-to-disable-heap branch 2 times, most recently from 53fc264 to f2f6d42 Compare September 18, 2024 15:50
@mkaranki mkaranki marked this pull request as ready for review September 18, 2024 20:49
@parthitce
Copy link
Member

@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)

  • @nashif to share the feedback for lz4.

Otherwise, am in travel after OSS, will review it during next week and write back.

@mkaranki
Copy link
Author

mkaranki commented Sep 21, 2024

@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)

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.

@nixward
Copy link
Member

nixward commented Sep 22, 2024

old log files would get compressed

Nice idea 👍

Copy link
Member

@parthitce parthitce left a 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.

)

zephyr_library_compile_definitions_ifdef(CONFIG_LZ4F_HEAPMODE_STACK
LZ4F_HEAPMODE=0
Copy link
Member

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?

Copy link
Author

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
Copy link
Member

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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants