opencontainers / opencontainers/runc

Enabling perf_event support in runc

Open
#2,240 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Go
Stars
13.5k
Forks
2.3k
Avg merge
2d 8h
Merged PRs (30d)
30

Description

My team would like to contribute perf_event support for runc. We believe that taking limited amount of hardware counters available (e.g. 4 on Xeon 6240Y) a list of counters to be enabled should be passed to runc. It will allow users to fine-tune their counters and avoid multiplexing and scaling.

Therefore we suggest the following:

  • extending config.Cgroup struct by adding PerfEvents []uint64 field
  • extending cgroups.Stats struct by adding PerfStats map[uint64]PerfStat field
  • defining PerfStat struct similar to kernel read_format struct
  • using perf_event_open to start monitoring.
  • enabling event grouping when multiple events are passed in config.Cgroup and not enabling if single event is passed

Our goal is to expose metrics collected using perf subsystem in cAdvisor and use them for advanced scheduling in clusters. Currently we use our own agent but customers' requirement is to switch to cAdvisor.

Maintainers, does it sound reasonable to you?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Review the config.Cgroup and cgroups.Stats definitions, then study the kernel perf_event_open API and its read_format structure. Confirm the proposed API with maintainers before implementation; done means configurable perf events, grouped handling for multiple events, returned statistics, and a path for cAdvisor to consume them.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, linux
Domain
operating-systems
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.