How do view a process' resources?

Discussion in 'Mac Basics and Help' started by thewonders, Oct 2, 2017.

  1. thewonders macrumors newbie

    thewonders

    Joined:
    Sep 22, 2017
    Location:
    Beautiful Northern California
    #1
    When looking at a running processes, how do I find out what resources or connected processes are being used and associated with the item listed in Activity Monitor?
     
  2. kschendel macrumors 6502a

    Joined:
    Dec 9, 2014
    #2
    I doubt that you can discover any process resource info in Activity Monitor. Your bet bet is probably something like lsof ("list open files") at the command line. "man lsof" for details.

    You can ask Activity Monitor to list "All Processes, Hierarchically" from the View menu to show the process / subprocess structure. I'm not sure if that's what you meant by "connected processes" or not.
     
  3. thewonders thread starter macrumors newbie

    thewonders

    Joined:
    Sep 22, 2017
    Location:
    Beautiful Northern California
    #3
    Thanks. I'm just trying to figure out what processes are attached to kernel_task. I've tried using lsof -p but the PID of kernel_task is 0 which doesn't return anything in the Terminal so I wondered if there was some way in Activity Monitor. Or is there another way of going about this?
     
  4. kschendel macrumors 6502a

    Joined:
    Dec 9, 2014
    #4
    Kernel_task is special, it's the operating system itself. There aren't really any processes associated with it; or alternatively, you could say that everything is associated with it. The cpu/disk accounting for kernel_task likely includes a whole bunch of threads which do system things (e.g. hfs+ journal flush maybe, that sort of thing). On linux it's relatively easy to see these OS worker threads but I don't know of a good way to see them on OS/X. That doesn't mean there isn't any, just that I don't know what they might be. In any case, Activity Monitor won't help you for this; if there is some way to get a better breakdown of kernel_task activity, I expect you'll have to use the command line.
     
  5. ApfelKuchen macrumors 68030

    Joined:
    Aug 28, 2012
    Location:
    Between the coasts
    #5
    A Get Info on a process will disclose the Parent Process and the Process Group. However, kernel_task does not respond to a Get Info (at least, not in High Sierra). Anyway, kernel_task does not have a Parent, and the entire OS can be considered its Process Group, so that info wouldn't be all that helpful.
     
  6. thewonders thread starter macrumors newbie

    thewonders

    Joined:
    Sep 22, 2017
    Location:
    Beautiful Northern California
    #6
    I'm fine with using the command line - I just asked about Activity Monitor because I haven't found the commands to do it in the CL. But I'll keep looking - kernel_task is running at 100% and none of the online solutions have helped so far.
     
  7. kschendel macrumors 6502a

    Joined:
    Dec 9, 2014
    #7
    If the usual "cookbook" answers such as overheating, fs repair, etc don't seem to fix it, the best I can come up with is DTrace. You have to enable it in csrutil: boot into recovery by restarting with Cmd-R, open a Terminal, enter: csrutil enable --without dtrace (it will complain about an unsupported configuration), and reboot. There are a few dtrace scripts already on the machine (at least, there were in El Cap, I'd assume they are still there in Sierra or HS) such as iosnoop which you can run with sudo. Google for more info on which dtrace scripts are shipped with the Mac, and if all else fails, you can try writing your own.

    I suspect that it's easy to be led astray by the output, unless you have a good idea of what a baseline looks like and obviously you won't have that advantage. Unfortunately I'm not aware of anything significantly better. If you turn up something better, please post!
     
  8. thewonders, Oct 4, 2017
    Last edited: Oct 4, 2017

    thewonders thread starter macrumors newbie

    thewonders

    Joined:
    Sep 22, 2017
    Location:
    Beautiful Northern California
    #8
    My problem is with Yosemite - there is no SIP.
     

Share This Page