-
Notifications
You must be signed in to change notification settings - Fork 71
Feature/memprof under benchmark #245
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
Merged
Merged
Changes from 3 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
30c004c
Grouping memory profiling and benchmarking under the same section.
FranFin f18c86d
Grouping memory profiling and benchmarking under the same section.
FranFin f60475f
Merge branch 'feature/memprof_under_benchmark' of github.com:micro-RO…
FranFin 0ed7e6f
Update _docs/concepts/benchmarking/benchmarking/index.md
amx-piap 32c07a2
Apply suggestions from code review
amx-piap 5ef7edc
Redirected old page of memory profiling to new page.
FranFin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,171 @@ | ||
| --- | ||
| title: Benchmarking | ||
| redirect_from: /benchmarking/ | ||
| permalink: /docs/concepts/benchmarking/benchmarking/ | ||
| --- | ||
|
|
||
| ## Table of contents | ||
|
|
||
| * [Introduction to Benchmarking](#introduction-to-benchmarking) | ||
| * [Our benchmarking tool framework](#our-benchmarking-tool-framework) | ||
| * [Trace Framework Abstraction](#trace-framework-abstraction) | ||
| * [Shadow Builder](#shadow-builder) | ||
| * [Binary generation for instrumented code](#binary-generation-for-instrumented-code) | ||
| * [Receiving inputs](#receiving-inputs) | ||
| * [Parse and Check](#parse-and-check) | ||
| * [TFA Execution](#tfa-execution) | ||
| * [Compilation](#compilation) | ||
| * [Step to start benchmarking](#step-to-start-benchmarking) | ||
|
|
||
|
|
||
|
|
||
| ## Introduction to Benchmarking | ||
|
|
||
| Developing working and stable application from the scribbles to the final | ||
| executing binary is long and hard tasks. During this process developers may come | ||
| across stabilities issues, perfomances issues. In addition to these issues, some | ||
| specified QoS might be difficult to quantify. Solving those problems without the | ||
| proper tools might be frustrating, tedious tasks leading to reduce developers | ||
| efficiency. An adapted benchmarking tool could overcome all those development | ||
| obstacles and increase development time. There are different KPI (Keep | ||
| Performance Indicators) that one might be interested into. In the framework of | ||
| this micro-ROS, the KPI can be freely chosen by the developer. In this way, the | ||
|
amx-piap marked this conversation as resolved.
Outdated
|
||
| benchmarking tool will remain flexible and allow the community to constantly add | ||
| some support for a lot of different KPI. | ||
|
amx-piap marked this conversation as resolved.
Outdated
|
||
|
|
||
| The problems we want to tackle are: | ||
|
|
||
| * Out there, many benchmarking tools exist. Each of targeting different KPIs. | ||
|
amx-piap marked this conversation as resolved.
Outdated
|
||
| * Different platforms (Linux/Nuttx/Baremetal et.c.). | ||
| * Too few time/resources to code benchmarking tool for each. | ||
| * Avoid code overhead: Keep code clarity. | ||
| * Avoid execution overhead: Do not want to make execution slower when benchmarking. | ||
|
|
||
| ## Our Benchmarking tool framework | ||
|
|
||
| The benchmarking tool under development is providing a framework to allow | ||
| developers to create their own benchmarking tool. Each part a developer wants to | ||
| benchmark can be added as a plugin using the provided framework. In this way | ||
| plugins can be shared and this improves re-usability as much as possible. | ||
|
|
||
|
|
||
| ## Trace Framework Abstraction | ||
|
|
||
| The Shadow builder alone only parse comments from the application and pass it | ||
| along to the Trace Framework Abstraction (TFA) Core. The TFA core is aware of | ||
| the plugins that are available, all the plugins’ capabilities and platform | ||
| target. The process goes as explained below: | ||
|
|
||
| * The line containing the functionality Benchmarking::XX::YY will be checked | ||
| against all the available plugins. | ||
| * Plugins that are capable of handling functionality will respond with a piece of | ||
| code that will be replaced with a piece of code. | ||
| * Then the output file will be added in a folder corresponding to the platform | ||
| type and benchmarking type. | ||
|
|
||
| Being generic is the key for this benchmarking tool. The plugins will in | ||
| contrary bring the specific implementation needed to benchmark a specific | ||
| platform. Every plugin will provide information as requested by the parser: | ||
|
|
||
| * Provide a list of supported platforms. | ||
| * Provide a list of functions that are handled. | ||
| * Provide snippets codes that will be added for benchmarking. | ||
|
amx-piap marked this conversation as resolved.
Outdated
|
||
| * Provide a list of patches and/or patch code | ||
| * Optional provide an end script to run and execute the benchmarks | ||
|
|
||
|
|
||
| ## Shadow Builder | ||
|
|
||
| This section will introduce some concept related to the shadow builder (SB). | ||
|
amx-piap marked this conversation as resolved.
Outdated
|
||
|
|
||
| The Shadow builder is a tool that will transparently instrument the code to | ||
| benchmark. The tools will be able to output an “instrumented code” that will be | ||
| later be compiled as a normal code. The following steps describe what the shadow | ||
| builder process flow: | ||
|
|
||
| * Get configuration file from the user (Benchmarking Configuration File). | ||
| * Get appropriate sources. | ||
| * Execute Trace Framework Abstraction Configuration file. | ||
| * Parse the sources file needed Injecting code. | ||
| * Compile the targeted binary for different platform. | ||
|
amx-piap marked this conversation as resolved.
Outdated
|
||
| * If needed, depending what type benchmark is undertaken, compile another | ||
| target binary benchmarking. | ||
|
|
||
| The SB (Shadow Builder) is meant to be as transparent as possible for the user. | ||
| And if the benchmarking is not activated, it should be bypassed. Get | ||
| appropriate sources | ||
|
amx-piap marked this conversation as resolved.
Outdated
|
||
|
|
||
| The SB is in charge of getting the path/git repository to the source code that | ||
| needs to be benchmarking. The benchmarking. The sources are specified by the | ||
| user in the benchmarking configuration file. Injecting code | ||
|
amx-piap marked this conversation as resolved.
Outdated
|
||
|
|
||
| In order to inject code, there are some tools that allow this. CLang AST tool | ||
| will allow to inject some code. | ||
|
|
||
|
|
||
| ## Binary generation for instrumented code | ||
|
|
||
| The binary generation is the process of compiling the source code. In order to | ||
| benchmark, previously to compile the source code, it is necessary to instrument | ||
| the code. The code will be instrumented in a transparent way for the | ||
| programmer/user. Therefore, a configuration file provided by the programmer will | ||
| be parsed and code injected as described in a configuration file. | ||
|
|
||
| ### Receiving inputs | ||
|
|
||
| The binary generation's pipeline receives two inputs to work with: | ||
| * Configuration Benchmarking file. | ||
| * Source code to benchmark. | ||
|
|
||
| In short, the configuration describes: | ||
|
|
||
| * What is benchmarked (sources). | ||
| * Where to benchmark. | ||
| * What type of benchmark. | ||
| * Optionally against what base line to compare (base line source) | ||
|
|
||
| ### Parse and Check | ||
|
|
||
| Once the input received the **Shadow Builder** parses the configuration | ||
| file. From the configuration file, the Shadow builder gets: | ||
|
|
||
| * The different benchmarking to be achieved. | ||
| * The targeted platforms. | ||
|
|
||
| In addition to parsing, the Shadow Builder is in charge of checking | ||
| capabilities and consistency within the configuration file and the different | ||
| TFA's plugins registered in the TFA module. | ||
|
|
||
| ### TFA Execution | ||
|
|
||
| Once parsed and checked against the TFA module capabilities, the Shadow | ||
| Builder will be in charge of translating configuration into source code. The | ||
| translated sources will also be achieved in cooperation with the TFA module. The | ||
| detailed steps of the TFA can be found here. At the end of this step, the TFA | ||
| will generate the new forged source code ready for compilation. In addition to | ||
| patched source code, the TFA will generate scripts that will the benchmarks. | ||
|
|
||
| ### Compilation | ||
|
|
||
| The compilation will happen for every kind of benchmarks and | ||
| platforms targeted. Depending on the kind of benchmark that is being executed, | ||
| there will be one or more binaries per benchmarks session. The number of binary | ||
| generated also depends on what plugins are provided by the user to the shadow | ||
| builder. The shadow builder will retrieve capabilities of the plugins and | ||
| request from the developer, match them and generated software according to the | ||
| matches. | ||
|
|
||
|
|
||
| ## Step to start benchmarking | ||
|
|
||
| The shadow Builder will be executed as follow: | ||
|
|
||
| * Software sources are passed to the Shadow Builder. | ||
| * The source are passed and upon comments containing /*Benchmarking::XX::YY*/ | ||
| (a tag) the code line is passed to the Trace Framework Abstraction module. | ||
| Using comments is preferable → No includes needed. | ||
| * All plugins that registered to the TFA the Benchmarking::XX::YY functionality | ||
| will return a piece of code that will be added to the source. | ||
| * Once all parsed, the shadow builder will compile for all the different | ||
| platforms requested either by plugins or by user configuration. | ||
|
|
||
File renamed without changes
3 changes: 2 additions & 1 deletion
3
_docs/concepts/memo_prof/index.md → .../concepts/benchmarking/memo_prof/index.md
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
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
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
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.
Uh oh!
There was an error while loading. Please reload this page.