rf_acctrace.h revision 1.2 1 1.2 oster /* $NetBSD: rf_acctrace.h,v 1.2 1999/01/26 02:33:49 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 #ifndef _RF__RF_ACCTRACE_H_
37 1.1 oster #define _RF__RF_ACCTRACE_H_
38 1.1 oster
39 1.1 oster #include "rf_types.h"
40 1.1 oster #include "rf_hist.h"
41 1.1 oster #include "rf_etimer.h"
42 1.1 oster
43 1.1 oster typedef struct RF_user_acc_stats_s {
44 1.1 oster RF_uint64 suspend_ovhd_us; /* us spent mucking in the access-suspension code */
45 1.1 oster RF_uint64 map_us; /* us spent mapping the access */
46 1.1 oster RF_uint64 lock_us; /* us spent locking & unlocking stripes, including time spent blocked */
47 1.1 oster RF_uint64 dag_create_us; /* us spent creating the DAGs */
48 1.1 oster RF_uint64 dag_retry_us; /* _total_ us spent retrying the op -- not broken down into components */
49 1.1 oster RF_uint64 exec_us; /* us spent in DispatchDAG */
50 1.1 oster RF_uint64 exec_engine_us; /* us spent in engine, not including blocking time */
51 1.1 oster RF_uint64 cleanup_us; /* us spent tearing down the dag & maps, and generally cleaning up */
52 1.1 oster } RF_user_acc_stats_t;
53 1.1 oster
54 1.1 oster typedef struct RF_recon_acc_stats_s {
55 1.1 oster RF_uint32 recon_start_to_fetch_us;
56 1.1 oster RF_uint32 recon_fetch_to_return_us;
57 1.1 oster RF_uint32 recon_return_to_submit_us;
58 1.1 oster } RF_recon_acc_stats_t;
59 1.1 oster
60 1.1 oster typedef struct RF_acctrace_entry_s {
61 1.1 oster union {
62 1.1 oster RF_user_acc_stats_t user;
63 1.1 oster RF_recon_acc_stats_t recon;
64 1.1 oster } specific;
65 1.1 oster RF_uint8 reconacc; /* whether this is a tracerec for a user acc or a recon acc */
66 1.1 oster RF_uint64 xor_us; /* us spent doing XORs */
67 1.1 oster RF_uint64 q_us; /* us spent doing XORs */
68 1.1 oster RF_uint64 plog_us; /* us spent waiting to stuff parity into log */
69 1.1 oster RF_uint64 diskqueue_us; /* _total_ us spent in disk queue(s), incl concurrent ops */
70 1.1 oster RF_uint64 diskwait_us; /* _total_ us spent waiting actually waiting on the disk, incl concurrent ops */
71 1.1 oster RF_uint64 total_us; /* total us spent on this access */
72 1.1 oster RF_uint64 num_phys_ios; /* number of physical I/Os invoked */
73 1.1 oster RF_uint64 phys_io_us; /* time of physical I/O */
74 1.1 oster RF_Etimer_t tot_timer; /* a timer used to compute total access time */
75 1.1 oster RF_Etimer_t timer; /* a generic timer val for timing events that live across procedure boundaries */
76 1.1 oster RF_Etimer_t recon_timer; /* generic timer for recon stuff */
77 1.1 oster RF_uint64 index;
78 1.1 oster } RF_AccTraceEntry_t;
79 1.1 oster
80 1.1 oster typedef struct RF_AccTotals_s {
81 1.1 oster /* user acc stats */
82 1.1 oster RF_uint64 suspend_ovhd_us;
83 1.1 oster RF_uint64 map_us;
84 1.1 oster RF_uint64 lock_us;
85 1.1 oster RF_uint64 dag_create_us;
86 1.1 oster RF_uint64 dag_retry_us;
87 1.1 oster RF_uint64 exec_us;
88 1.1 oster RF_uint64 exec_engine_us;
89 1.1 oster RF_uint64 cleanup_us;
90 1.1 oster RF_uint64 user_reccount;
91 1.1 oster /* recon acc stats */
92 1.1 oster RF_uint64 recon_start_to_fetch_us;
93 1.1 oster RF_uint64 recon_fetch_to_return_us;
94 1.1 oster RF_uint64 recon_return_to_submit_us;
95 1.1 oster RF_uint64 recon_io_overflow_count;
96 1.1 oster RF_uint64 recon_phys_io_us;
97 1.1 oster RF_uint64 recon_num_phys_ios;
98 1.1 oster RF_uint64 recon_diskwait_us;
99 1.1 oster RF_uint64 recon_reccount;
100 1.1 oster /* trace entry stats */
101 1.1 oster RF_uint64 xor_us;
102 1.1 oster RF_uint64 q_us;
103 1.1 oster RF_uint64 plog_us;
104 1.1 oster RF_uint64 diskqueue_us;
105 1.1 oster RF_uint64 diskwait_us;
106 1.1 oster RF_uint64 total_us;
107 1.1 oster RF_uint64 num_log_ents;
108 1.1 oster RF_uint64 phys_io_overflow_count;
109 1.1 oster RF_uint64 num_phys_ios;
110 1.1 oster RF_uint64 phys_io_us;
111 1.1 oster RF_uint64 bigvals;
112 1.1 oster /* histograms */
113 1.1 oster RF_Hist_t dw_hist[RF_HIST_NUM_BUCKETS];
114 1.1 oster RF_Hist_t tot_hist[RF_HIST_NUM_BUCKETS];
115 1.1 oster } RF_AccTotals_t;
116 1.1 oster
117 1.1 oster #if RF_UTILITY == 0
118 1.1 oster RF_DECLARE_EXTERN_MUTEX(rf_tracing_mutex)
119 1.1 oster #endif /* RF_UTILITY == 0 */
120 1.1 oster
121 1.1 oster int rf_ConfigureAccessTrace(RF_ShutdownList_t **listp);
122 1.1 oster void rf_LogTraceRec(RF_Raid_t *raid, RF_AccTraceEntry_t *rec);
123 1.1 oster void rf_FlushAccessTraceBuf(void);
124 1.1 oster
125 1.1 oster #endif /* !_RF__RF_ACCTRACE_H_ */
126