docs/how-to-build.md: use proper markup for directory names
[unleashed/tickless.git] / include / sys / tnf.h
blob9061ed1faecee614cdbcea92a7f5b36ba2f87354
1 /*
2 * CDDL HEADER START
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
7 * with the License.
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
20 * CDDL HEADER END
23 * Copyright (c) 1994, by Sun Microsytems, Inc.
24 * All rights reserved.
27 #ifndef _SYS_TNF_H
28 #define _SYS_TNF_H
30 #pragma ident "%Z%%M% %I% %E% SMI"
32 #ifndef NPROBE
34 #include <sys/types.h>
35 #include <sys/thread.h>
36 #include <sys/proc.h>
37 #include <sys/cpuvar.h>
39 #ifdef __cplusplus
40 extern "C" {
41 #endif
47 typedef struct {
48 ulong_t probenum;
49 int enabled;
50 int traced;
51 int attrsize;
52 } tnf_probevals_t;
58 typedef struct {
59 enum {
60 TIFIOCBUF_NONE,
61 TIFIOCBUF_UNINIT,
62 TIFIOCBUF_OK,
63 TIFIOCBUF_BROKEN
64 } buffer_state;
65 int buffer_size;
66 int trace_stopped;
67 int pidfilter_mode;
68 int pidfilter_size;
69 } tifiocstate_t;
71 typedef struct {
72 char *dst_addr;
73 int block_num;
74 } tifiocgblock_t;
76 typedef struct {
77 long *dst_addr;
78 int start;
79 int slots;
80 } tifiocgfw_t;
83 * ioctl codes
86 #define TIFIOCGMAXPROBE (('t' << 8) | 1) /* get max probe number */
87 #define TIFIOCGPROBEVALS (('t' << 8) | 2) /* get probe info */
88 #define TIFIOCGPROBESTRING (('t' << 8) | 3) /* get probe string */
89 #define TIFIOCSPROBEVALS (('t' << 8) | 4) /* set probe info */
90 #define TIFIOCGSTATE (('t' << 8) | 5) /* get tracing system state */
91 #define TIFIOCALLOCBUF (('t' << 8) | 6) /* allocate trace buffer */
92 #define TIFIOCDEALLOCBUF (('t' << 8) | 7) /* dealloc trace buffer */
93 #define TIFIOCSTRACING (('t' << 8) | 8) /* set ktrace mode */
94 #define TIFIOCSPIDFILTER (('t' << 8) | 9) /* set pidfilter mode */
95 #define TIFIOCGPIDSTATE (('t' << 8) | 10) /* check pid filter member */
96 #define TIFIOCSPIDON (('t' << 8) | 11) /* add pid to filter */
97 #define TIFIOCSPIDOFF (('t' << 8) | 12) /* drop pid from filter */
98 #define TIFIOCPIDFILTERGET (('t' << 8) | 13) /* return pid filter set */
99 #define TIFIOCGHEADER (('t' << 8) | 14) /* copy out tnf header blk */
100 #define TIFIOCGBLOCK (('t' << 8) | 15) /* copy out tnf block */
101 #define TIFIOCGFWZONE (('t' << 8) | 16) /* copy out forwarding ptrs */
103 #ifdef _KERNEL
105 extern volatile int tnf_tracing_active;
107 extern void tnf_thread_create(kthread_t *);
108 extern void tnf_thread_queue(kthread_t *, cpu_t *, pri_t);
109 extern void tnf_thread_switch(kthread_t *);
110 extern void tnf_thread_exit(void);
111 extern void tnf_thread_free(kthread_t *);
113 #endif /* _KERNEL */
115 #ifdef __cplusplus
117 #endif
119 #endif /* NPROBE */
121 #endif /* _SYS_TNF_H */