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