Page MenuHomeFreeBSD

pmcUmbrella
ActivePublic

Recent Activity

Sun, Sep 6

rlibby closed D59355: pmc: avoid illegal flexible array member.
Sun, Sep 6, 1:26 AM · pmc

Sat, Sep 5

rlibby updated the summary of D59355: pmc: avoid illegal flexible array member.
Sat, Sep 5, 10:52 PM · pmc
ali_mashtizadeh.com added a comment to D59355: pmc: avoid illegal flexible array member.

Yes it’s non-standard but we already depend on a number of gnu extensions in our code. I think is just an error with the build flags, if you just set the length to 0 or 1 and it’s also accepted by gcc.

I'm not sure why gcc accepts the flexible array member in pmchdr_pmcinfo and not the one in pmchdr_cpuidinfo. It seems it should allow them both as language extensions, or not. Zero-length arrays are slightly different from flexible array members in C, though both are illegal in standard C++. I guess the zero-length array avoids the size and alignment ambiguity.

Anyway, I tried your suggestion but gcc only accepted it for pmchdr_cpuidinfo::cpuid. It issued a fatal warning when it was applied to pmchdr_pmcinfo::pmc, -Werror=stringop-overread. I do not know why it doesn't issue the same fatal warning for pmchdr_cpuidinfo::cpuid.

My only interest here is getting the build working, so if you want to do non-standard C++ things, I am not going to object. I would say though that I do not understand the advantage of the non-standard way over the standard way. Why go through the bother of C++ just to work around it for something fairly trivial?

How do you build this with gcc so I can test my other patches? When I built it using my original repo I see a few more errors because of differences in our build flags.

I'll update the testing section, but in short, I do

sudo pkg install amd64-gcc14
env MAKEOBJDIRPREFIX=/usr/obj/gcc14 CROSS_TOOLCHAIN=amd64-gcc14 make buildworld

CI does essentially the same:
https://github.com/freebsd/freebsd-ci/blob/main/jobs/FreeBSD-main-amd64-gcc14_build/build.sh

And that job has been tripping since this went in:
https://ci.freebsd.org/job/FreeBSD-main-amd64-gcc14_build/4343/

Sat, Sep 5, 6:07 PM · pmc

Fri, Sep 4

rlibby added a comment to D59355: pmc: avoid illegal flexible array member.

Yes it’s non-standard but we already depend on a number of gnu extensions in our code. I think is just an error with the build flags, if you just set the length to 0 or 1 and it’s also accepted by gcc.

Fri, Sep 4, 11:03 PM · pmc
ali_mashtizadeh.com accepted D59355: pmc: avoid illegal flexible array member.
Fri, Sep 4, 9:15 PM · pmc
ali_mashtizadeh.com added inline comments to D59355: pmc: avoid illegal flexible array member.
Fri, Sep 4, 9:03 PM · pmc
ali_mashtizadeh.com added a comment to D59355: pmc: avoid illegal flexible array member.

oh i see what's going on here. ugh. :-) I'm ok with this, but gosh we need a less cpu specific way of doing all of this!

Fri, Sep 4, 9:01 PM · pmc

Thu, Sep 3

adrian added a project to D59355: pmc: avoid illegal flexible array member: pmc.

oh i see what's going on here. ugh. :-) I'm ok with this, but gosh we need a less cpu specific way of doing all of this!

Thu, Sep 3, 8:33 PM · pmc

Jul 20 2026

netchild closed D58343: hwpmc: add regression tests for detaching a live process-mode PMC.
Jul 20 2026, 10:26 AM · pmc
netchild closed D58342: hwpmc: drain a process-mode PMC's runcount when a live target detaches.
Jul 20 2026, 10:26 AM · pmc
netchild closed D58341: hwpmc: add regression tests for counting-PMC counter wraparound.
Jul 20 2026, 10:25 AM · pmc
netchild closed D58340: hwpmc: handle counter wraparound for process-mode counting PMCs.
Jul 20 2026, 10:25 AM · pmc

