1

On Xcode 11.6, I've learned that the Instruments app includes an "os_log" instrument, which reveals some possibly very helpful information for debugging CoreML models. When I run inference on a CoreML model on macOS, I can see logging from the com.apple.coreml and com.apple.espresso subsystems about creating and running the model.

What puzzles me is that I don't see those logging messages in the Console app.

So I'm wondering, does the "os_log" instrument in Instruments provide a view of logging messages not available otherwise? Is there any documentation on this instrument? Or is there a way to configure the Console app -- or even better, to use the command-line log executable -- to see all these messages that are visible Instruments?

algal
  • 27,584
  • 13
  • 78
  • 80

1 Answers1

0

Answer, yes.

By default the os_log instrument in Instruments seems to have access to log messages which are unredacted and at deeper log level, in comparison with Console.app or with the log executable by default.

However, I found that you install a custom device profile on your Mac, to disable redaction of log messages, then you can see all of this detail from the command line with a command like the following:

log show --predicate '(subsystem IN {"com.apple.espresso","com.apple.coreml"}) && (category IN { "espresso","coreml"})' --info --debug --last 1m

This will show all messages (since it includes info and debug level), coming from the CoreML or espresso substorms, that were logged in the last one minute.

If you turn off logging redaction, the messages become more useful. For instance, you can see logs emitted during the just-in-time compilation process.

algal
  • 27,584
  • 13
  • 78
  • 80