](images/DebugButton.png)
* Next you will need to run the application to collect the data and transfer it to the host workstation. If you added a call to **__llvm_profile_write_file()** to your application then it is suggested to set a breakpoint on the line immediately after it. Then run. Once the breakpoint has been hit the data should have been captured and transferred. Click the **Resume** button.
[
](images/RunButton.png)
[[b Note:
If you added a call to **__llvm_profile_write_file()** to your application then it is suggested to set a breakpoint on the line immediately after it. Then run. Once the breakpoint has been it the data should have been captured and transferred.
]]
* Terminate your debug session by clicking on the **Terminate** button.
[
](images/TerminateButton.png)
* A file called **default.profraw** should be present in the build configuration folder of your project. In this case it would be in the **\Collect** folder.

###Analyzing the data
Now there are a couple of utilities that need to be run to prepare the code coverage data. We are going to leverage the Analyze configuration that we created earlier to do this.
Go to your project properties.
Ensure that the **Analyze** configuration is selected in the drop down at the top.

We need to now execute the **profdata** utility. This will process the raw data file (default.profraw) into a .profdata file.
We are going to add a pre-build step to do this.
* Select **Build** in the tree on the left.
* Next select the **Steps** tab in the middle of the dialog.
* We are now going to invoke the profdata utility. We pass it the program file, name of the file to output and the raw data file. We are going to make use of build variables to make this more robust. If you named your **Collect** configuration something else you will have to adjust the commands below.
```
"${CG_TOOL_ROOT}/bin/tiarmprofdata" merge -sparse -obj-file="${CCS_PROJECT_DIR}/Collect/${BuildArtifactFileName}" "${CCS_PROJECT_DIR}/Collect/default.profraw" -o "${ProjName}.profdata"
```

Now we need to process the .profdata file and generated an html file that can be viewed. This can be done by adding a post build step.
* Add the following post build step.
```
"${CG_TOOL_ROOT}/bin/tiarmcov" show --format=html --show-expansions --show-instantiations --show-branches=count --object="${CCS_PROJECT_DIR}/Collect/${BuildArtifactFileName}" -instr-profile="${CCS_PROJECT_DIR}/Analyze/${ProjName}.profdata" --output-dir="${CCS_PROJECT_DIR}/Analyze"
```
* Now build the Analyze configuration by going to the down arrow beside the build button and selecting **Analyze**.

In the Analyze folder there will now be an **index.html** file that has coverage information.

* Double-click on this file to open it inside Code Composer Studio.

[[b Note:
The pre and post build steps will only run if the source code has changed. Thus you may need to run **clean project** for the **analyze** configuration prior to building to ensure that the report is generated. Alternatively it is possible to setup a batch file to run these steps that could be executed from the command line and not rely on building the **Analyze** configuration.
]]