Skip to content

Add an option to output profiling/coverage info #184

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

Closed
wants to merge 2 commits into from

Conversation

mingodad
Copy link

@mingodad mingodad commented Jun 6, 2023

Add an option to output profiling/coverage info (basically function calls count and clock_t time spent).

There is an option to define how many samples to use with the definition of compile time macro "PROFILE_CALLS_SAMPLE" the default value is 10. The code is guarded by a compile time macro "CONFIG_PROFILE_CALLS", to build execute "make CONFIG_PROFILE_CALLS=1". When using the added option "-p" we can repeat it up to 3 times:

  • "-p" -> Only update calls count and omit functions with 0 calls
  • "-p -p" -> Update calls count and sampled time_spent and omit functions with 0 calls
  • "-p -p -p" -> Like the above but showing functions with 0 calls. The output format:
    =[ code_line call_count acumulated_time_spent average_time_spent function_name ] [454 2 1 6 xfillArr]

…alls count and clock_t time spent).

There is an option to define how many samples to use with the definition of compile time macro "PROFILE_CALLS_SAMPLE" the default value is 10.
The code is guarded by a compile time macro "CONFIG_PROFILE_CALLS", to build execute "make CONFIG_PROFILE_CALLS=1".
When using the added option "-p" we can repeat it up to 3 times:
- "-p" -> Only update calls count and omit functions with 0 calls
- "-p -p" -> Update calls count and sampled time_spent  and omit functions with 0 calls
- "-p -p -p" -> Like the above but showing functions with 0 calls.
The output format:
=[ code_line call_count acumulated_time_spent average_time_spent function_name ]
[454	2	1	6	xfillArr]
@paulocoghi
Copy link

Pull requests are not accepted. Use the mailing list to submit patches.

@mingodad
Copy link
Author

mingodad commented Oct 9, 2023

But I think that's a good idea to also post it here so other people can see it in an easy to use way.

@mingodad
Copy link
Author

This pull request #371 has better/complete implementation than this one.

@mingodad mingodad closed this Nov 24, 2024
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.

2 participants