A common troubleshooting advice is to "reset the SMC!"
But it is actually a bit unclear why and how this fixes things up.
Apple also only lists a few symptoms in:
What the SMC does…
But this does not tell you what might be really wrong there. Note that this question how-to-diagnose-the-smc aims at symptoms, not the real data.
How do we read what values are stored there? That is: all of them and in their raw.
If you've ever looked under the hood at a Mac OS X application for controlling fans or reading sensor data, then you will undoubtedly have seen two files - smc.c and smc.h. Used in just about every project that relies upon reading SMC values.
If we look at third party applications for this kind of task we might find: SMCKit which reads some values; SMCmonitor is behind a wall and smc-command (which is not supported anymore and doesn't build?).
None of these seem to be able to really read all values? Is there a method to read all values and settings?
This is from an end user or troubleshooter perspective: it should be useful to check what went wrong or is wrong, when an SMC reset might be needed, if that did indeed fix a problem, or whether or not an SMC reset was indeed performed (end user not hitting the right keys, without power cord connected, with other peripherals).
Currently the one size fits all black box approach of: "Something's weird" – "Perform an SMC reset!" sounds like voodoo advice, all too often. (As indicated by many comments on this site that extend the above conversation with "Didn't do anything useful.")
Concrete example to apply this to: In the answer to GPU problem - Boot Hangs on Grey Screen an EFI variable is written to NVRAM. This works for a time quite beautifully. But after a while the system hangs on waking from sleep after just closing the lid; but usually still does not hang on wake after issuing the sleep command via menu or timer. This lid-sleep works usually like the others after applying the hack and starts to work again after resetting the SMC and re-applying the hack.
Using the binary
smc from smcFanControl listed above we are able to dump a bunch of variables (excerpt):
TCGC [sp78] 40.000 (bytes 28 00) TCSA [sp78] 36.000 (bytes 24 00) TCTD [sp78] 0.098 (bytes 00 19) TG0D [sp78] -128.000 (bytes 80 00) TG0P [sp78] 30.500 (bytes 1e 80) THSP [sp78] 28.500 (bytes 1c 80) TM0S [sp78] 54.969 (bytes 36 f8) TMBS [sp78] 0.000 (bytes 00 00)
After doing this saving the data to a file for a while I now have some data over time. But I fail to identify the crucial parts. Which variables control the sleep behaviour? Is there more exact documentation out there on this?