Skip to content

Commit 414043d

Browse files
authored
Merge pull request #2527 from katarzyna-z/kk-fix-perf-documentation
Add documentation for building and running cAdvisor with perf support
2 parents a470ec1 + ba7b51b commit 414043d

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

docs/development/build.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,42 @@ To enable `libimpctl` support `GO_FLAGS` variable must be set:
4444
$GOPATH/src/github.com/google/cadvisor $ GO_FLAGS="-tags=libipmctl,netgo" make build
4545
```
4646

47+
### Perf Support
48+
49+
cAdvisor can be linked against [libpfm4](http://perfmon2.sourceforge.net/) library that allows to gather information about performance monitoring events.
50+
If you want to build cAdvisor with libpfm4 support you must meet following requirements:
51+
* `libpfm4-dev` must be installed on build system.
52+
* `libpfm4` must be installed on all systems where cAdvisor is running.
53+
54+
libpfm4 packages are available in Debian- and RHEL-derivatives distributions.
55+
56+
libpfm4 can be installed using apt package manager:
57+
```
58+
apt-get install libpfm4 libpfm4-dev
59+
```
60+
or yum package manager:
61+
```
62+
yum install libpfm libpfm-devel
63+
```
64+
65+
To enable `libpfm4` support `GO_FLAGS` variable must be set:
66+
67+
```
68+
$GOPATH/src/github.com/google/cadvisor $ GO_FLAGS="-tags=libpfm,netgo" make build
69+
```
70+
4771
## Running Built Binary
4872

4973
Now you can run the built binary:
5074

5175
```
5276
$GOPATH/src/github.com/google/cadvisor $ sudo ./cadvisor
5377
```
78+
79+
### Perf Support
80+
81+
It is required to include perf config (examplary config is available [here](../../perf/testing/perf-non-hardware.json)) to run cAdvisor with performance monitoring events:
82+
```
83+
$GOPATH/src/github.com/google/cadvisor $ sudo ./cadvisor -perf_events_config=perf/testing/perf-non-hardware.json
84+
85+
```

0 commit comments

Comments
 (0)