fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * CDDL HEADER START
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * The contents of this file are subject to the terms of the
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * Common Development and Distribution License (the "License").
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * You may not use this file except in compliance with the License.
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * See the License for the specific language governing permissions
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * and limitations under the License.
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * When distributing Covered Code, include this CDDL HEADER in each
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * If applicable, add the following below this CDDL HEADER, with the
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * fields enclosed by brackets "[]" replaced with your own identifying
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * information: Portions Copyright [yyyy] [name of copyright owner]
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * CDDL HEADER END
91cfa10a8e55050a5103c4b2e83b0bf8d783a7cbtomee * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * Use is subject to license terms.
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * ident "%Z%%M% %I% %E% SMI"
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * An error encountered in the native DTrace library while tracing probe
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * data. Each of the fault name constants beginning with {@code
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * DTRACEFLT_} identifies a specific fault with a name that is
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * guaranteed not to change across API versions.
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * Immutable. Supports persistence using {@link java.beans.XMLEncoder}.
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * @see ConsumerListener#errorEncountered(ErrorEvent e)
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * @author Tom Erickson
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee static final long serialVersionUID = 5069931629562700614L;
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * Invalid address.
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee public static final String DTRACEFLT_BADADDR = "DTRACEFLT_BADADDR";
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * Invalid alignment.
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee public static final String DTRACEFLT_BADALIGN = "DTRACEFLT_BADALIGN";
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * Illegal operation.
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee public static final String DTRACEFLT_ILLOP = "DTRACEFLT_ILLOP";
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * Divide-by-zero.
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee public static final String DTRACEFLT_DIVZERO = "DTRACEFLT_DIVZERO";
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * Out of scratch space.
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee public static final String DTRACEFLT_NOSCRATCH = "DTRACEFLT_NOSCRATCH";
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * Invalid kernel access.
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee public static final String DTRACEFLT_KPRIV = "DTRACEFLT_KPRIV";
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * Invalid user access.
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee public static final String DTRACEFLT_UPRIV = "DTRACEFLT_UPRIV";
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * Tuple stack overflow.
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee public static final String DTRACEFLT_TUPOFLOW = "DTRACEFLT_TUPOFLOW";
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * Library-level fault.
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee public static final String DTRACEFLT_LIBRARY = "DTRACEFLT_LIBRARY";
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee BeanInfo info = Introspector.getBeanInfo(Error.class);
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee d.setValue("persistenceDelegate", persistenceDelegate);
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee /** @serial */
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee /** @serial */
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee /** @serial */
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee /** @serial */
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee /** @serial */
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee /** @serial */
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee /** @serial */
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee /** @serial */
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * Creates a DTrace error with the given properties. Supports XML
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * persistence.
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * @param pdesc probe description that identifies the error-inducing
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * probe among all the probes on the system
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * @param enabledProbeID identifies the error-inducing probe among
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * all probes enabled by the same {@link Consumer}
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * @param errorCPU non-negative ID of the CPU where the error was
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * encountered, or a negative number if the CPU is unknown
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * @param errorAction integer that identifies the error-inducing
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * action as the nth action (starting at one) in the error-inducing
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * probe, or zero if the error is in the predicate rather than in an
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * @param errorOffset error offset in compiled DTrace Intermediate
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * Format (DIF), or a negative number if the offset is not available
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * @param faultName name of the specific fault, or {@code null}
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * if the fault is unknown to the Java DTrace API
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * @param faultAddress address of fault, or -1 if address is not
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * applicable to the specific fault
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * @param errorMessage default message from the native DTrace
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * library preconstructed from the properties of this error
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * @throws NullPointerException if the given probe description or
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * default message is {@code null}
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee Error(ProbeDescription pdesc, int enabledProbeID, int errorCPU,
91cfa10a8e55050a5103c4b2e83b0bf8d783a7cbtomee private final void
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee "enabled probe description is null");
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee throw new NullPointerException("default message is null");
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * Gets the probe description that identifies the error-inducing
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * probe among all the probes on the system.
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * @return non-null probe description
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * Gets the enabled probe ID. The "epid" is different from {@link
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * ProbeDescription#getID()} because it identifies a probe among all
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * the probes enabled by a {@link Consumer}, rather than among all
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * the probes on the system.
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * @return the enabled probe ID
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * Gets the CPU that encountered the error.
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * @return non-negative CPU ID, or a negative number if the CPU is
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * Gets the error-inducing action as the <i>nth</i> action (starting
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * at one) in the error-inducing probe, or zero if the error is in
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * the predicate rather than in an action. Note that some actions
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * in a D program consist of multiple actions internally within the
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * DTrace library.
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * @return zero if the error is in the probe predicate, otherwise
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * the <i>nth</i> action (<i>n</i> starting at one) from the start
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * of the probe that induced the error
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * Gets the error offset in compiled DTrace Intermediate Format
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * (DIF), or a negative number if the offset is not available.
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * @return the error offset in compiled DTrace Intermediate Format
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * (DIF), or a negative number if the offset is not available
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * Gets the name identifying the specific fault. The names are
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * guaranteed not to change across API versions as long as the fault
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * cases they identify still exist.
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * @return name of the specific fault or {@code null} if the
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * fault is unknown to the Java DTrace API
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * Gets the address of the fault, if any.
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * @return address of fault, or -1 if address is not applicable to
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * the specific fault (the fault is not one of {@link
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * #DTRACEFLT_BADADDR} or {@link #DTRACEFLT_BADALIGN})
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee public long
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * Gets the default message from the native DTrace library
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * preconstructed from the properties of this error.
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * @return non-null preconstructed message
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee private void
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee // check class invariants
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee } catch (Exception e) {
4ae67516a1d5dc4a5dbc761762bad5b596647388tomee InvalidObjectException x = new InvalidObjectException(
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * Gets a string representation of this error useful for logging and
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * not intended for display. The exact details of the
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * representation are unspecified and subject to change, but the
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * following format may be regarded as typical:
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * <pre><code>
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * class-name[property1 = value1, property2 = value2]
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * </code></pre>