<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/lib/libpmc, branch release/14.4.0</title>
<subtitle>FreeBSD source tree</subtitle>
<id>https://cgit-dev.freebsd.org/src/atom?h=release%2F14.4.0</id>
<link rel='self' href='https://cgit-dev.freebsd.org/src/atom?h=release%2F14.4.0'/>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/'/>
<updated>2026-02-09T03:09:29Z</updated>
<entry>
<title>pmc: Import Intel Granite Rapids events</title>
<updated>2026-02-09T03:09:29Z</updated>
<author>
<name>Bojan Novković</name>
<email>bnovkov@FreeBSD.org</email>
</author>
<published>2026-02-02T10:13:12Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=5d7d22588dada885d7d8e2db306aa6e0ac030ef1'/>
<id>urn:sha1:5d7d22588dada885d7d8e2db306aa6e0ac030ef1</id>
<content type='text'>
Approved by:	re (cperciva)
Reviewed by:	mhorne
Sponsored by:	Klara, Inc.
Obtained from:	Intel perfmon (JSON event definitions)
Differential Revision:	https://reviews.freebsd.org/D55081
MFC after:	2 days

(cherry picked from commit a3ff85e11925ba1e25465c8ba633356f405f9214)
(cherry picked from commit 625ed651833e76a439a7010aa28c93bc83013168)
</content>
</entry>
<entry>
<title>pmc: add alderlaken model</title>
<updated>2025-12-11T20:24:29Z</updated>
<author>
<name>Anaëlle CAZUC</name>
<email>Anaelle.CAZUC@stormshield.eu</email>
</author>
<published>2025-12-04T17:52:23Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=e56189d4436b91c2ccf915774cb2eef53c8eca0e'/>
<id>urn:sha1:e56189d4436b91c2ccf915774cb2eef53c8eca0e</id>
<content type='text'>
This commit adds alderlaken CPU model to hwpmc/libpmc. JSON event
definitions are imported from Intel perfmon version 1.16.

Reviewed by:	mhorne
MFC after:	1 week
Sponsored by:	Stormshield
Differential Revision:	https://reviews.freebsd.org/D49229

(cherry picked from commit ca3e47b0ea68664c7e10e1c3e28c5ac7d9932c21)
</content>
</entry>
<entry>
<title>pmc: add emerald rapids model</title>
<updated>2025-12-11T20:24:29Z</updated>
<author>
<name>Anaëlle CAZUC</name>
<email>Anaelle.CAZUC@stormshield.eu</email>
</author>
<published>2025-12-04T17:36:32Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=f7129ef918b77596536107e5687a14907bda07c1'/>
<id>urn:sha1:f7129ef918b77596536107e5687a14907bda07c1</id>
<content type='text'>
This commit adds emerald rapids CPU model to hwpmc/libpmc. JSON event
definitions are imported from Intel perfmon version 1.06.

Reviewed by:	mhorne
MFC after:	1 week
Sponsored by:	Stormshield
Differential Revision:	https://reviews.freebsd.org/D49228

(cherry picked from commit 51a01f3debff8abf63c7cc21db9523c8feb53823)
</content>
</entry>
<entry>
<title>jevents: Fix bootstrapping on macOS with Clang 16 / Apple Clang 15</title>
<updated>2024-05-02T20:10:13Z</updated>
<author>
<name>Jessica Clarke</name>
<email>jrtc27@FreeBSD.org</email>
</author>
<published>2024-03-16T01:50:20Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=9019baf667c77a85ae3e23bac127a3e99411b401'/>
<id>urn:sha1:9019baf667c77a85ae3e23bac127a3e99411b401</id>
<content type='text'>
macOS, like Linux, does not include an outer const qualifier for its
fts_open callback arguments, so -Wincompatible-function-pointer-types
also picks this up and breaks the build now Clang 16 makes it an error
by default. Extend the existing Linux support to fix this.

MFC after:	1 week

(cherry picked from commit d8c84215d7675b7940412122b6d7026bd193c9b5)
</content>
</entry>
<entry>
<title>jevents: fix bootstrapping on Linux with Clang 16</title>
<updated>2024-05-02T20:10:13Z</updated>
<author>
<name>Alex Richardson</name>
<email>arichardson@FreeBSD.org</email>
</author>
<published>2023-12-12T05:10:14Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=8cb8aca83f6c3d5a28910c1dc66861232e6ccada'/>
<id>urn:sha1:8cb8aca83f6c3d5a28910c1dc66861232e6ccada</id>
<content type='text'>
The glibc fts_open() callback type does not have the second const
qualifier and it appears that Clang 16 errors by default for mismatched
function pointer types. Add an ifdef to handle this case.

Reviewed By:	imp, emaste
Differential Revision: https://reviews.freebsd.org/D43000

(cherry picked from commit 60e845ceef25533bfb60450549bea56a17b1e467)
</content>
</entry>
<entry>
<title>libpmc: Import AMD Zen 4 PMU events</title>
<updated>2024-04-27T03:02:10Z</updated>
<author>
<name>Alexander Motin</name>
<email>mav@FreeBSD.org</email>
</author>
<published>2024-04-20T15:54:04Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=75f1323c15cb95e55c0d55dcd468967857762815'/>
<id>urn:sha1:75f1323c15cb95e55c0d55dcd468967857762815</id>
<content type='text'>
MFC after:	1 week

