Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/src/share/classes/com/sun/tracing/dtrace/package-info.java
38923 views
/*1* Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425/**26* This package contains annotations and enumerations that are used to27* add DTrace-specific information to a tracing provider.28* <p>29* The DTrace-specific annotations modify the attributes of a DTrace provider30* implementation when it is used by the tracing subsystem. The annotations are31* added to a {@code com.sun.tracing} provider specification to control32* specific attributes of the provider as it relates to DTrace.33* <p>34* Any other tracing subsystems supported by the system will ignore these35* annotations.36* <p>37* DTrace probes have additional fields and stability attributes that are38* not accounted for in the generic tracing package. If unspecified, the39* default values are used for the stability and dependency attributes of40* probes, as well as for the module and field names of the generated probes.41* The values can be specified by adding the appropriate annotations to the42* provider specification.43* <p>44* The {@code FunctionName} annotation is used to annotate the tracepoint45* methods defined in the provider specification. The value of this annotation46* is used as the {@code function} field in the generated DTrace probes. It47* is typically set to the name of the enclosing function where the48* tracepoint is triggered.49* <p>50* The {@code ModuleName} annotation is used to annotate the provider51* specification itself and applies to all the probes in the provider. It52* sets the value of the {@code module} field in the generated DTrace probes.53* <p>54* The remaining annotations, are also applied to the provider itself, and55* are used to set the stability and dependency attributes of all probes in56* that provider. Each probe field and the probe arguments can be57* independently assigned interface attributes to control the stability58* ratings of the probes.59* <p>60* Here is an example of how to declare a provider, specifying additional DTrace61* data:62<PRE>63@ProviderName("my_app_provider")64@ModuleName("app.jar")65@ProviderAttributes(@Attributes={66name=StabilityLevel.STABLE,data=StabilityLevel.STABLE,67dependency=DependencyClass.COMMON})68@ProbeAttributes(@Attributes={69name=StabilityLevel.STABLE,data=StabilityLevel.STABLE,70dependency=DependencyClass.COMMON})71@ModuleAttributes(@Attributes={name=StabilityLevel.UNSTABLE})72public class MyProvider {73@FunctionName("main") void startProbe();74}75</PRE>76* <p>77* @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>78* @see <a href="http://docs.sun.com/app/docs/doc/817-6223/6mlkidlnp?a=view">Solaris Dynamic Tracing Guide, Chapter 39: Stability</a>79*/8081package com.sun.tracing.dtrace;828384