Timing system calls

Quantify allows you to control how system calls are timed.

Avoiding timing for all system calls

You can use the -record-system-calls option to control whether Quantify collects timing data for system calls. By default, -record-system-calls=yes so that Quantify records and distributes the elapsed (wall-clock) time of each system call. To avoid timing system calls, use -record-system-calls=no.

For example, if you run the testHash program with the default setting, Quantify times system calls. The program summary looks like this:  

If you run the testHash program with -record-system-calls=no, Quantify does not time system calls. The program summary looks like this:

For more information about how Quantify records system calls, read How Quantify times system calls.

Note:

Controlling how system calls are timed

The -measure-timed-calls option controls how system calls are timed. By default, -measure-timed-calls=elapsed-time. This measures the elapsed time of each call.

Specify -measure-timed-calls=user+system to measure the change in user and system time recorded by the kernel for the process. Unlike elapsed-time, user+system measurements do not reflect any time that your program and the kernel waited for other processes before the system call could be completed. The measurements Quantify reports match more closely those reported by /bin/time for the uninstrumented version of the program. It tells you the amount of work the kernel did to service your program only.

If you specify user+system, Quantify typically reports smaller counts for system calls. This is because the wait time is not included in these measurements. For example:

You can also specify user or system individually to measure only the time the kernel spent servicing your requests.

Avoiding timing for specific system calls

You can use the -avoid-recording-system-calls option to avoid timing one or more specific operating system calls. Specify a list of system call names or numbers, separated by commas. You can find the names and numeric values in the /usr/include/sys/syscall.h header file.

The default values for -avoid-recording-system-calls are:

Solaris: SYS_exit, SYS_poll

HP-UX: SYS_exit, SYS_select, SYS_listen, SYS_sigpause

In X Windows programs, Quantify routinely reports that large amounts of time were excluded from the dataset. This is because, by default, Quantify avoids recording time for system calls such as SYS_select and SYS_exit.

In the following example from a Quantify'd X Windows client, most of the unreported time is due to the X Windows server and client waiting at the select system call for the user to select an operation to perform.

Some UNIX client-server applications typically combine an X Windows graphical user interface and a database client interface, which communicate with the X Windows server and the database server respectively. If the database client routines also use SYS_select to wait for the database server to respond, Quantify does not report the time your program waited for the database server, since it avoids timing all calls to select.

To time the database calls, but avoid the X Windows calls, you can surround the database accesses with calls to the API functions quantify_start_recording_system_call and quantify_stop_recording_system_call. For more information, read Collecting partial data for a run.

Reporting excluded system-call time

If you avoid timing system calls completely by using -record-system-calls=no, or individually by using -avoid-recording-system-calls, Quantify does not include this time in the recorded data for the function and does not distribute the time to callers. Quantify, however, does continue to time the avoided system calls.

By default, if the excluded time exceeds 0.5 percent of the combined counted and excluded times, Quantify reports this value as excluded in the program summary along with the names of system calls contributing to the excluded time. This helps you to understand how much time is not accounted for by Quantify so you can include the time in the dataset if necessary.

You can use the -report-excluded-time option to control whether Quantify reports excluded time. Specify -report-excluded-time=no to eliminate the reports of excluded time. You can also specify a number between 0.0 and 100.0 as a percentage threshold, past which Quantify reports the excluded time in the program summary.