rf_acctrace.h revision 1.1 1 1.1 oster /* $NetBSD: rf_acctrace.h,v 1.1 1998/11/13 04:20:26 oster Exp $ */
2 1.1 oster /*
3 1.1 oster * Copyright (c) 1995 Carnegie-Mellon University.
4 1.1 oster * All rights reserved.
5 1.1 oster *
6 1.1 oster * Author: Mark Holland
7 1.1 oster *
8 1.1 oster * Permission to use, copy, modify and distribute this software and
9 1.1 oster * its documentation is hereby granted, provided that both the copyright
10 1.1 oster * notice and this permission notice appear in all copies of the
11 1.1 oster * software, derivative works or modified versions, and any portions
12 1.1 oster * thereof, and that both notices appear in supporting documentation.
13 1.1 oster *
14 1.1 oster * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
15 1.1 oster * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
16 1.1 oster * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
17 1.1 oster *
18 1.1 oster * Carnegie Mellon requests users of this software to return to
19 1.1 oster *
20 1.1 oster * Software Distribution Coordinator or Software.Distribution (at) CS.CMU.EDU
21 1.1 oster * School of Computer Science
22 1.1 oster * Carnegie Mellon University
23 1.1 oster * Pittsburgh PA 15213-3890
24 1.1 oster *
25 1.1 oster * any improvements or extensions that they make and grant Carnegie the
26 1.1 oster * rights to redistribute these changes.
27 1.1 oster */
28 1.1 oster
29 1.1 oster /*****************************************************************************
30 1.1 oster *
31 1.1 oster * acctrace.h -- header file for acctrace.c
32 1.1 oster *
33 1.1 oster *****************************************************************************/
34 1.1 oster
35 1.1 oster /* :
36 1.1 oster *
37 1.1 oster * Log: rf_acctrace.h,v
38 1.1 oster * Revision 1.32 1996/08/02 15:12:38 jimz
39 1.1 oster * remove dead code
40 1.1 oster *
41 1.1 oster * Revision 1.31 1996/07/27 14:34:39 jimz
42 1.1 oster * remove bogus semicolon
43 1.1 oster *
44 1.1 oster * Revision 1.30 1996/07/18 22:57:14 jimz
45 1.1 oster * port simulator to AIX
46 1.1 oster *
47 1.1 oster * Revision 1.29 1996/07/17 21:00:58 jimz
48 1.1 oster * clean up timer interface, tracing
49 1.1 oster *
50 1.1 oster * Revision 1.28 1996/06/10 11:55:47 jimz
51 1.1 oster * Straightened out some per-array/not-per-array distinctions, fixed
52 1.1 oster * a couple bugs related to confusion. Added shutdown lists. Removed
53 1.1 oster * layout shutdown function (now subsumed by shutdown lists).
54 1.1 oster *
55 1.1 oster * Revision 1.27 1996/06/09 02:36:46 jimz
56 1.1 oster * lots of little crufty cleanup- fixup whitespace
57 1.1 oster * issues, comment #ifdefs, improve typing in some
58 1.1 oster * places (esp size-related)
59 1.1 oster * /
60 1.1 oster *
61 1.1 oster * Revision 1.26 1996/06/05 18:06:02 jimz
62 1.1 oster * Major code cleanup. The Great Renaming is now done.
63 1.1 oster * Better modularity. Better typing. Fixed a bunch of
64 1.1 oster * synchronization bugs. Made a lot of global stuff
65 1.1 oster * per-desc or per-array. Removed dead code.
66 1.1 oster *
67 1.1 oster * Revision 1.25 1996/05/31 22:26:54 jimz
68 1.1 oster * fix a lot of mapping problems, memory allocation problems
69 1.1 oster * found some weird lock issues, fixed 'em
70 1.1 oster * more code cleanup
71 1.1 oster *
72 1.1 oster * Revision 1.24 1996/05/30 12:59:18 jimz
73 1.1 oster * make etimer happier, more portable
74 1.1 oster *
75 1.1 oster * Revision 1.23 1996/05/28 12:34:30 jimz
76 1.1 oster * nail down size of reconacc
77 1.1 oster *
78 1.1 oster * Revision 1.22 1996/05/23 00:33:23 jimz
79 1.1 oster * code cleanup: move all debug decls to rf_options.c, all extern
80 1.1 oster * debug decls to rf_options.h, all debug vars preceded by rf_
81 1.1 oster *
82 1.1 oster * Revision 1.21 1996/05/18 19:51:34 jimz
83 1.1 oster * major code cleanup- fix syntax, make some types consistent,
84 1.1 oster * add prototypes, clean out dead code, et cetera
85 1.1 oster *
86 1.1 oster * Revision 1.20 1996/05/02 14:57:24 jimz
87 1.1 oster * change to boolean_t
88 1.1 oster *
89 1.1 oster * Revision 1.19 1995/12/14 18:37:06 jimz
90 1.1 oster * convert to rf_types.h types
91 1.1 oster *
92 1.1 oster * Revision 1.18 1995/11/30 16:26:49 wvcii
93 1.1 oster * added copyright info
94 1.1 oster *
95 1.1 oster * Revision 1.17 1995/09/30 19:49:23 jimz
96 1.1 oster * add AccTotals structure, for capturing totals in kernel
97 1.1 oster *
98 1.1 oster * Revision 1.16 1995/09/12 00:20:55 wvcii
99 1.1 oster * added support for tracing disk queue time
100 1.1 oster *
101 1.1 oster * Revision 1.15 95/09/06 19:23:12 wvcii
102 1.1 oster * increased MAX_IOS_PER_TRACE_ENTRY from 1 to 4
103 1.1 oster *
104 1.1 oster */
105 1.1 oster
106 1.1 oster #ifndef _RF__RF_ACCTRACE_H_
107 1.1 oster #define _RF__RF_ACCTRACE_H_
108 1.1 oster
109 1.1 oster #include "rf_types.h"
110 1.1 oster #include "rf_hist.h"
111 1.1 oster #include "rf_etimer.h"
112 1.1 oster
113 1.1 oster typedef struct RF_user_acc_stats_s {
114 1.1 oster RF_uint64 suspend_ovhd_us; /* us spent mucking in the access-suspension code */
115 1.1 oster RF_uint64 map_us; /* us spent mapping the access */
116 1.1 oster RF_uint64 lock_us; /* us spent locking & unlocking stripes, including time spent blocked */
117 1.1 oster RF_uint64 dag_create_us; /* us spent creating the DAGs */
118 1.1 oster RF_uint64 dag_retry_us; /* _total_ us spent retrying the op -- not broken down into components */
119 1.1 oster RF_uint64 exec_us; /* us spent in DispatchDAG */
120 1.1 oster RF_uint64 exec_engine_us; /* us spent in engine, not including blocking time */
121 1.1 oster RF_uint64 cleanup_us; /* us spent tearing down the dag & maps, and generally cleaning up */
122 1.1 oster } RF_user_acc_stats_t;
123 1.1 oster
124 1.1 oster typedef struct RF_recon_acc_stats_s {
125 1.1 oster RF_uint32 recon_start_to_fetch_us;
126 1.1 oster RF_uint32 recon_fetch_to_return_us;
127 1.1 oster RF_uint32 recon_return_to_submit_us;
128 1.1 oster } RF_recon_acc_stats_t;
129 1.1 oster
130 1.1 oster typedef struct RF_acctrace_entry_s {
131 1.1 oster union {
132 1.1 oster RF_user_acc_stats_t user;
133 1.1 oster RF_recon_acc_stats_t recon;
134 1.1 oster } specific;
135 1.1 oster RF_uint8 reconacc; /* whether this is a tracerec for a user acc or a recon acc */
136 1.1 oster RF_uint64 xor_us; /* us spent doing XORs */
137 1.1 oster RF_uint64 q_us; /* us spent doing XORs */
138 1.1 oster RF_uint64 plog_us; /* us spent waiting to stuff parity into log */
139 1.1 oster RF_uint64 diskqueue_us; /* _total_ us spent in disk queue(s), incl concurrent ops */
140 1.1 oster RF_uint64 diskwait_us; /* _total_ us spent waiting actually waiting on the disk, incl concurrent ops */
141 1.1 oster RF_uint64 total_us; /* total us spent on this access */
142 1.1 oster RF_uint64 num_phys_ios; /* number of physical I/Os invoked */
143 1.1 oster RF_uint64 phys_io_us; /* time of physical I/O */
144 1.1 oster RF_Etimer_t tot_timer; /* a timer used to compute total access time */
145 1.1 oster RF_Etimer_t timer; /* a generic timer val for timing events that live across procedure boundaries */
146 1.1 oster RF_Etimer_t recon_timer; /* generic timer for recon stuff */
147 1.1 oster RF_uint64 index;
148 1.1 oster } RF_AccTraceEntry_t;
149 1.1 oster
150 1.1 oster typedef struct RF_AccTotals_s {
151 1.1 oster /* user acc stats */
152 1.1 oster RF_uint64 suspend_ovhd_us;
153 1.1 oster RF_uint64 map_us;
154 1.1 oster RF_uint64 lock_us;
155 1.1 oster RF_uint64 dag_create_us;
156 1.1 oster RF_uint64 dag_retry_us;
157 1.1 oster RF_uint64 exec_us;
158 1.1 oster RF_uint64 exec_engine_us;
159 1.1 oster RF_uint64 cleanup_us;
160 1.1 oster RF_uint64 user_reccount;
161 1.1 oster /* recon acc stats */
162 1.1 oster RF_uint64 recon_start_to_fetch_us;
163 1.1 oster RF_uint64 recon_fetch_to_return_us;
164 1.1 oster RF_uint64 recon_return_to_submit_us;
165 1.1 oster RF_uint64 recon_io_overflow_count;
166 1.1 oster RF_uint64 recon_phys_io_us;
167 1.1 oster RF_uint64 recon_num_phys_ios;
168 1.1 oster RF_uint64 recon_diskwait_us;
169 1.1 oster RF_uint64 recon_reccount;
170 1.1 oster /* trace entry stats */
171 1.1 oster RF_uint64 xor_us;
172 1.1 oster RF_uint64 q_us;
173 1.1 oster RF_uint64 plog_us;
174 1.1 oster RF_uint64 diskqueue_us;
175 1.1 oster RF_uint64 diskwait_us;
176 1.1 oster RF_uint64 total_us;
177 1.1 oster RF_uint64 num_log_ents;
178 1.1 oster RF_uint64 phys_io_overflow_count;
179 1.1 oster RF_uint64 num_phys_ios;
180 1.1 oster RF_uint64 phys_io_us;
181 1.1 oster RF_uint64 bigvals;
182 1.1 oster /* histograms */
183 1.1 oster RF_Hist_t dw_hist[RF_HIST_NUM_BUCKETS];
184 1.1 oster RF_Hist_t tot_hist[RF_HIST_NUM_BUCKETS];
185 1.1 oster } RF_AccTotals_t;
186 1.1 oster
187 1.1 oster #if RF_UTILITY == 0
188 1.1 oster RF_DECLARE_EXTERN_MUTEX(rf_tracing_mutex)
189 1.1 oster #endif /* RF_UTILITY == 0 */
190 1.1 oster
191 1.1 oster int rf_ConfigureAccessTrace(RF_ShutdownList_t **listp);
192 1.1 oster void rf_LogTraceRec(RF_Raid_t *raid, RF_AccTraceEntry_t *rec);
193 1.1 oster void rf_FlushAccessTraceBuf(void);
194 1.1 oster
195 1.1 oster #endif /* !_RF__RF_ACCTRACE_H_ */
196