JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
Solaris Dynamic Tracing Guide
search filter icon
search icon

Document Information

Preface

1.  Introduction

2.  Types, Operators, and Expressions

3.  Variables

4.  D Program Structure

5.  Pointers and Arrays

6.  Strings

7.  Structs and Unions

8.  Type and Constant Definitions

9.  Aggregations

10.  Actions and Subroutines

11.  Buffers and Buffering

12.  Output Formatting

13.  Speculative Tracing

14.  dtrace(1M) Utility

15.  Scripting

16.  Options and Tunables

17.  dtrace Provider

18.  lockstat Provider

19.  profile Provider

20.  fbt Provider

21.  syscall Provider

22.  sdt Provider

23.  sysinfo Provider

24.  vminfo Provider

25.  proc Provider

26.  sched Provider

27.  io Provider

28.  mib Provider

29.  fpuinfo Provider

30.  pid Provider

31.  plockstat Provider

32.  fasttrap Provider

33.  User Process Tracing

34.  Statically Defined Tracing for User Applications

35.  Security

36.  Anonymous Tracing

37.  Postmortem Tracing

38.  Performance Considerations

39.  Stability

40.  Translators

41.  Versioning

Versions and Releases

Versioning Options

Provider Versioning

Glossary

Index

Versioning Options

By default, any D programs you compile using dtrace -s or specify using the dtrace -P, -m, -f, -n, or -i command-line options are bound to the most recent D programming interface version offered by the D compiler. You can determine the current D programming interface version using the dtrace -V option:

$ dtrace -V
dtrace: Sun D 1.0
$

If you wish to establish a binding to a specific version of the D programming interface, you can set the version option to an appropriate version string. Similar to other DTrace options (see Chapter 16, Options and Tunables), you can set the version option either on the command-line using dtrace -x:

# dtrace -x version=1.0 -n 'BEGIN{trace("hello");}'

or you can use the #pragma D option syntax to set the option in your D program source file:

#pragma D option version=1.0

BEGIN
{
    trace("hello");
}

If you use the #pragma D option syntax to request a version binding, you must place this directive at the top of your D program file prior to any other declarations and probe clauses. If the version binding argument is not a valid version string or refers to a version not offered by the D compiler, an appropriate error message will be produced and compilation will fail. You can therefore also use the version binding facility to cause execution of a D script on an older version of DTrace to fail with an obvious error message.

Prior to compiling your program declarations and clauses, the D compiler loads the set of D types, functions, constants, and translators for the appropriate interface version into the compiler namespaces. Therefore, any version binding options you specify simply control the set of identifiers, types, and translators that are visible to your program in addition to the variables, types, and translators that your program defines. Version binding prevents the D compiler from loading newer interfaces that may define identifiers or translators that conflict with declarations in your program source code and would therefore cause a compilation error. See Identifier Names and Keywords for tips on how to pick identifier names that are unlikely to conflict with interfaces offered by future versions of DTrace.