Skip to content

Commit

Permalink
Small comment
Browse files Browse the repository at this point in the history
  • Loading branch information
adriansr committed Dec 2, 2020
1 parent 4157730 commit 989725f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
7 changes: 6 additions & 1 deletion x-pack/auditbeat/tracing/cpu.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,12 @@ const (
// PresentCPUsPath is the path to the system file listing the CPUs that are identified as present.
PresentCPUsPath = "/sys/devices/system/cpu/present"

// See `Documentation/admin-guide/cputopology.rst` in the Linux kernel docs for more information.
// See `Documentation/admin-guide/cputopology.rst` in the Linux kernel docs for more information
// on the above files.

// IsolatedCPUsPath is only present when CPU isolation is active, for example using the `isolcpus`
// kernel argument.
IsolatedCPUsPath = "/sys/devices/system/cpu/isolated"
)

// CPUSet represents a group of CPUs.
Expand Down
6 changes: 6 additions & 0 deletions x-pack/auditbeat/tracing/perfevent.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,12 @@ func NewPerfChannel(cfg ...PerfChannelConf) (channel *PerfChannel, err error) {
channel.attr.SetSamplePeriod(1)
channel.attr.SetWakeupEvents(1)

// Load the list of online CPUs from /sys/devices/system/cpu/online.
// This is necessary in order to to install each kprobe on all online CPUs.
//
// Note:
// There's currently no mechanism to adapt to CPUs being added or removed
// at runtime (CPU hotplug).
channel.cpus, err = NewCPUSetFromFile(OnlineCPUsPath)
if err != nil {
return nil, errors.Wrap(err, "error listing online CPUs")
Expand Down

0 comments on commit 989725f

Please sign in to comment.