Contenues dansTrouver plus de documentationRessources d'assistance comprises | Télécharger cet ouvrage au format PDF (2009 Ko)
Chapter 16 Options and TunablesTo allow for customization, DTrace affords its consumers several important degrees of freedom. To minimize the likelihood of requiring specific tuning, DTrace is implemented using reasonable default values and flexible default policies. However, situations may arise that require tuning the behavior of DTrace on a consumer-by-consumer basis. This chapter describes the DTrace options and tunables and the interfaces you can use to modify them. Consumer OptionsDTrace is tuned by setting or enabling options. The available options are described in the table below. For some options, dtrace(1M) provides a corresponding command-line option. Table 16–1 DTrace Consumer Options
Values that denote sizes may be given an optional suffix of k, m, g, or t to denote kilobytes, megabytes, gigabytes, and terabytes respectively. Values that denote times may be given an optional suffix of ns, us, ms, s or hz to denote nanoseconds, microseconds, milliseconds, seconds, and number-per-second, respectively. Modifying OptionsOptions may be set in a D script by using #pragma D followed by the string option and the option name. If the option takes a value, the option name should be followed by an equals sign (=) and the option value. The following examples are all valid option settings: #pragma D option nspec=4 #pragma D option grabanon #pragma D option bufsize=2g #pragma D option switchrate=10hz #pragma D option aggrate=100us #pragma D option bufresize=manual The dtrace(1M) command also accepts option settings on the command-line as an argument to the -x option. For example:
If an invalid option is specified, dtrace indicates that the option name is invalid and exits:
Similarly, if an option value is not valid for the given option, dtrace will indicate that the value is invalid:
If an option is set more than once, subsequent settings overwrite earlier settings. Some options, such as grabanon, may only be set. The presence of such an option sets it, and you cannot subsequently unset it. Options that are set for an anonymous enabling will be honored by the DTrace consumer that claims the anonymous state. See Chapter 36, Anonymous Tracing for information about enabling anonymous tracing. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||