Page MenuHomeFreeBSD

hwpmc: fix multipart sample accounting
Needs ReviewPublic

Authored by afscoelho_gmail.com on Sat, Oct 10, 1:22 AM.
Tags
None
Referenced Files
F175357384: D60563.id189318.diff
Sat, Oct 10, 6:30 AM
F175349499: D60563.id189318.diff
Sat, Oct 10, 5:04 AM
F175349475: D60563.id.diff
Sat, Oct 10, 5:04 AM
F175345242: D60563.id189318.diff
Sat, Oct 10, 4:14 AM
F175345240: D60563.diff
Sat, Oct 10, 4:14 AM
Subscribers

Details

Reviewers
mhorne
gnn
ali_mashtizadeh.com
Group Reviewers
pmc
Summary

Fix how multipart samples (IBS) are stored:

  • Clear and count the whole 8-byte header (two slots on 32-bit).
  • Count the payload when the callchain depth is 1.
  • Do not reserve an extra slot for the user callchain.
  • Use the real PC, not the header, for profil(2).
  • Make sure a sample slot can hold the largest payload.

Add <sys/pmclog.h> helpers to find the callchain in a multipart record.

Test Plan

Built amd64 GENERIC + hwpmc.ko, GENERIC without HWPMC_HOOKS, and arm64.
Ran tests/sys/pmc on AMD Zen 6 (LBR v2).

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 77936
Build 74819: arc lint + arc unit