Analyzing Program Performance With Sun WorkShop

funcs

funcs has the following syntax:

funcs [-adehou]

 

 

func ...

funcs [-adehilou]

[directly] 

 

 

funcs [-adehlou]

[directly] 

called by 

func ...

funcs [-adehlou]

[directly] 

calling 

func ...

funcs [-adehlou]

[directly] 

reading 

var ....

funcs [-adehlou]

[directly] 

writing 

var ...

funcs [-adehlou]

[directly] 

accessing 

var ...

funcs [-adehlou]

[directly] 

affecting 

lock ...

funcs [-adehlou]

[directly] 

inverting 

lock ...

funcs lists information about the functions defined and called in the loaded files. Exactly one line is printed for each function.

Table A-7 funcs Options

Option 

Definition 

 

-a 

(asserts) This option shows information about which locks are supposed to be held on entry to each function, as set by the assert subcommand. When such assertions have been made, they show as:

asserts={ lock ... }

read_asserts={ lock ... }

An asterisk appears before the name of any lock that was not consistently held upon entry (after analysis). 

-e

(effects) This option shows information about the side effects each function has on locks (for example, "acquires mutex lock foo"). If a function has such side effects, they are shown as:

side_effects={ effect [, effect] ... }

Using this option prior to analysis shows side effects asserted by an assert side effect subcommand. After analysis, information on side effects discovered during the analysis is also shown.

-d

(defined) This option shows only those functions that are defined in the loaded files. That is, that it suppresses the display of undefined functions.

-h

(held) This option shows information about which locks were consistently held when the function was called (after analysis). Locks consistently held for read (or write) on entry show as:

held={ lock ... }+{ lock ... }

read_held={ lock ... }+{ lock ... }

The first list in each set is the list of locks consistently held when the function was called; the second is a list of inconsistently held locks--locks that were sometimes held when the function was called, but not every time.

-i

(ignored) This option lists ignored functions.

-l

(long) Equivalent to -aeoh.

-o

(other) This option causes LockLint to present, where applicable, the following information about each function

=ignored

Indicates that LockLint has been told to ignore the function using the ignore subcommand.

=nonreturning

Indicates that a call through this function never returns (none of the functions targeted ever return). 

=rooted

Indicates that the function was made a root using the declare root subcommand.

=root

Indicates that the function is naturally a root (is not called by any function). 

=recursive

Indicates that the function makes a call to itself. 

=unanalyzed

Indicates that the function was never called during analysis (and is therefore unanalyzed). This differs from =root in that this can happen when foo calls bar and bar calls foo, and no other function calls either foo or bar, and neither have been rooted (see =rooted). So, because foo and bar are not roots, and they can never be reached from any root function, they have not been analyzed.

calls=#

Indicates the number of places in the source code, as represented by the loaded files, where this function is called. These calls may not actually be analyzed; for example, a disallow subcommand may prevent a call from ever really taking place.

-u

(undefined) This option shows only those functions that are undefined in the loaded files.

funcs [-adehou] func ...

Lists information about individual functions. By default, this variant of the subcommand gives all the details about the functions, as if -aeho had been specified.

funcs [-adehilou]

Lists information about all functions that are not ignored. If -i is used, even ignored functions are listed.

funcs [-adehlou] [directly] called by func ...

Lists only those functions that may be called as a result of calling the specified functions. If directly is used, only those functions called by the specified functions are listed. If directly is not used, any functions those functions called are also listed, and so on.

funcs [-adehlou] [directly] calling func ...

Lists only those functions that, when called, may result in one or more of the specified functions being called. See notes below on directly.

funcs [-adehlou] [directly] reading var ...

Lists only those functions that, when called, may result in one or more of the specified variables being read. See notes below on directly.

funcs [-adehlou] [directly] writing var ...

Lists only those functions that, when called, may result in one or more of the specified variables being written. See notes below on directly.

funcs [-adehlou] [directly] accessing var ...

Lists only those functions that, when called, may result in one or more of the specified variables being accessed (read or written). See notes below on directly.

funcs [-adehlou] [directly] affecting lock ...

Lists only those functions that, when called, may result in one or more of the specified locks being affected (acquired, released, upgraded, or downgraded). See notes below on directly.

funcs [-adehlou] [directly] inverting lock ...

Lists only those functions that invert one or more of the specified locks. (See "Lock Inversions".) If directly is used, only those functions that themselves invert one or more of the locks (actually release them) are listed. If directly is not used, any function that is called with a lock already held, and then calls another function that inverts the lock, is also listed, and so on.

For example, in the following code, f3() directly inverts lock m, and f2() indirectly inverts it:


f1() { pthread_mutex_unlock(&m); f2(); pthread_mutex_lock(&m); }
f2() { f3(); }
f3() { pthread_mutex_unlock(&m); pthread_mutex_lock(&m); } 

About directly

Except where stated otherwise, variants that allow the keyword directly only list the functions that themselves fit the description. If directly is not used, all the functions that call those functions are listed, and any functions that call those functions, and so on.