/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (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 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_IB_MGT_IBCM_IBCM_TRACE_H
#define _SYS_IB_MGT_IBCM_IBCM_TRACE_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
/*
*
* This file contains all of the internal data structures and
* definitions for IBCM Trace implementation
*/
/* Defines event qualifiers for detailed traces per RC connection. */
typedef enum ibcm_state_rc_trace_qualifier_e {
/* Initial headers */
/* List possible Incoming MADs */
/* List possible outgoing MADs */
/* List of ibmf send completions */
/* List possible timeouts. Other timeouts always re-post MADs */
/* client handler related */
/* client handler related */
/* RC QP state change related */
/* special event related */
/* End Marker */
/* Number of traces per connection chunk */
/* If the trace time diff type is changed in the future, modify below */
/*
* The following structure stores the trace data per connection, and
* defined as a field in ibcm_state_data_t.
*
* conn_trace_options:
* Stores various active trace options, like whether time stamp stored,
* detailed trace data stored, etc.,
* conn_qpn:
* QPN of channel used for connection
* conn_chan:
* Channel used for connection
* conn_base_tm:
* Base time stamp in usec, when the first trace for this connection has
* been recorded. Gethrtime is used to record the base time stamp.
* conn_trace_events:
* Trace events recorded for the connection
* conn_trace_event_times:
* Trace event times recorded for the connection
* conn_trace_ind:
* Index into trace_events, where the next trace event shall be stored
* conn_allocated_trcnt:
* Allocated number of trace entries
*/
typedef struct ibcm_conn_trace_s {
/* function that inserts a new trace into ibcm_conn_trace_t */
void ibcm_insert_trace(void *statep,
/* dumps the connection trace into ibtf_debug_buf */
void ibcm_dump_conn_trace(void *statep);
extern char ibcm_debug_buf[];
extern kmutex_t ibcm_trace_mutex;
extern kmutex_t ibcm_trace_print_mutex;
extern int ibcm_conn_max_trcnt;
/*
* ibcm_enable_trace has the following flag bits:
*
* 0 No tracing performed.
* 1 Tracing without timing.
* 2 Trace failed connections.
* 4 Trace all connections.
*/
extern int ibcm_enable_trace;
extern char *event_str[];
#ifdef __cplusplus
}
#endif
#endif /* _SYS_IB_MGT_IBCM_IBCM_TRACE_H */