Add dynamic calls as cli arguments#108
Open
paulwuertz wants to merge 2 commits intoHBehrens:masterfrom
Open
Conversation
97ae62a to
43914be
Compare
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.
Enables the user to add dynamic calls like callbacks to the call graph.
Closes #105.
Add the funcion call from func_a calling func_1 by
--add-dynamic-calls 'func_a->func_1'.An example the cannectivity firmware based on zephyr.
It has a driver abstraction calling the chip-specific driver layer, which then calls a user given callback function. In the images below user_callback and driver_implementation have both no callers(1), as they are inserted as function pointers to some structs at runtime. The os_interface function has 3 callees. The worst case max stack recognized for the gs_usb_tx_thread is 712 bytes where the call tree goes up to the os_interface
z_impl_can_sendand the callback worst case stack usage is 488 bytes(2).When adding the 3 dynamic calls os_interface->driver_implementation->user_callback as arguments:
Then we get user_callback and driver_implementation having one caller (3) getting called from z_impl_can_send (4) and all are in the same worst stack path with now using up to 856 bytes.
With the open PR #106 for the conig file it looks like this: