Skip to content

Commit e26cd12

Browse files
authored
Merge pull request #2601 from katarzyna-z/kk-libpfm4-config
Add information about configuring perf events using libpfm4
2 parents c4f167a + 0c017c2 commit e26cd12

File tree

1 file changed

+70
-0
lines changed

1 file changed

+70
-0
lines changed

docs/runtime_options.md

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,76 @@ Let's explain this by example:
259259

260260
- `uncore_imc_1/cas_count_all` - because of entry in custom events with type field, event would be counted by PMU with **19** type and provided config.
261261

262+
#### Configuring perf events by name
263+
264+
It is possible to configure perf events by names using events supported in [libpfm4](http://perfmon2.sourceforge.net/), for detailed information please see [libpfm4 documentation](http://perfmon2.sourceforge.net/docs_v4.html).
265+
266+
Discovery of perf events supported on platform can be made using python script - [pmu.py](https://sourceforge.net/p/perfmon2/libpfm4/ci/master/tree/python/src/pmu.py) provided with libpfm4, please see [script reqirements](https://sourceforge.net/p/perfmon2/libpfm4/ci/master/tree/python/README).
267+
268+
##### Example configuration of perf events using event names supported in libpfm4
269+
270+
Example output of `pmu.py`:
271+
```
272+
$ python pmu.py
273+
INSTRUCTIONS 1
274+
u 0
275+
k 1
276+
period 3
277+
freq 4
278+
precise 5
279+
excl 6
280+
mg 7
281+
mh 8
282+
cpu 9
283+
pinned 10
284+
INSTRUCTION_RETIRED 192
285+
e 2
286+
i 3
287+
c 4
288+
t 5
289+
intx 7
290+
intxcp 8
291+
u 0
292+
k 1
293+
period 3
294+
freq 4
295+
excl 6
296+
mg 7
297+
mh 8
298+
cpu 9
299+
pinned 10
300+
UNC_M_CAS_COUNT 4
301+
RD 3
302+
WR 12
303+
e 0
304+
i 1
305+
t 2
306+
period 3
307+
freq 4
308+
excl 6
309+
cpu 9
310+
pinned 10
311+
```
312+
and perf events configuration for listed events:
313+
```json
314+
{
315+
"core": {
316+
"events": [
317+
["INSTRUCTIONS"],
318+
["INSTRUCTION_RETIRED"]
319+
]
320+
},
321+
"uncore": {
322+
"events": [
323+
["uncore_imc/UNC_M_CAS_COUNT:RD"],
324+
["uncore_imc/UNC_M_CAS_COUNT:WR"]
325+
]
326+
}
327+
}
328+
```
329+
330+
Notice: PMU_PREFIX is provided in the same way as for configuration with config values.
331+
262332
### Further reading
263333

264334
* [perf Examples](http://www.brendangregg.com/perf.html) on Brendan Gregg's blog

0 commit comments

Comments
 (0)