1 /* |
|
2 * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. |
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
|
4 * |
|
5 * This code is free software; you can redistribute it and/or modify it |
|
6 * under the terms of the GNU General Public License version 2 only, as |
|
7 * published by the Free Software Foundation. Oracle designates this |
|
8 * particular file as subject to the "Classpath" exception as provided |
|
9 * by Oracle in the LICENSE file that accompanied this code. |
|
10 * |
|
11 * This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 * version 2 for more details (a copy is included in the LICENSE file that |
|
15 * accompanied this code). |
|
16 * |
|
17 * You should have received a copy of the GNU General Public License version |
|
18 * 2 along with this work; if not, write to the Free Software Foundation, |
|
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 * |
|
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
|
22 * or visit www.oracle.com if you need additional information or have any |
|
23 * questions. |
|
24 */ |
|
25 |
|
26 /** |
|
27 * This package contains annotations and enumerations that are used to |
|
28 * add DTrace-specific information to a tracing provider. |
|
29 * <p> |
|
30 * The DTrace-specific annotations modify the attributes of a DTrace provider |
|
31 * implementation when it is used by the tracing subsystem. The annotations are |
|
32 * added to a {@code com.sun.tracing} provider specification to control |
|
33 * specific attributes of the provider as it relates to DTrace. |
|
34 * <p> |
|
35 * Any other tracing subsystems supported by the system will ignore these |
|
36 * annotations. |
|
37 * <p> |
|
38 * DTrace probes have additional fields and stability attributes that are |
|
39 * not accounted for in the generic tracing package. If unspecified, the |
|
40 * default values are used for the stability and dependency attributes of |
|
41 * probes, as well as for the module and field names of the generated probes. |
|
42 * The values can be specified by adding the appropriate annotations to the |
|
43 * provider specification. |
|
44 * <p> |
|
45 * The {@code FunctionName} annotation is used to annotate the tracepoint |
|
46 * methods defined in the provider specification. The value of this annotation |
|
47 * is used as the {@code function} field in the generated DTrace probes. It |
|
48 * is typically set to the name of the enclosing function where the |
|
49 * tracepoint is triggered. |
|
50 * <p> |
|
51 * The {@code ModuleName} annotation is used to annotate the provider |
|
52 * specification itself and applies to all the probes in the provider. It |
|
53 * sets the value of the {@code module} field in the generated DTrace probes. |
|
54 * <p> |
|
55 * The remaining annotations, are also applied to the provider itself, and |
|
56 * are used to set the stability and dependency attributes of all probes in |
|
57 * that provider. Each probe field and the probe arguments can be |
|
58 * independently assigned interface attributes to control the stability |
|
59 * ratings of the probes. |
|
60 * <p> |
|
61 * Here is an example of how to declare a provider, specifying additional DTrace |
|
62 * data: |
|
63 <PRE> |
|
64 @ProviderName("my_app_provider") |
|
65 @ModuleName("app.jar") |
|
66 @ProviderAttributes(@Attributes={ |
|
67 name=StabilityLevel.STABLE,data=StabilityLevel.STABLE, |
|
68 dependency=DependencyClass.COMMON}) |
|
69 @ProbeAttributes(@Attributes={ |
|
70 name=StabilityLevel.STABLE,data=StabilityLevel.STABLE, |
|
71 dependency=DependencyClass.COMMON}) |
|
72 @ModuleAttributes(@Attributes={name=StabilityLevel.UNSTABLE}) |
|
73 public class MyProvider { |
|
74 @FunctionName("main") void startProbe(); |
|
75 } |
|
76 </PRE> |
|
77 * <p> |
|
78 * @see <a href="http://docs.sun.com/app/docs/doc/817-6223/6mlkidlms?a=view">Solaris Dynamic Tracing Guide, Chapter 34: Statically Defined Tracing for User Applications</a> |
|
79 * @see <a href="http://docs.sun.com/app/docs/doc/817-6223/6mlkidlnp?a=view">Solaris Dynamic Tracing Guide, Chapter 39: Stability</a> |
|
80 */ |
|
81 |
|
82 package com.sun.tracing.dtrace; |
|