(sysdiagnose is not a feature of earlier versions of the OS)
From this topic you may learn an Apple-provided routine, which I commonly recommend to people who wish to gather system-wide diagnostic information that is helpful in investigating system performance issues.
This opening post is relatively technical. Plain english may be given in later posts, or a later edition.
Preparations (one-off)
- Code: Select all
sudo launchctl list com.apple.stackshot
– no need to paste the output, that's just to see whether a daemon is enabled on your computer. If not, see the man page for stackshot(1) and enable the daemon.
(The man page for sysdiagnose(1) refers to a key chord. AFAIR sysdiagnose can respond to that chord only if the daemon for stackshot is running.)
Assuming that you have a separate computer with a terminal:
- at the computer to be diagnosed, enable ssh service (plain English for OS X: Remote Login).
When an incident occurs
- immediately key the chord for sysdiagnose
- for at least ten seconds, touch nothing
- then at your discretion, wait as long as you can for sysdiagnose to complete
- if Finder does not respond: do not expect a normal conclusion (the result of sysdiagnose can not be brought to front).
Hints and thoughts
sysdiagnose may be overkill for some things but generally, it's good at gathering as much as possible. At least some of what's gathered may prove useful.
Even if you suspect no response to the keyboard and other human input devices – even if the display is completely frozen, and so on – do try the chord for sysdiagnose. Then wait for a few minutes before resorting to force for a shut down or restart of the computer. When the computer next starts, tou may be pleasantly surprised to find full or partial results of sysdiagnose at
/private/var/tmp
You can use an app such as CharlesSoft Pacifist to view the .tar.gz product of a run of sysdiagnose.
In some situations, it may be impossible to for sysdiagnose to completely gather all information. I made a few suggestions to Apple on how the order of things might be improved …
… and on things that might be added for use cases that include non-native file systems such as ZFS.
- Code: Select all
cat /usr/bin/sysdiagnose
– human readable, but copyright, and not in open source of OS X 10.8.2 so if you have your own ideas on how sysdiagnose might be improved, please feed your ideas to Apple in the usual way – for end users (not developers), that'll be Apple - Mac OS X - Feedback.
With a remote terminal you can attempt ssh to the computer where you keyed the chord for sysdiagnose. If ssh succeeds, then
- Code: Select all
cd /private/var/tmp && ls -ld sysd*
– whilst sysdiagnose runs there'll be a directory. For as long as the directory exists, you can browse its contents.
If sysdiagnose completes its gathering then – with or without a local bring to front (by Finder) – the directory will be replaced by a .tar.gz archive
Generally, be patient. Apple's estimate of two minutes for the allmemory part of the sysdiagnose routine may be way out.
If avoiding the Function (Fn) key on a Mac laptop is difficult when aiming for Control-Option-Command-Shift-Period don't worry. Apple designed things really nicely. When I last checked, you can be a little careless – accidentally including the Function key should not prevent recognition of the true parts of the chord. (Yes, I have keyed the chord without fingers, with the palms of my hands alone. No, I do not recommend doing so. But I've got to love the Apple engineers who, presumably, visualised the fists and palms of frustrated end users.)
There are examples of use of sysdiagnose, some with plain English, in Ask Different and elsewhere on the web.
Last but not least, don't forget that you can normally run sysdiagnose from the command line (without the key chord). But the key chord approach etc. is useful to know.