tnf_trace.h revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* 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 (c) 1994, by Sun Microsytems, Inc.
*/
#ifndef _TNF_TRACE_H
#define _TNF_TRACE_H
#pragma ident "%Z%%M% %I% %E% SMI"
#include <sys/tnf_probe.h>
#include <sys/processor.h>
#include "tnf_buf.h"
#include "tnf_types.h"
/*
* Minimum and default size of trace file
*/
/*
* Specification of index field of probe control block
*/
#define PROBE_INDEX_TYPE_MASK 0x3
#define PROBE_INDEX_LOW_MASK 0xffff0000
#define PROBE_INDEX_SHIFT 16
#define PROBE_IS_FILE_PTR(x) \
(((x) & PROBE_INDEX_TYPE_MASK) == PROBE_INDEX_FILE_PTR)
#define ATTR_SEPARATOR ';'
#define VAL_SEPARATOR ' '
/*
* Flags in proc struct
*/
#define PROC_F_FILTER 0x1
/*
* In-memory scheduling info, maintained per thread
*/
typedef struct {
/*
* Per-thread tracing operations and state
*/
struct _tnf_ops {
char mode; /* allocation mode */
};
/*
* File layout of a kernel schedule record
*/
typedef struct {
/*
* time base should be on a double word boundary to avoid pads
*/
/*
* File layout of a probe (event tag) record
*/
typedef struct {
/*
* Tag data variables
*/
extern tnf_tag_data_t *tnf_probe_type_tag_data;
/*
*
*/
extern size_t tnf_trace_file_size;
/*
* Function prototypes
*/
/* Encoder functions */
/* Trace functions */
void tnf_trace_commit(tnf_probe_setup_t *);
void tnf_trace_rollback(tnf_probe_setup_t *);
/* Trace control functions */
void tnf_trace_init(void);
void tnf_trace_on(void);
void tnf_trace_off(void);
#endif /* _TNF_TRACE_H */