/*1* CDDL HEADER START2*3* The contents of this file are subject to the terms of the4* Common Development and Distribution License (the "License").5* You may not use this file except in compliance with the License.6*7* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE8* or http://www.opensolaris.org/os/licensing.9* See the License for the specific language governing permissions10* and limitations under the License.11*12* When distributing Covered Code, include this CDDL HEADER in each13* file and include the License file at usr/src/OPENSOLARIS.LICENSE.14* If applicable, add the following below this CDDL HEADER, with the15* fields enclosed by brackets "[]" replaced with your own identifying16* information: Portions Copyright [yyyy] [name of copyright owner]17*18* CDDL HEADER END19*20* Portions Copyright 2006-2008 John Birrell [email protected]21*22*/2324/*25* Copyright 2006 Sun Microsystems, Inc. All rights reserved.26* Use is subject to license terms.27*/2829#ifndef _FBT_H_30#define _FBT_H_3132#include "fbt_isa.h"3334#define FBT_ENTRY "entry"35#define FBT_RETURN "return"3637/*38* fbt_probe is a bit of a misnomer. One of these structures is created for39* each trace point of an FBT probe. A probe might have multiple trace points40* (e.g., a function with multiple return instructions), and different probes41* might have a trace point at the same address (e.g., GNU ifuncs).42*/43typedef struct fbt_probe {44struct fbt_probe *fbtp_hashnext; /* global hash table linkage */45struct fbt_probe *fbtp_tracenext; /* next probe for tracepoint */46struct fbt_probe *fbtp_probenext; /* next tracepoint for probe */47int fbtp_enabled;48fbt_patchval_t *fbtp_patchpoint;49int8_t fbtp_rval;50fbt_patchval_t fbtp_patchval;51fbt_patchval_t fbtp_savedval;52uintptr_t fbtp_roffset;53dtrace_id_t fbtp_id;54const char *fbtp_name;55modctl_t *fbtp_ctl;56int fbtp_loadcnt;57int fbtp_symindx;58} fbt_probe_t;5960struct linker_file;61struct linker_symval;62struct trapframe;6364int fbt_invop(uintptr_t, struct trapframe *, uintptr_t);65void fbt_patch_tracepoint(fbt_probe_t *, fbt_patchval_t);66int fbt_provide_module_function(struct linker_file *, int,67struct linker_symval *, void *);68int fbt_excluded(const char *name);6970extern dtrace_provider_id_t fbt_id;71extern fbt_probe_t **fbt_probetab;72extern int fbt_probetab_mask;7374#define FBT_ADDR2NDX(addr) ((((uintptr_t)(addr)) >> 4) & fbt_probetab_mask)75#define FBT_PROBETAB_SIZE 0x8000 /* 32k entries -- 128K total */7677#ifdef MALLOC_DECLARE78MALLOC_DECLARE(M_FBT);79#endif8081#endif828384