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
F175632888: D60563.id189318.diff
Mon, Oct 12, 4:35 AM
F175626988: D60563.id.diff
Mon, Oct 12, 3:38 AM
F175607779: D60563.diff
Mon, Oct 12, 12:29 AM
Unknown Object (File)
Sun, Oct 11, 12:27 PM
Unknown Object (File)
Sun, Oct 11, 5:55 AM
Unknown Object (File)
Sun, Oct 11, 12:53 AM
Unknown Object (File)
Sat, Oct 10, 4:09 PM
Unknown Object (File)
Sat, Oct 10, 4:01 PM
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