Jul 19 2026

adrian accepted D58343: hwpmc: add regression tests for detaching a live process-mode PMC.
Jul 19 2026, 7:37 PM · pmc
adrian accepted D58342: hwpmc: drain a process-mode PMC's runcount when a live target detaches.
Jul 19 2026, 7:36 PM · pmc
adrian accepted D58341: hwpmc: add regression tests for counting-PMC counter wraparound.
Jul 19 2026, 7:35 PM · pmc
adrian accepted D58340: hwpmc: handle counter wraparound for process-mode counting PMCs.

oh good catch! (I've found/fixed these width bugs in the deep past, they can be a pain to find as not every counter is the damned same... :-) )

Jul 19 2026, 4:55 PM · pmc
netchild requested review of D58343: hwpmc: add regression tests for detaching a live process-mode PMC.
Jul 19 2026, 12:26 PM · pmc
netchild requested review of D58342: hwpmc: drain a process-mode PMC's runcount when a live target detaches.
Jul 19 2026, 12:22 PM · pmc
netchild added a reviewer for D58340: hwpmc: handle counter wraparound for process-mode counting PMCs: pmc.
Jul 19 2026, 12:15 PM · pmc
netchild requested review of D58341: hwpmc: add regression tests for counting-PMC counter wraparound.
Jul 19 2026, 12:15 PM · pmc
netchild requested review of D58340: hwpmc: handle counter wraparound for process-mode counting PMCs.
Jul 19 2026, 12:10 PM · pmc

Jun 30 2026

adrian added a member for pmc: adrian.
Jun 30 2026, 6:30 PM

Jun 5 2026

afscoelho_gmail.com added a member for pmc: afscoelho_gmail.com.
Jun 5 2026, 3:38 PM

Mar 12 2026

ali_mashtizadeh.com added a member for pmc: ali_mashtizadeh.com.
Mar 12 2026, 8:38 PM
mhorne closed D55607: hwpmc_amd: fix amd_get_msr() MSR offset for newer counter bases.
Mar 12 2026, 3:29 PM · pmc
paulo_nlink.com.br added a comment to D55607: hwpmc_amd: fix amd_get_msr() MSR offset for newer counter bases.

You are correct, thank you for the observation. pmcstat does not exercise amd_get_msr() directly. The correct test path is via pmc_x86_get_msr() from libpmc, which issues a PMC_OP_GETMSR ioctl into the kernel amd_get_msr() code path.
Hardware validation was performed on AMD Ryzen 5 5600X (Family 19h, Zen 3), FreeBSD 16.0-CURRENT (hwpmc-amd-work-n284229-d18be873e2c2):

Mar 12 2026, 2:45 AM · pmc

Mar 11 2026

mhorne accepted D55607: hwpmc_amd: fix amd_get_msr() MSR offset for newer counter bases.

The change seems correct to me, but the test plan does not; pmcstat does not make any use of the pmc_get_msr() code path. Perhaps you have some other use-case or test program that you used?

Mar 11 2026, 5:27 PM · pmc

Mar 10 2026

ali_mashtizadeh.com accepted D55607: hwpmc_amd: fix amd_get_msr() MSR offset for newer counter bases.
Mar 10 2026, 5:22 PM · pmc

Mar 4 2026

adrian added a project to D55607: hwpmc_amd: fix amd_get_msr() MSR offset for newer counter bases: pmc.
Mar 4 2026, 6:36 PM · pmc

Feb 24 2025

anaelle.cazuc_stormshield.eu requested review of D49126: libpmc: add more alderlake models.
Feb 24 2025, 3:46 PM

Jun 26 2022

tsoome closed D32316: Support of optional PMC classes..
Jun 26 2022, 9:19 AM · pmc

Jan 27 2022

gnn removed a member for pmc: gnn.
Jan 27 2022, 3:55 PM

Dec 19 2021

ray added a comment to D32316: Support of optional PMC classes..

@ray I assume you can go ahead with committing this one?

Dec 19 2021, 3:27 PM · pmc

Nov 4 2021

emaste added a comment to D32316: Support of optional PMC classes..

@ray I assume you can go ahead with committing this one?

Nov 4 2021, 6:04 PM · pmc

Oct 27 2021

mhorne accepted D32316: Support of optional PMC classes..
In D32316#737883, @ray wrote:

It seems to me that only the changes to pmc_arm64_initialize() should be necessary, because it handles optional classes in the same way that pmc_intel_initialize() does, by passing the correct nclasses value to pmc_mdep_alloc().

Problem here is in static machdep class numbers. If classes will be initialized in incorrect order, adjusted ri will be incorrect. So that modification may save some time on debugging such issue for new optional classes with just little time in hwpmc(4) init.

Oct 27 2021, 3:39 PM · pmc
ray added a comment to D32316: Support of optional PMC classes..

It seems to me that only the changes to pmc_arm64_initialize() should be necessary, because it handles optional classes in the same way that pmc_intel_initialize() does, by passing the correct nclasses value to pmc_mdep_alloc().

Oct 27 2021, 3:12 PM · pmc
mhorne added a comment to D32316: Support of optional PMC classes..

It seems to me that only the changes to pmc_arm64_initialize() should be necessary, because it handles optional classes in the same way that pmc_intel_initialize() does, by passing the correct nclasses value to pmc_mdep_alloc().

Oct 27 2021, 3:00 PM · pmc

Oct 26 2021

allanjude updated the summary of D32316: Support of optional PMC classes..
Oct 26 2021, 4:28 PM · pmc
ray updated the diff for D32316: Support of optional PMC classes..

Update classes base ri to handle optional classes out of order.

Oct 26 2021, 1:01 PM · pmc

Oct 6 2021

ray added reviewers for D32316: Support of optional PMC classes.: emaste, andrew.
Oct 6 2021, 12:33 PM · pmc

Oct 5 2021

ray retitled D32316: Support of optional PMC classes. from Support of optional classes. to Support of optional PMC classes..
Oct 5 2021, 2:23 PM · pmc

Aug 5 2021

mhorne added a member for pmc: mhorne.
Aug 5 2021, 2:11 PM

May 26 2021

allanjude closed D30047: hwpmc: Move 4 bits of mode to extend class size to 8..
May 26 2021, 6:44 PM · pmc

May 5 2021

emaste accepted D30047: hwpmc: Move 4 bits of mode to extend class size to 8..
May 5 2021, 4:21 PM · pmc
mhorne accepted D30047: hwpmc: Move 4 bits of mode to extend class size to 8..
May 5 2021, 3:23 PM · pmc
emaste added a comment to D30047: hwpmc: Move 4 bits of mode to extend class size to 8..

Comment update LGTM

May 5 2021, 3:10 PM · pmc
ray updated the diff for D30047: hwpmc: Move 4 bits of mode to extend class size to 8..

Squash commits.

May 5 2021, 2:57 PM · pmc
ray updated the diff for D30047: hwpmc: Move 4 bits of mode to extend class size to 8..

Fix comment.

May 5 2021, 2:51 PM · pmc
ray added inline comments to D30047: hwpmc: Move 4 bits of mode to extend class size to 8..
May 5 2021, 2:43 PM · pmc
ray added a comment to D30047: hwpmc: Move 4 bits of mode to extend class size to 8..

This looks fine to me, thanks for fixing this.

It seems that pmc_id_t should be an opaque type for consumers of libpmc? I.e. the only userspace consumer of these bit macros should be libpmc itself.

If that is the case, then this change should be okay without a PMC_VERSION bump. There are no uses of PMC_ID_TO_MODE or PMC_ID_MAKE_ID in libpmc. However, I did not check if this was true for older releases.

May 5 2021, 2:43 PM · pmc