Skip to content

dynolog: collect memory-management counters from /proc/vmstat - #600

Open
abhiShedge wants to merge 1 commit into
facebookincubator:mainfrom
abhiShedge:export-D116889620
Open

dynolog: collect memory-management counters from /proc/vmstat#600
abhiShedge wants to merge 1 commit into
facebookincubator:mainfrom
abhiShedge:export-D116889620

Conversation

@abhiShedge

Copy link
Copy Markdown
Contributor

Summary:
Adds VmStatCollector (fbcode/dynolog/src/VmStatCollector.{h,cpp}), a small
open-source collector that parses a selected set of /proc/vmstat fields. It
mirrors the existing KvmStatsCollector structure: each readStats() reads the
file, and getDelta() returns the per-read delta of each counter against the
previous snapshot.

All tracked fields are monotonically increasing since-boot counters, so
VmStats::operator- computes deltas and clamps negative results to 0 (counter
reset, or a field that appeared/disappeared across kernels). Fields absent on a
given kernel (for example pgpromote_candidate without NUMA tiering) never match
and stay 0.

Tracked fields: pgscan_direct, pgscan_kswapd, pgsteal_kswapd, pageoutrun,
compact_stall, compact_fail, compact_success, compact_free_scanned,
compact_migrate_scanned, compact_isolated, pgmajfault,
workingset_refault_anon, workingset_refault_file, pgpromote_candidate.

This is collection only; wiring into the daemon follows in later diffs.

Differential Revision: D116889620

Summary:
Adds `VmStatCollector` (`fbcode/dynolog/src/VmStatCollector.{h,cpp}`), a small
open-source collector that parses a selected set of `/proc/vmstat` fields. It
mirrors the existing `KvmStatsCollector` structure: each `readStats()` reads the
file, and `getDelta()` returns the per-read delta of each counter against the
previous snapshot.

All tracked fields are monotonically increasing since-boot counters, so
`VmStats::operator-` computes deltas and clamps negative results to 0 (counter
reset, or a field that appeared/disappeared across kernels). Fields absent on a
given kernel (for example `pgpromote_candidate` without NUMA tiering) never match
and stay 0.

Tracked fields: `pgscan_direct`, `pgscan_kswapd`, `pgsteal_kswapd`, `pageoutrun`,
`compact_stall`, `compact_fail`, `compact_success`, `compact_free_scanned`,
`compact_migrate_scanned`, `compact_isolated`, `pgmajfault`,
`workingset_refault_anon`, `workingset_refault_file`, `pgpromote_candidate`.

This is collection only; wiring into the daemon follows in later diffs.

Differential Revision: D116889620
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Aug 21, 2026
@meta-codesync

meta-codesync Bot commented Aug 21, 2026

Copy link
Copy Markdown

@abhiShedge has exported this pull request. If you are a Meta employee, you can view the originating Diff in D116889620.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant