Download Shark SK435CO User guide
Transcript
Advanced Profiling Control Command Line Shark ● Time Interval — shark -I allows you to change the sampling interval for configurations that support a sampling interval. Valid times are entered the same way as for time limits. ● Sample Limit — shark -S allows you to specify the maximum number of samples to record during each session. Some other, less commonly used options change the behavior of shark: ● Quiet Mode — shark -q will limit terminal output to reporting of errors only. ● Ignore task exits — shark -x will instruct shark to ignore task exit notifications. Normally, shark gets notified when tasks are about to exit while it is profiling. This allows shark to collect some basic information about the task just before it is allowed to quit. It is possible, though not likely, that this can cause gaps in profiling. Use of this option is discouraged. This is equivalent to the use of the similarly named preference in Shark Preferences (page 24). ● Change default filename — shark -o allows you to change the default session file name from session_XX.mshark to a user supplied name. This name will be appended with a unique number to create a unique file name. For example, shark -o myfile will result in session files names myfile_01.mshark, myfile_02.mshark, and so on. ● Change session file path — shark -d allows you to specify the directory where shark will save session files, instead of the current working directory. Target Selection With command line shark, you can choose to launch and attach shark to a process, or attach shark to a currently running process, using options similar to the ones described previously in Process Attach (page 122) and Process Launch (page 122) for graphical Shark. To launch a process, simply append the process invocation as you normally would to the end of the shark command line. The following example would launch /bin/ls ~/Documents, and start shark profiling immediately: shark -i /bin/ls ~/Documents Instead, if you wanted to attach to a running Apache daemon process, you might try this line: shark -i -a [pid of httpd] Making things even simpler, if you do not know the PID of the process in which you are interested, you can specify a full or partial name as the argument to the -a option. If there are multiple matches to a partial name, Shark will take its best guess. For these situations, it is often best to supply a PID instead. Retired Document | 2012-07-23 | Copyright © 2012 Apple Inc. All Rights Reserved. 132