How to log CPU usage of a particular process?

Discussion in 'macOS' started by us85, Jan 14, 2010.

  1. us85 macrumors newbie

    Joined:
    Jan 14, 2010
    #1
    hi,

    i want something similar to Window's Performance Monitor (Perfmon) on MAC. i need logs for the CPU usage of a particular process on MAC OSX. Please let me know if there is an in-built MAC utility or suggest some external application..

    Thanks.
     
  2. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #2
    The (free) Developer tools include Instruments that can attach to any process and record all sorts of things including CPU usage.

    [​IMG]

    You can read the in-depth guide here.
     
  3. us85 thread starter macrumors newbie

    Joined:
    Jan 14, 2010
    #3
    thanks robbieduncan but can you please tell me how do i get the logs? i can see the CPU usage in the monitor but i cannot figure out how to log it..
     
  4. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #4
    I'm not on a Mac right now: I imagine there is a File->Save As command. In fact it's in the user guide I linked to and assumed you would read.
     
  5. wrldwzrd89 macrumors G5

    wrldwzrd89

    Joined:
    Jun 6, 2003
    Location:
    Solon, OH
    #5
    Thanks for that, robbieduncan. I had no idea that tool existed. I was going to suggest the Quick and Dirty method of:
    1. Find the process's name or PID, using ps | grep name
    2. Run top, setting options to only display the process you want logged, run it in the background, and redirect the output to a file.
    ...but your method is SO much easier.
     
  6. us85 thread starter macrumors newbie

    Joined:
    Jan 14, 2010
    #6
    hey have you used Instruments? I'm facing a weird problem..i record in Cpu monitor, then try to Export it ..as mentioned in the link provided by rob, but the CSV file does not get generated. Can anyone tell me what are the steps to generate the CSV..i might be missing something..
     
  7. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #7
    I've used it to monitor iPhone programs but I've never tried to use the export. Perhaps you have to have the specific instrument you want to export selected?
     

Share This Page