Analyzing Program Performance With Sun WorkShop

order

order has the following syntax:


order [lock [lock]]
order summary

The order subcommand lists information about the order in which locks are acquired by the code being analyzed. It may be run only after the analyze subcommand.

order [lock [lock]]

Shows the details about lock pairs. For example, the command


% lock_lint order foo bar

shows whether an attempt was made to acquire lock bar while holding lock foo. The output looks something like the following:


:foo :bar seen (first never write-held), valid

First the output tells whether such an attempt actually occurred (seen or unseen). If the attempt occurred, but never with one or both of the locks write-held, a parenthetical message to that effect appears, as shown. In this case, foo was never write-held while acquiring bar.

If an assertion was made about the lock order, the output shows whether the specified order is valid or invalid according to the assertion. If there was no assertion about the order of foo and bar, or if both orders were asserted (presumably because the user wanted to see all places where one of the locks was held while acquiring the other), the output indicates neither valid nor invalid.

order summary

Shows in a concise format the order in which locks are acquired. For example, the subcommand might show


:f :e :d :g :a
:f :c :g :a

In this example, there are two orders because there is not enough information to allow locks e and d to be ordered with respect to lock c.

Some cycles are shown, while others are not. For example,

:a :b :c :b

is shown, but

:a :b :c :a

(where no other lock is ever held while trying to acquire one of these) is not. Deadlock information from the analysis is still reported.