Performance counters
Jeffrey Lee (213) 6048 posts |
I’ve recently been working on a module which will allow easy access to the CPU performance counters that are present on all the modern machines (XScale, ARM11, and every ARMv7+ chip we support). Software can specify which events to monitor, and the module will take care of the rest. E.g. the hardware counters are only 32bit, so to avoid overflow the module uses TickerV to poll them at 100Hz and update the 64bit accumulators which the SWI interface exposes. And if you want to enable more events than there are hardware counters, it can automatically time-slice them, switching which events are active every centisecond (useful if you just want a vague idea of the overall performance of the system – for targeted profiling it’s probably better to time-slice manually, e.g. do multiple profiling runs of your code). All of the above is implemented and working. However, I can’t decide on a name for the module! Ideally it needs to be something that makes it clear that it’s for (CPU) performance counters, so my current thoughts are along the lines of:
But none of them really stand out as a winner. Anyone have any favourites, or alternatives to suggest? Other things on the todo list are Wimp task association, and the ability to restrict counting to just privileged or unprivileged CPU modes (if the CPU supports the feature). |
David Feugey (2125) 2709 posts |
PerfCounters / PerfCount? |
Gavin Smith (1413) 95 posts |
CPUPerfMonitor? |
Stuart Swales (1481) 351 posts |
PerfCountIsHard |
Sprow (202) 1158 posts |
If I was at an event, I’d expect someone to Perform. Pretty sure you’ll not get an allocation clash on that last one. |
Andrew McCarthy (3688) 605 posts |
ARMPC, PerfMon, CPUPC, PCMon, ARMPCMon, PCTRS, ARMP_CTRS, ARMPCTRS, CPUPIF, CPUPCIF, ARMPCIF, CPUPMon, armPCMon, armPC, … |
Rick Murray (539) 13840 posts |
No, just people grumbling that it’s pretty hard to remember how to spell it. Or, indeed, remember what it was called in the first place. I know – a have a habit of giving things weird names (Harinezumi!) and sometimes people complain that it’s a weird name, blah blah, what the hell does a hedgehog have to do with starting up the OS? [nothing – I was watching Fractale while originally writing it] Indeed, Manga was originally going to be called Azumi (as reading that is pretty much why I wrote it) but decided that “describing what it does” would be less bothersome than “a cute name”. I did concede a little though, with an icon of Haruhi Suzumiya (which was a light novel and an animé, not a manga!). Still, Hecatoncheires is a pretty cool name, so I’ll +1 that. |
Steve Drain (222) 1620 posts |
Very simple: ARMCount, or perhaps CPUCount. |
Jeffrey Lee (213) 6048 posts |
Too easy to confuse with “a module for monitoring events”
Currently the module is using the name “Twice”, from the proverb “Measure twice, cut once”. But the link between that and performance counters is probably a bit too tenuous for it to be a suitable name.
I like those – dropping “Perf” from the name does make it read better. It might get mistaken for “a module for counting how many ARM/CPU cores you have”, but anyone looking for a module for performance counters should still stand a good chance of recognising it. |
Andrew Conroy (370) 740 posts |
Any reason you can’t have “CPUPerformance” other than it being a bit long to type? |
Jeffrey Lee (213) 6048 posts |
I think the danger with names like “CPUPerf”, “CPUPerformance”, etc. is that without an extra suffix like “Count” or “Monitor”, people will assume that it’s a module for controlling performance, rather than for monitoring it. |
Martin Avison (27) 1494 posts |
I think it should be kept simple, so CPUCount caught my eye. But on reflection, I would go for CPUPerf (which is on Jeffreys original list) as it encapsulates what it is about. The Count part is, I think, less important. |
Grahame Parish (436) 481 posts |
CPUStats? |
David Feugey (2125) 2709 posts |
PerfMon |
Dave Higton (1515) 3526 posts |
Do you mean the ability to resource reservation, like booking a timer for your task’s use (to prevent another task from crashing in and stealing your timer)? It sounds like anything ending in Stats or Mon would be a misnomer, and the name should end in Utils. Stats and Mon imply measurement only. I’d vote for CPUPerfUtils. |
Jeffrey Lee (213) 6048 posts |
Kinda. Reserving counters is certainly an issue – e.g. XScale & ARM11 can only monitor two events at once (out of the 15+ events available), so there’s limited scope for allowing multiple programs to monitor different events at the same time as each other. But for Wimp task association, I’m talking about having the counters start and stop automatically as your task is paged in & out by the Wimp. After all, if you’re profiling your app, you don’t want the activities of other apps to pollute your data. So it’s mainly a convenience feature to avoid you having to manually add start & stop calls around all of your Wimp_Poll calls. |