Bug 254532 - hwpmc: sampling mode aliases non-functional on arm64
Summary: hwpmc: sampling mode aliases non-functional on arm64
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 13.0-STABLE
Hardware: arm64 Any
: --- Affects Only Me
Assignee: Mitchell Horne
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-03-24 23:46 UTC by Ed Maste
Modified: 2022-09-13 17:31 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ed Maste freebsd_committer freebsd_triage 2021-03-24 23:46:45 UTC
Attempting to run a basic system-wide sampling mode profiling fails:

# pmcstat -S unhalted-cycles -O /tmp/sample.out
pmcstat: ERROR: Cannot allocate system-mode pmc with specification "unhalted-cycles": Invalid argument

# uname -a
FreeBSD generic 13.0-RC3 FreeBSD 13.0-RC3 #0 n244697-16c1f81f11a: Fri Mar 12 09:29:50 UTC 2021     root@generic:/usr/obj/root/freebsd/arm64.aarch64/sys/GENERIC  arm64
Comment 1 commit-hook freebsd_committer freebsd_triage 2022-07-06 17:33:37 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=6f50b73ee5c11253a35bb2787f2bef627079999d

commit 6f50b73ee5c11253a35bb2787f2bef627079999d
Author:     Mitchell Horne <mhorne@FreeBSD.org>
AuthorDate: 2022-07-06 17:30:03 +0000
Commit:     Mitchell Horne <mhorne@FreeBSD.org>
CommitDate: 2022-07-06 17:32:21 +0000

    libpmc: add armv8 pmu-event aliases

    These are all "standard microarchitectural events", which in theory are
    supported by every ARMv8 processor. In practice, it depends on the
    pmu-event definitions being complete and accurate, which they are not
    for every processor. Still, these aliases should be functional on the
    majority of systems.

    PR:             254532
    Reported by:    emaste
    Sponsored by:   The FreeBSD Foundation
    Differential Revision:  https://reviews.freebsd.org/D35550

 lib/libpmc/libpmc_pmu_util.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
Comment 2 commit-hook freebsd_committer freebsd_triage 2022-09-13 17:27:09 UTC
A commit in branch stable/13 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=075a04d7d77b528e4b31e7b1205ad434f5c01623

commit 075a04d7d77b528e4b31e7b1205ad434f5c01623
Author:     Mitchell Horne <mhorne@FreeBSD.org>
AuthorDate: 2022-07-06 17:30:03 +0000
Commit:     Mitchell Horne <mhorne@FreeBSD.org>
CommitDate: 2022-09-13 16:25:35 +0000

    libpmc: add armv8 pmu-event aliases

    These are all "standard microarchitectural events", which in theory are
    supported by every ARMv8 processor. In practice, it depends on the
    pmu-event definitions being complete and accurate, which they are not
    for every processor. Still, these aliases should be functional on the
    majority of systems.

    PR:             254532
    Reported by:    emaste
    Sponsored by:   The FreeBSD Foundation
    Differential Revision:  https://reviews.freebsd.org/D35550

    (cherry picked from commit 6f50b73ee5c11253a35bb2787f2bef627079999d)

 lib/libpmc/libpmc_pmu_util.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)