Context switch logging with the Windows Event Tracing API (2014)
This API is for people (both program authors and users) who really know quite well what they&#x27;re doing, for very rare occasions, and the alternative&#x2F;status quo was to not be able to get this info from the kernel at all. I imagine someone at MS thought they did a favor to people doing performance optimization by giving them something instead of nothing, perhaps they even had to fight to include this feature in the product because obviously Windows would sell rather well without the feature. They must have had a bad day reading this criticism.<p>(I&#x27;m not saying &quot;poor Microsoft&quot; - it&#x27;s definitely not poor - and I&#x27;m not saying &quot;you should thank people for whatever API they give you&quot; - a lot of programs&#x2F;features do more harm than good - and I&#x27;m not saying someone shouldn&#x27;t vent having had a lot of time burnt by some ugly API. I&#x27;m saying specifically that this here is a dark corner of the OS that the API in question sheds at least some light on and I have a hunch, perhaps an entirely mistaken one, that it was someone&#x27;s pet initiative and they thought it was definitely better than nothing. &quot;Little did they know.&quot; To take a simple example of the other kind of API: sprintf, the version that doesn&#x27;t take a buffer size, is a really bad API because that&#x27;s something everyone&#x27;s gonna use a lot and you just shouldn&#x27;t give this kind of thing to people (give them snprintf at the very least) and you certainly can&#x27;t be excused by &quot;one should know what they&#x27;re doing&quot; in this case because it&#x27;s between hard and uneconomical to use safely while passing the buffer size is the obvious thing to do, also one seems entitled to care-free string formatting, definitely 100x more so than care-free kernel status monitoring on the grounds of it being something many more people do much more often.)