Professor @ University of Waterloo
https://rcs.uwaterloo.ca/~ali/
User Details
- User Since
- Mar 7 2018, 6:37 PM (439 w, 2 d)
Yesterday
Hello folks this is a quick draft I threw together to sketch out providing a unified interface for branch histories like LBR on Intel and AMD, and BRBE on ARM. I looped in everyone that's working on a relevant patch.
Wed, Aug 5
This looks like a step in the right direction and the API looks reasonable, but I'm not sure you thought through all the use cases. Someone concurrently using a system wide counter to monitor something at the same time as a process wide counter is running. E.g. two different pmcstat instances:
Mon, Aug 3
So is the reason we aren't hard coding this and integrating BRBE into the pmc module is that it will be used by hwt as well? Is this best exposed through hwt or is it just extended data that can be exposed throught he multipart flag I added for AMD IBS? The multipart flag lets you add arbitrary payloads alongside a counter.
Fri, Jul 31
These two diffs should be merged but does it fix the -U flag bug? I don’t see why we need to keep the two path I had a patch to unify them but I hit a different assert.
Mon, Jul 20
I think there’s some flexibility in how we use it but as I discussed in the meeting last week, the main thing Linux used it for is to reduce the overhead of the wrmsrs.
Thu, Jul 16
Wed, Jul 15
Maybe I'm missing something but it doesn't look like this feature is completely implemented.
I made a high level pass over the diff I think I have enough context to review it carefully now.
Any more comments on these or can someone land this stack? I got the remaining functionality I described that I would like to rebase and prepare for review.
Thu, Jul 9
Jul 8 2026
Fix usage until other patch lands
Update magic
Jul 5 2026
Jul 4 2026
Jul 2 2026
Tinderbox passes on my tree, except for unrelated ZFS build problems for amd64.LINT*.
Portability fixes
Portability fixes
Portability fixes
Jul 1 2026
I'm running a build on a few architectures to make sure I don't break anything. I'll post when it's done.
Fix the study command defaults
Fix string length check
Misused git-arc sorry my first attempt so it should have any changes.
Thanks for your comments I fixed the armv7 and cleaned up the default/flamegraph to use unhalted-cycles. Seems that is defined now on x86 and ARM64 correctly, but I'll make a separate patch to add reasonable aliases for POWER8/9.
Also can someone with access on review make a sched group?
We may have hit this one but that's not the one I'm testing a patch for right now. If it looks good in our setup I'll share it. It's a bit more of a fundamental scheduler change that we may or may not want to have enabled by default.
Jun 30 2026
Thanks Adrian for your comments if there's anything you want me to urgently fix I can do that. Otherwise my goal was get the general and IBS tooling in people's hands.
Yes, I don't have the ncurses bits ready so I haven't bothered with SIGWINCH just yet. In this first set of diffs it print once to the current console.
I think my higher level comment in the previous diff still holds that you can just expose the amd functions through the pmc_classdep struct to make it platform agnostic and then remove the #ifdefs and amd specific checks throughout the code. Everyone zero's out that structure so we depend on a NULL pointer meaning that the call isn't implemented. Just have your wrapper function return EOPNOTSUPP if it's a null pointer.
Also take a look at the Intel Fixed function counters IAF that are also always present. Start/stop are nops.
Jun 25 2026
Just to follow up with our call can you quickly layout the plan for integrating with:
In the existing code we have to allocate counters into specific indexes in an order to check that they meet our constraints. Either:
I'm assuming we are going to multiplex the counters based on the sample 'rate'?
Jun 24 2026
For context we worked with AMD to get Instruction Based Sampling (IBS) support into HWPMC and we are making a number of ongoing improvements. I built into the somewhat abandoned pmc command a new set of tools for collecting and analyzing pmc logs. I split the this stack of patches into the smallest set I could but to do that I've left out a lot of functionality that improves substantially over pmcstat.
Jun 23 2026
Jun 10 2026
May 26 2026
May 22 2026
Thanks Andre for all the hard work sorry to point out one more change.
May 19 2026
The only major issue is that we shouldn't expose bit63 as a flag that's just CAP_USER and CAP_SYSTEM. The other changes are real minor. Mitchell didn't like the structure size changing but we have to support it if we want any resemblance of backwards compatibility.
Mar 23 2026
Ah I realize this is for the formulas they provide. Looks good.
Mar 22 2026
I think you can abandon this one too I removed that disable and the PMC_IS_STOPPED macro is a mess going forward as the bits are moving around now.
It looks like we landed some version of this diff already? Should we close it?
Abandon this one too.
I just started looking through the backlog I think we can abandon this change now?
Might make sense to change these limits to #defines and also you might as well add this information to the man page for hwpmc.
The change looks good overall, but do we need to do anything with these fields or it's just annotations for the user?
Mar 12 2026
Mar 11 2026
Looks good to me, just be aware that I landed a fix that forces us to whitelist json fields. I don't see any new fields but you should check that it builds against head as of bfb2fd5f66183454cfe8771595df09c0f23c7efb
Mar 10 2026
Mar 2 2026
Also do you have a third party tool that tests rdpmc from the app? I recall there’s a library that did this was curious what APIs it’s currently using.
I pulled out my capability change, again this is reusing the existing code used by a few ARM64 platforms.
Mar 1 2026
If you want to fix your patch to the rdpmc problem we should land this and maybe wait for my other fix for the per-package change.
Feb 26 2026
Jul 8 2021
Sep 2 2020
Jun 8 2020
The WASI folks seem fine upstreaming patches. Might be nice to make clean pull requests for these projects after we resolve Brook's comment.
Jun 5 2020
Some counters from the Linux repo appear to be undocumented at the moment and I left those out. Also they seem to think some of these are available on earlier platforms but I don't see that in the documentation nor can I test it.
- Adding missing counters for Zen+ and Zen2
Most of it is in Linux's amdzen2 files should I just merge those under a new name? Seems weird they didn't use versioning. Do you have a better plan how to deal with these? (Also is the Linux tree the correct source for these json files?)
Could you clarify if these files are synced from Linux or generated from the manuals? I wanted to add a few counters that appear in the documentation but are missing from both the Intel and FreeBSD definitions. What would be the best way should we add definitions to the existing files in the correct place or create a new file to track these additions?
May 24 2019
This version does not change the default, but allows users to change the parameters.
- strn -> strl
- Fix man page