Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there anyway to read performance counters on OS X Mountain Lion?

Shark, Apple's profiler which let you configure custom performance counters, is no longer supported in OSX Mountain Lion since it can't run a 32-bit kernel. Instruments.app, Apple's replacement for Shark, doesn't seem to support reading performance counters such as L1 cache hits/misses**. Is there anyway to actually setup and read performance counters on OS X? Even if there is no application, is there some user-land API to do this?

**Instruments.app does seem to have an interface for performance counters, but on my Retina MacBook Pro, the PM Events window lists no events, and indicates "Device: Unknown." Are there any other alternatives to Instruments?

like image 274
user1775117 Avatar asked Oct 25 '12 18:10

user1775117


People also ask

Does OS X Mountain Lion still work?

Support Ending December 31, 2019 In keeping with Apple's release cycle, macOS 10.08 Mountain Lion is no longer receiving security updates as of November of 2013. Our latest fully-supported operating system is macOS Mojave (10.14).

Is Mountain Lion better than Lion on Mac?

Mountain Lion provides stability, security and performance improvements over Lion. Any time you do a system upgrade there is a risk that data will be lost or corrupted. There's the risk that the data is already corrupted but you were not aware. Then you upgrade and the computer no longer works at all.

How many GB is OS X Mountain Lion?

8 GB of available space.


1 Answers

Yes. It's there, but difficult to find and clumsy to use (ver.4.5).

  • Launch Instruments.
  • You are greeted by the Wizard
  • Choose "Blank" template for OS X
  • Press cmd+L to display the Library
  • Add "Counters" instrument to your Instruments document
  • Press cmd+shf+P -- you are presented with the PM Events floating window.
  • Let's evaluate "Divide Operations executed" -- Add "Divide Operations executed" to the PM Events window's search field.
  • Now set the "State" of "Divide Operations executed" to "Visible"
  • Now back to the main document window, press cmd+I to display the info popover of the "Counters" instrument.
  • Press the + button
  • Set the new Counter's event to "Divide Operations executed"
  • Begin sampling...
  • End sampling...

You will see the results in Instruments' table columns. Of course, there are many events you could record -- So find the L1 cache events you are interested in and add them instead of divides.

Also be prepared for system freezes (one happened while writing this up).

like image 127
justin Avatar answered Sep 22 '22 18:09

justin