rf_acctrace.h revision 1.2 1 /* $NetBSD: rf_acctrace.h,v 1.2 1999/01/26 02:33:49 oster Exp $ */
2 /*
3 * Copyright (c) 1995 Carnegie-Mellon University.
4 * All rights reserved.
5 *
6 * Author: Mark Holland
7 *
8 * Permission to use, copy, modify and distribute this software and
9 * its documentation is hereby granted, provided that both the copyright
10 * notice and this permission notice appear in all copies of the
11 * software, derivative works or modified versions, and any portions
12 * thereof, and that both notices appear in supporting documentation.
13 *
14 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
15 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
16 * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
17 *
18 * Carnegie Mellon requests users of this software to return to
19 *
20 * Software Distribution Coordinator or Software.Distribution (at) CS.CMU.EDU
21 * School of Computer Science
22 * Carnegie Mellon University
23 * Pittsburgh PA 15213-3890
24 *
25 * any improvements or extensions that they make and grant Carnegie the
26 * rights to redistribute these changes.
27 */
28
29 /*****************************************************************************
30 *
31 * acctrace.h -- header file for acctrace.c
32 *
33 *****************************************************************************/
34
35
36 #ifndef _RF__RF_ACCTRACE_H_
37 #define _RF__RF_ACCTRACE_H_
38
39 #include "rf_types.h"
40 #include "rf_hist.h"
41 #include "rf_etimer.h"
42
43 typedef struct RF_user_acc_stats_s {
44 RF_uint64 suspend_ovhd_us; /* us spent mucking in the access-suspension code */
45 RF_uint64 map_us; /* us spent mapping the access */
46 RF_uint64 lock_us; /* us spent locking & unlocking stripes, including time spent blocked */
47 RF_uint64 dag_create_us; /* us spent creating the DAGs */
48 RF_uint64 dag_retry_us; /* _total_ us spent retrying the op -- not broken down into components */
49 RF_uint64 exec_us; /* us spent in DispatchDAG */
50 RF_uint64 exec_engine_us; /* us spent in engine, not including blocking time */
51 RF_uint64 cleanup_us; /* us spent tearing down the dag & maps, and generally cleaning up */
52 } RF_user_acc_stats_t;
53
54 typedef struct RF_recon_acc_stats_s {
55 RF_uint32 recon_start_to_fetch_us;
56 RF_uint32 recon_fetch_to_return_us;
57 RF_uint32 recon_return_to_submit_us;
58 } RF_recon_acc_stats_t;
59
60 typedef struct RF_acctrace_entry_s {
61 union {
62 RF_user_acc_stats_t user;
63 RF_recon_acc_stats_t recon;
64 } specific;
65 RF_uint8 reconacc; /* whether this is a tracerec for a user acc or a recon acc */
66 RF_uint64 xor_us; /* us spent doing XORs */
67 RF_uint64 q_us; /* us spent doing XORs */
68 RF_uint64 plog_us; /* us spent waiting to stuff parity into log */
69 RF_uint64 diskqueue_us; /* _total_ us spent in disk queue(s), incl concurrent ops */
70 RF_uint64 diskwait_us; /* _total_ us spent waiting actually waiting on the disk, incl concurrent ops */
71 RF_uint64 total_us; /* total us spent on this access */
72 RF_uint64 num_phys_ios; /* number of physical I/Os invoked */
73 RF_uint64 phys_io_us; /* time of physical I/O */
74 RF_Etimer_t tot_timer; /* a timer used to compute total access time */
75 RF_Etimer_t timer; /* a generic timer val for timing events that live across procedure boundaries */
76 RF_Etimer_t recon_timer; /* generic timer for recon stuff */
77 RF_uint64 index;
78 } RF_AccTraceEntry_t;
79
80 typedef struct RF_AccTotals_s {
81 /* user acc stats */
82 RF_uint64 suspend_ovhd_us;
83 RF_uint64 map_us;
84 RF_uint64 lock_us;
85 RF_uint64 dag_create_us;
86 RF_uint64 dag_retry_us;
87 RF_uint64 exec_us;
88 RF_uint64 exec_engine_us;
89 RF_uint64 cleanup_us;
90 RF_uint64 user_reccount;
91 /* recon acc stats */
92 RF_uint64 recon_start_to_fetch_us;
93 RF_uint64 recon_fetch_to_return_us;
94 RF_uint64 recon_return_to_submit_us;
95 RF_uint64 recon_io_overflow_count;
96 RF_uint64 recon_phys_io_us;
97 RF_uint64 recon_num_phys_ios;
98 RF_uint64 recon_diskwait_us;
99 RF_uint64 recon_reccount;
100 /* trace entry stats */
101 RF_uint64 xor_us;
102 RF_uint64 q_us;
103 RF_uint64 plog_us;
104 RF_uint64 diskqueue_us;
105 RF_uint64 diskwait_us;
106 RF_uint64 total_us;
107 RF_uint64 num_log_ents;
108 RF_uint64 phys_io_overflow_count;
109 RF_uint64 num_phys_ios;
110 RF_uint64 phys_io_us;
111 RF_uint64 bigvals;
112 /* histograms */
113 RF_Hist_t dw_hist[RF_HIST_NUM_BUCKETS];
114 RF_Hist_t tot_hist[RF_HIST_NUM_BUCKETS];
115 } RF_AccTotals_t;
116
117 #if RF_UTILITY == 0
118 RF_DECLARE_EXTERN_MUTEX(rf_tracing_mutex)
119 #endif /* RF_UTILITY == 0 */
120
121 int rf_ConfigureAccessTrace(RF_ShutdownList_t **listp);
122 void rf_LogTraceRec(RF_Raid_t *raid, RF_AccTraceEntry_t *rec);
123 void rf_FlushAccessTraceBuf(void);
124
125 #endif /* !_RF__RF_ACCTRACE_H_ */
126