Convert enabledCommands array to use command index and some other improvements#569
Merged
stefanberger merged 3 commits intomasterfrom Mar 9, 2026
Merged
Conversation
Base the enabledCommands array on the command index rather than the command code since the latter left the first few bytes always unused since command codes start at 0x11f only. After this change, ppList, auditCommands, and enabledCommandsByIdx bitmaps are all based on command indices. Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Use __builtin_popcount for counting the number of enabled commands in the enabledCommandsByIdx bitmap. Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Only write the necessary number of bytes of the ppList and auditCommands bitmaps. The entries in both of these bitmaps are set by a command's index and the necessary number of bytes can be determined by finding the command with the highest command code that is enabled in the current profile (1). This in turn can be found by by searching for the last byte in the enableCommandsByIdx bitmap that has any bit set. 1) It would be possible to skip writing these arrays entirely if they have no bits set. The unmarshalling functions would clear the arrays. Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.