How to get my extension’s process ID of the dext for debugging with lldb

I've asked this question in Stackoverflow, but no response, so I ask for help in here.

I follow this guide Debugging and testing system extensions, and try to debug my dext code.

In the Attach the debugger to your system extension, it said After your system extension launches, run the ps command-line tool and note your extension’s process ID.

This is the current output for my dext status

% systemextensionsctl list
1 extension(s)
--- com.apple.system_extension.driver_extension
enabled	active	teamID	bundleID (version)	name	[state]
*	*	K3TDMD9Y6B	com.accusys.scsidriver (1.0/1)	com.accusys.scsidriver	[activated enabled]

and I used the ps command but nothing happen, I can not get my extension’s process ID.

ps aux | grep com.accusys.scsidriver

or

ps -ef | grep com.accusys.scsidriver

How to do that?

Any suggestion is appreciated.

Answered by DTS Engineer in 817495022

I've asked this question in Stackoverflow, but no response, so I ask for help in here.

I follow this guide Debugging and testing system extensions, and try to debug my dext code.

In the Attach the debugger to your system extension, it said After your system extension launches, run the ps command-line tool and note your extension’s process ID.

A few things here:

  • The flow above is supposed to work because the naming convention of DEXTs mean that your process name will (probably) end up being your bundle ID, however, it's probably possible to bypass that (either accidentally or by design).

  • It will only work if your DEXT is still running. If your DEXT never loaded or failed quickly, it's entirely possible for it to be load, launched, and exited before your "ps" runs.

  • My own recommendation for monitoring this would be to open Activity Monitor and filter for use your bundle ID ("com.accusys.scsidriver"). That will let you see the load process occurring in the log and, assuming your DEXT manages to load, you can also pull the PID from the console log.

__
Kevin Elliott
DTS Engineer, CoreOS/Hardware

I've asked this question in Stackoverflow, but no response, so I ask for help in here.

I follow this guide Debugging and testing system extensions, and try to debug my dext code.

In the Attach the debugger to your system extension, it said After your system extension launches, run the ps command-line tool and note your extension’s process ID.

A few things here:

  • The flow above is supposed to work because the naming convention of DEXTs mean that your process name will (probably) end up being your bundle ID, however, it's probably possible to bypass that (either accidentally or by design).

  • It will only work if your DEXT is still running. If your DEXT never loaded or failed quickly, it's entirely possible for it to be load, launched, and exited before your "ps" runs.

  • My own recommendation for monitoring this would be to open Activity Monitor and filter for use your bundle ID ("com.accusys.scsidriver"). That will let you see the load process occurring in the log and, assuming your DEXT manages to load, you can also pull the PID from the console log.

__
Kevin Elliott
DTS Engineer, CoreOS/Hardware

How to get my extension’s process ID of the dext for debugging with lldb
 
 
Q