You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
3. Run any binary with `mitosrun` like this to generate a folder of
51
+
mitos output data. For example:
52
+
53
+
```bash
54
+
$> mitosrun ./examples/matmul
48
55
```
49
56
50
57
The above command will run the matmul example and create a folder
51
58
called mitos_###, where ### is the number of seconds since the
52
59
epoch. The folder will contain:
53
60
54
-
```
61
+
```bash
55
62
mitos_###/
56
63
data/
57
64
samples.csv
@@ -67,18 +74,20 @@ Mitos requires:
67
74
68
75
`mitosrun` can also be fine-tuned with the following parameters:
69
76
70
-
```
77
+
```bash
71
78
[options]:
72
79
-b sample buffer size (default 4096)
73
80
-p sample period (default 4000)
74
81
-t sample latency threshold (default 10)
82
+
-s top folder of source code to copy
75
83
```
84
+
**See the section on `Source Code Attribution` below for more details on how to save the source code information with the samples collected while running your application.**
76
85
77
-
## IBS Configuration
78
-
1. Configure CMAKE with IBS depending on the chosen executable and configure environment variables if necessary:
86
+
## IBS (AMD) Configuration
87
+
The default installation of `mitos` will be configured for Intel based Precise Event Based Sampling (PEBS). Additionally, `mitos` supports AMD based Instruction Based Sampling (IBS). Configure CMAKE with IBS depending on the chosen executable and configure environment variables if necessary:
79
88
*`IBS_TYPE`
80
89
* Use IBS_FETCH or IBS_OP depending on the profiling use case (requires AMD processor with IBS support)
81
-
* IBS is not supported on Intel processors, therefore set variable to OFF
90
+
* IBS is not supported on Intel processors. By default, the variable is set to OFF.
82
91
*`IBS_SAMPLING_MODE`
83
92
* Mitosrun (with or without OpenMP): `IBS_ALL_ON` or `IBS_THREAD_MIGRATION`
84
93
* Mitoshooks with OpenMP:
@@ -90,19 +99,63 @@ Mitos requires:
90
99
* NOTE: `IBS_ALL_ON` might also work, but this sampling method is not recommended.
91
100
92
101
## Mitoshooks with OpenMP Usage
93
-
1. Requirements
94
-
* Compiler with OMPT support such as Clang (OpenMP feature since version 5.0)
95
-
2. CMake Configuration
96
-
* OpenMP found
97
-
*`MITOSHOOKS_OPEN_MP`: ON
98
-
3. Compilation
99
-
* Compilation of Mitoshooks library
100
-
* Compilation of OpenMP-application
101
-
4. Execution
102
-
* Configuration of environment variable `OMP_TOOL_LIBRARIES` that points to mitoshooks-library:
103
-
* e.g. for omp_example.cpp: OMP_TOOL_LIBRARIES=./../src/libmitoshooks.so
104
-
* Launch OpenMP-application
105
-
* ./omp_example
102
+
### 1. Requirements
103
+
104
+
Compiler with OMPT support such as Clang (OpenMP feature since version 5.0) is required. if clang is not the default compiler:
105
+
106
+
```bash
107
+
$>export CC=/path/to/clang*
108
+
$>export CXX=/path/to/clang++*
109
+
```
110
+
### 2. CMake Configuration
111
+
112
+
OpenMP (version 5.0 and later) must be installed. If OpenMP is not installed at the default loaction, make sure to specify the paths so that `cmake` finds it.
113
+
114
+
Enable `MITOSHOOKS_OPEN_MP` option by `-DMITOSHOOKS_OPEN_MP=ON`
115
+
116
+
### 3. Compilation
117
+
* Build and install `mitos` and `mitoshooks`
118
+
* Depending on the build method (cmake/make/command-line), link the application with `mitos` and `mitoshooks` by specifying their paths.
119
+
* See the section on `Source Code Attribution` below for more details on how to save the source code information with the samples collected while running your application.
120
+
121
+
### 4. Execution
122
+
123
+
Mitoshooks uses the OMPT interface to collect samples while each thread runs. Configure the environment variable `OMP_TOOL_LIBRARIES` that points to mitoshooks-library and use one of these methods to launch the OpenMP-application.
***The following method should also work but is not recommended. Exporting the variable `OMP_TOOL_LIBRARIES` for the global enviornment may break other OpenMP applications that do not intend to use hooks.***
*[Dyninst](http://www.dyninst.org) version 12.3.0 or higher.
150
+
* The application must be compiled in Debug mode (only `-g` compiler flag sufficient).
151
+
152
+
## Saving the virtual address
153
+
154
+
The source code of the executable must save the virtual addess offset when the executable starts runnnig. This can be done by including the [virtual_address_writer.h](src/virtual_address_writer.h) and calling the function [save_virtual_address_offset("virt_address.txt")](src/virtual_address_writer.h#L18).
155
+
156
+
See [matmul.cpp](examples/matmul.cpp) for reference.
157
+
158
+
This saves the virtual address offset to `/tmp/virt_address.txt`. Dyninst will access this file and attribute the source code information when the samples are saved.
0 commit comments