sd_trace.h revision fcf3ce441efd61da9bb2884968af01cb7c1452cc
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SD_TRACE_H
#define _SD_TRACE_H
#ifdef __cplusplus
extern "C" {
#endif
#ifdef _SD_NOTRACE
#else
if (_sd_trace_mask & (f)) \
(nsc_size_t)(ln))
#if defined(_SD_FBA_DATA_LOG) || defined(lint)
#else
#endif /* (_SD_FBA_DATA_LOG) */
#endif
#define SDT_INV_CD -1
#define SDT_ANY_CD -2
#define SDT_INV_BL 0xffffffff
typedef struct _sdtr
{
int t_flg; /* buffer size requested */
int t_ret; /* return value */
int t_time; /* micro_second timer, or lbolt */
/* low order only on LP64 systems */
} _sdtr_t;
typedef struct _sdtr_table
{
int tt_cd; /* cache device */
int tt_max; /* entries in table */
int tt_in; /* entries added */
int tt_out; /* entries read */
int tt_cnt; /* unread entries */
int tt_cntout; /* tt_cnt after dump */
int tt_mask; /* copy of _sd_trace_mask */
int tt_lost; /* lost after alert */
char tt_alert; /* alert signaled */
char tt_lbolt; /* use 'lbolt' instead of microsec */
char tt_good; /* use locking (races with end-action) */
char tt_type; /* memory region 0 or 1 (_SD_MEM_TRACE) */
#if defined(_KERNEL)
typedef struct _sdbc_trace_s {
#endif /* _KERNEL */
/* sd_adump() flags */
#define SD_SET_MASK 0x02
#define SD_SET_LBOLT 0x04
#define SD_SET_GOOD 0x08
/* Trace function, category, mask bits */
/*
* dump file pseudo-entries
*/
/*
* ST_BCACHE functions
*/
/*
* ST_BSUB - bcache subroutines
*/
/*
* SD_IO - I/O subsustem
*/
/*
* ST_FT - Fault-tolerant subsystem
*/
/*
* ST_STATS - Statistics points
*/
/*
* ST_INFO
*/
/*
* ST_DL
*/
/*
* More entry points
*/
#ifdef _SD_FNAME
/*
* function category names
* change these when changing functions above
* compress name to fit in 8 printable characters
*/
char *_bcache_fname[16] =
{
"open",
"close",
"al_hndl",
"fr_hndl",
"al_buf",
"fr_buf",
"write",
"read",
"ucommit",
"zero",
"hint",
"attach",
"detach",
"notify",
};
char *_bsub_fname[16] =
{
"get_cent",
"al_cent",
"read_ea",
"fr_cent",
"al_went",
"fr_went",
"al_wone",
};
char *_io_fname[16] =
{
"flclist",
"flcent",
"eaclist",
"eacent",
"fldone",
"get_iob",
};
char *_ccio_fname[16] =
{
"ccio",
"dc_albuf",
"dc_frbuf",
"dc_write",
"dc_read",
"dc_zero",
};
char *_ft_fname[16] =
{
"wait_rec",
"cache_rc",
"ft_clone",
"reflect",
"online",
};
char *_stats_fname[16] =
{
"LRU-repl",
"Disconn",
};
char *_info_fname[16] =
{
"Cover",
};
char *_dlog_fname[16] =
{
"alloc",
"rd",
"wr",
"wrsync",
"flshlist",
"flshent",
"rdio",
"flea",
"flstea",
"wrsyea",
};
#endif /* _ST_NAMES */
#ifdef _KERNEL
extern int _sd_trace_mask;
extern void _sdbc_tr_unload(void);
extern int _sdbc_tr_load(void);
extern int _sdbc_tr_configure(int cd);
extern void _sdbc_tr_deconfigure(void);
int ret);
#endif /* _KERNEL */
#ifdef __cplusplus
}
#endif
#endif /* _SD_TRACE_H */