2
modprobe perfmon_intel_core (perfmon_intel_atom, perfmon_amd64, ...)
5
pfmon -l Listing available events
6
pfmon -L Events + unit masks
7
pfmon -i UNHALTED_CORE_CYCLES Event information
8
pfmon -I Hardware information
11
pfmon -- <application>
12
pfmon -e UNHALTED_CORE_CYCLES,BR_RET_MISSP_EXEC -- <app> [multiple]
13
pfmon -e SIMD_COMP_INST_RETIRED:PACKED_SINGLE [mask]
15
pfmon -priv-level=u - monitors events in user level only (default)
16
pfmon -priv-level=k - monitors events in kernel level only
17
pfmon -priv-level=uk - both levels
18
pfmon -priv-level=uk,u - first event 'uk' and second event only 'u'
20
pfmon --attach-task=22731 - attaching to the running task
21
pfmon -t 5 --attach... - attach for 5 seconds
23
pfmon --system-wide - system wide monitoring
24
pfmon --verbose - verbose mode
25
pfmon --no-cmd-out - suppreseing application output
28
* By default only a single thread is monitored, to enable monitoring of
29
forked childs and pthreads use "--follow-all" or just some of the:
30
--follow-fork --follow-vfork --follow-exec --follow-pthread
31
the information on thread is displayed in the form
32
(pid, tid, ppid) - process, thread, parent
35
* Starting and stopping at specific address
37
--trigger-code-start=0x4000000000000450 \
38
--trigger-code-stop=0x4000000000000450
40
* If you need to start on some sysmbol, the following command will return
42
nm <app> | fgrep "T symbol_name"
43
However, pfmon accepts as well symbols in place of addresses
44
pfmon --trigger-code-stop=main
46
* Monitoring just a single function: the code start and stop trigger should
47
be identical, then pfmon interprets the options as a request to monitor
48
when execution comes into a function until it leaves it
49
pfmon --trigger-code-start=main pfmon --trigger-code-stop=main
51
* Starting and stopping at access to specific addrss
53
--trigger-data-start=addr1,symb1,addr2 \
54
--trigger-data-stop=addr3,symb3
56
* By default start and stop triggers are "executed" only once, to instruct
57
pfmon to do continious monitoring specify:
58
--trigger-code-repeat --trigger-data-follow options
60
* Pfmon cannot extract symbol information coming from dynamically linked
61
libraries or modules. The addresses should be specified in that case.
62
The '--attach-task' can be used to connect to thread when dll's already
65
- Profiling (sampling)
66
pfmon --resolve-addresses --long-smpl-periods=1000000,20000 -e<ev1>,<ev2> -- app
68
Representation --smpl-module=<mode>
69
* List: compact, inst-hist, detailed, compact, raw, pebs
70
* List of supported modules returned by: pfmon -I
71
* Information on module: pfmon -S compact
72
* Limit output: --smpl-show-top=5, --smpl-cum-thresh=96
75
pfmon --with-header --outfile=b
b'\\ No newline at end of file'