(cherry picked from commit 278d6950943a9fec2bddb037b547c04a847c54ba)
</content>
</entry>
<entry>
<title>dirdeps: Add missing dependency files</title>
<updated>2024-04-16T02:32:03Z</updated>
<author>
<name>Stephen J. Kiernan</name>
<email>stevek@FreeBSD.org</email>
</author>
<published>2023-10-29T21:08:29Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=ba1b5e122a2f4813ef1022880ad27317e13ed1df'/>
<id>urn:sha1:ba1b5e122a2f4813ef1022880ad27317e13ed1df</id>
<content type='text'>
Some leaf directories were missing Makefile.depend files or needed
architecture-specific Makefile.depend.* files.

(cherry picked from commit e5b786625f7f82a1fa91e41823332459ea5550f9)
</content>
</entry>
<entry>
<title>pmc: better distinguish pmu-events allocation path</title>
<updated>2023-09-11T19:19:58Z</updated>
<author>
<name>Mitchell Horne</name>
<email>mhorne@FreeBSD.org</email>
</author>
<published>2023-06-06T17:26:46Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=5adb91c72985b840b2c7fbf3c3308619acd2b61a'/>
<id>urn:sha1:5adb91c72985b840b2c7fbf3c3308619acd2b61a</id>
<content type='text'>
Background:

The pm_ev field of struct pmc_op_pmcallocate and struct pmc
traditionally contains the index of the chosen event, corresponding to
the __PMC_EVENTS array in pmc_events.h. This is a static list of events,
maintained by FreeBSD.

In the usual case, libpmc translates the user supplied event name
(string) into the pm_ev index, which is passed as an argument to the
allocation syscall. On the kernel side, the allocation method for the
relevant hwpmc class translates the given index into the event code that
will be written to an event selection register.

In 2018, a new source of performance event definitions was introduced:
the pmu-events json files, which are maintained by the Linux kernel. The
result was better coverage for newer Intel processors with a reduced
maintenance burden for libpmc/hwpmc. Intel and AMD CPUs were
unconditionally switched to allocate events from pmu-events instead of
the traditional scheme (959826ca1bb0a, 81eb4dcf9e0d).

Under the pmu-events scheme, the pm_ev field contains an index
corresponding to the selected event from the pmu-events table, something
which the kernel has no knowledge of. The configuration for the
performance counting registers is instead passed via class-dependent
fields (struct pmc_md_op_pmcallocate).

In 2021 I changed the allocation logic so that it would attempt to
pull from the pmu-events table first, and fall-back to the traditional
method (dfb4fb41166bc3). Later, pmu-events support for arm64 and power8
CPUs was added (28dd6730a5d6 and b48a2770d48b).

The problem that remains is that the pm_ev field is overloaded, without
a definitive way to determine whether the event allocation came from the
pmu-events table or FreeBSD's statically-defined PMC events. This
resulted in a recent fix, 21f7397a61f7.

Change:

To disambiguate these two supported but separate use-cases, add a new
flag, PMC_F_EV_PMU, to be set as part of the allocation, indicating that
the event index came from pmu-events.

This is useful in two ways:
 1. On the kernel side, we can validate the syscall arguments better.
    Some classes support only the traditional event scheme (e.g.
    hwpmc_armv7), while others support only the pmu-events method (e.g.
    hwpmc_core for Intel). We can now check for this. The hwpmc_arm64
    class supports both methods, so the new flag supersedes the existing
    MD flag, PM_MD_EVENT_RAW.

 2. The flag will be tracked in struct pmc for the duration of its
    lifetime, meaning it is communicated back to userspace. This allows
    libpmc to perform the reverse index-to-event-name translation
    without speculating about the meaning of the index value.

Adding the flag is a backwards-incompatible ABI change. We recently
bumped the major version of the hwpmc module, so this breakage is
acceptable.

Reviewed by:	jkoshy
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D40753

(cherry picked from commit c190fb35f35cc163b61e582a49115680b0d49dcc)
</content>
</entry>
<entry>
<title>libpmc: make pmc_pmu_pmcallocate() machine-independent</title>
<updated>2023-09-11T19:19:58Z</updated>
<author>
<name>Mitchell Horne</name>
<email>mhorne@FreeBSD.org</email>
</author>
<published>2023-06-19T22:32:22Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=196bb0e152cf2d3a0ba61bda8a2d09c8107a809a'/>
<id>urn:sha1:196bb0e152cf2d3a0ba61bda8a2d09c8107a809a</id>
<content type='text'>
Have it call the platform-dependent version. For better layering, move
the reset logic inside the new function. This is mainly to facilitate an
upcoming change.

Reviewed by:	jkoshy
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D40752

(cherry picked from commit 45dcc17e2fb8f0f9838ba167b311f271a08fcea9)
</content>
</entry>
<entry>
<title>Remove $FreeBSD$: two-line nroff pattern</title>
<updated>2023-08-16T17:55:10Z</updated>
<author>
<name>Warner Losh</name>
<email>imp@FreeBSD.org</email>
</author>
<published>2023-08-16T17:55:10Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=fa9896e082a1046ff4fbc75fcba4d18d1f2efc19'/>
<id>urn:sha1:fa9896e082a1046ff4fbc75fcba4d18d1f2efc19</id>
<content type='text'>
Remove /^\.\\"\n\.\\"\s*\$FreeBSD\$$\n/
</content>
</entry>
</feed>
