Coda Distributed File System
timing.h
Go to the documentation of this file.
1/* BLURB gpl
2
3 Coda File System
4 Release 6
5
6 Copyright (c) 1987-2003 Carnegie Mellon University
7 Additional copyrights listed below
8
9This code is distributed "AS IS" without warranty of any kind under
10the terms of the GNU General Public Licence Version 2, as shown in the
11file LICENSE. The technical and financial contributors to Coda are
12listed in the file CREDITS.
13
14 Additional copyrights
15 none currently
16
17#*/
18
19#ifndef _RES_TIMING_H_
20#define _RES_TIMING_H_
21
22#ifdef __cplusplus
23extern "C" {
24#endif
25
26#include <sys/time.h>
27#include <stdio.h>
28
29#ifdef __cplusplus
30}
31#endif
32
33#define TIMEGROWSIZE 10
34extern int pathtiming;
35extern int probingon;
36#define MAXPROBES 1000
37#define PROBE(info, num) \
38 if (pathtiming && probingon && (info)) \
39 (info)->insert((num));
40
41/* probe numbers */
42#define RESBEGIN 0
43#define RUNTUPDATEBEGIN 1
44#define RUNTUPDATEEND 2
45#define WEAKEQBEGIN 3
46#define COLLECTLOGBEGIN 4 /* begin of regular res */
47#define COLLECTLOGEND 5
48#define COORP1BEGIN 6
49#define COORP1END 7
50#define P1PANDYBEGIN 8
51#define COORP2BEGIN 9
52#define COORP3BEGIN 10
53#define COORP3END 11
54#define COORMARKINCBEGIN 12
55#define COORMARKINCEND 13
56#define RESEND 14
57#define CFETCHLOGBEGIN 15
58#define CFETCHLOGEND 16
59#define CPHASE1BEGIN 17
60#define CPHASE1END 18
61#define COMPOPSBEGIN 19
62#define COMPOPSEND 20
63#define PERFOPSBEGIN 21
64#define PERFOPSEND 22
65#define P1PUTOBJBEGIN 23
66#define P1PUTOBJEND 24
67#define CPHASE2BEGIN 25
68#define CPHASE2END 26
69#define CPHASE3BEGIN 27
70#define CPHASE3END 28
71
72/* for timing file resolution */
73#define FILERESBASE 50
74
75#define COORDSTARTVICERESOLVE FILERESBASE + 1
76#define COORDSTARTFILERES FILERESBASE + 2
77#define COORDSTARTFILEFETCH FILERESBASE + 3
78#define COORDENDFILEFETCH FILERESBASE + 4
79#define COORDENDFORCEFILE FILERESBASE + 5
80#define COORDENDFILERES FILERESBASE + 6
81#define COORDENDVICERESOLVE FILERESBASE + 7
82
83struct tpe {
84 int id;
85 struct timeval tv;
86};
87
89 int nentries;
90 int maxentries;
91 tpe *arr;
92 void grow_storage();
93
94public:
95 timing_path(int);
97 void insert(int);
98 void postprocess();
99 void postprocess(FILE *);
100 void postprocess(int);
101};
102
103extern timing_path *tpinfo;
105
106#endif /* _RES_TIMING_H_ */
Definition: timing.h:88
void insert(int)
Definition: timing.cc:95
timing_path(int)
Definition: timing.cc:65
void postprocess()
Definition: timing.cc:114
~timing_path()
Definition: timing.cc:72
Definition: timing.h:83
struct timeval tv
Definition: timing.h:85
int id
Definition: timing.h:84
timing_path * FileresTPinfo
Definition: rescoord.cc:62
int probingon
Definition: srv.cc:134
timing_path * tpinfo
Definition: rescoord.cc:61
int pathtiming
Definition: srv.cc:141