... | ... | @@ -21,4 +21,30 @@ It is composed by three different part |
|
|
|
|
|
Let's take a look of what they do, and how to use them.
|
|
|
|
|
|
### magicCut
|
|
|
Input:
|
|
|
- trace name
|
|
|
- number of time steps
|
|
|
|
|
|
Output:
|
|
|
- cut trace of the best time-step
|
|
|
- list of functions traced and the correspondent extraes ID ( sometimes it is useful to check that everything is ok)
|
|
|
|
|
|
First of all checks that there are functions in the trace
|
|
|
```bash
|
|
|
# grep through prv file if functions are there
|
|
|
func_check=`grep -m 1 60000019 ${pcf_trace_file} | wc -l`
|
|
|
```
|
|
|
Then it reads the .pcf file and creates a file (`FUNCTION_ID_NAMES.txt`) where the IDs that extrae uses are stored along with function's names.
|
|
|
|
|
|
Then, using grep, creates a file with all the lines trace lines relative to functions:
|
|
|
```bash
|
|
|
# Retrieve function's ID
|
|
|
echo "Retrieve function's ID"
|
|
|
grep ':60000019:' ${trace_file} | grep -v ':0:' | awk -F : '{print $2, $6, $8}' > ${CPU_T_ID}
|
|
|
```
|
|
|
1. `grep ':60000019:' ${trace_file}` select the function lines
|
|
|
2. ` grep -v ':0:' ` exclude the line relative to entering and exiting a function
|
|
|
3. `awk -F : '{print $2, $6, $8}'` select the columns relative to CPU number, time and function ID
|
|
|
|
|
|
[... to be continued] |