/*
* 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 2003 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _TDB_AGENT_H
#define _TDB_AGENT_H
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* Thread debug agent control structures.
*
* This is an implementation-specific header file that is shared
* between libc and libc_db. It is NOT a public header file
*/
#include <thread_db.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* The structure containing per-thread event data.
*/
typedef struct {
} td_evbuf_t;
#ifdef _SYSCALL32
typedef struct {
} td_evbuf32_t;
#endif /* _SYSCALL32 */
/*
* All of these structures are constrained to have a size of 48 bytes.
* This is so that two 8-byte pointers can be inserted at the front to
* make up a complete tdb_sync_stats_t structure of exactly 64 bytes.
* The 'type' element of each structure identifies the type of the union,
* with values from the following defines.
*/
#define TDB_NONE 0
typedef struct {
typedef struct {
typedef struct {
/* rw_rdlock_sleep is the reader cv's cond_wait count */
/* rw_rdlock_sleep_time is the reader cv's cond_wait_sleep_time */
/* rw_wrlock_sleep is the writer cv's cond_wait count */
/* rw_wrlock_sleep_time is the writer cv's cond_wait_sleep_time */
typedef struct {
/*
* An entry in the sync. object hash table.
*/
typedef struct {
union {
} un;
/* peg count values at UINT_MAX */
/*
* The tdb_register_sync variable is set to REGISTER_SYNC_ENABLE by a
* debugger to enable synchronization object registration.
* Thereafter, synchronization primitives call tdb_sync_obj_register()
* to put their synchronization objects in the registration hash table.
* In this state, the first call to tdb_sync_obj_register() empties the
* hash table and sets tdb_register_sync to REGISTER_SYNC_ON.
*
* The tdb_register_sync variable is set to REGISTER_SYNC_DISABLE by a
* debugger to disable synchronization object registration.
* In this state, the first call to tdb_sync_obj_register() empties the
* hash table and sets tdb_register_sync to REGISTER_SYNC_OFF.
* Thereafter, synchronization primitives do not call tdb_sync_obj_register().
*
* Sync object *_destroy() functions always call tdb_sync_obj_deregister().
*/
extern tdb_sync_stats_t *tdb_sync_obj_register(void *, int *);
extern void tdb_sync_obj_deregister(void *);
/*
* Definitions for acquiring pointers to synch object statistics blocks
* contained in the synchronization object registration hash table.
*/
/*
* Parameters of the synchronization object registration hash table.
*/
/*
* uberdata.tdb_hash_lock protects all synchronization object
* hash table data structures.
* uberdata.tdb_hash_lock_stats is a special tdb_sync_stats structure
* reserved for tdb_hash_lock.
*/
typedef void (*tdb_ev_func_t)(void);
/*
* Uberdata for thread debug interfaces (known to libc_db).
*/
typedef struct {
/*
* Pointer to the hash table of sync_addr_t descriptors.
* This holds the addresses of all of the synchronization variables
* that the library has seen since tracking was enabled by a debugger.
*/
/*
* The number of entries in the hash table.
*/
/*
* The free list of sync_addr_t descriptors.
* When the free list is used up, it is replenished using mmap().
* sync_addr_t descriptors are never freed, though they may be
* removed from the hash table and returned to the free list.
*/
/*
* The set of globally enabled events to report to libc_db.
*/
/*
* The array of event function pointers.
*/
} tdb_t;
#ifdef _SYSCALL32
typedef struct {
} tdb32_t;
#endif /* _SYSCALL32 */
/*
* This will have to change if event numbers exceed 31.
* Note that we only test tdb_ev_global_mask.event_bits[0] below.
*/
(((ulwp)->ul_td_events_enable && \
/*
* Event "reporting" functions. A thread reports an event by calling
* one of these empty functions; a debugger can set a breakpoint
* at the address of any of these functions to determine that an
* event is being reported.
*/
#ifdef __cplusplus
}
#endif
#endif /* _TDB_AGENT_H */