Commit | Line | Data |
---|---|---|
b08d03f0 KS |
1 | /*********************************************************** |
2 | Copyright IBM Corporation 1987 | |
3 | ||
4 | All Rights Reserved | |
5 | ||
6 | Permission to use, copy, modify, and distribute this software and its | |
7 | documentation for any purpose and without fee is hereby granted, | |
8 | provided that the above copyright notice appear in all copies and that | |
9 | both that copyright notice and this permission notice appear in | |
10 | supporting documentation, and that the name of IBM not be | |
11 | used in advertising or publicity pertaining to distribution of the | |
12 | software without specific, written prior permission. | |
13 | ||
14 | IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING | |
15 | ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL | |
16 | IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR | |
17 | ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, | |
18 | WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, | |
19 | ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS | |
20 | SOFTWARE. | |
21 | ||
22 | ******************************************************************/ | |
23 | ||
24 | /* | |
25 | * ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison | |
26 | */ | |
27 | /* | |
28 | * $Header: tp_meas.c,v 5.2 88/11/18 17:28:04 nhall Exp $ | |
29 | * $Source: /usr/argo/sys/netiso/RCS/tp_meas.c,v $ | |
30 | * | |
31 | * tp_meas.c : create a performance measurement event | |
32 | * in the circular buffer tp_Meas[] | |
33 | */ | |
34 | ||
35 | #ifndef lint | |
36 | static char *rcsid = "$Header: tp_meas.c,v 5.2 88/11/18 17:28:04 nhall Exp $"; | |
37 | #endif lint | |
38 | ||
39 | #include "types.h" | |
40 | #include "time.h" | |
41 | #include "../netiso/tp_meas.h" | |
42 | ||
43 | extern struct timeval time; | |
44 | ||
45 | #ifdef TP_PERF_MEAS | |
46 | int tp_Measn = 0; | |
47 | struct tp_Meas tp_Meas[TPMEASN]; | |
48 | ||
49 | /* | |
50 | * NAME: tpmeas() | |
51 | * | |
52 | * CALLED FROM: tp_emit(), tp_soisdisconecting(), tp_soisdisconnected() | |
53 | * tp0_stash(), tp_stash(), tp_send(), tp_goodack(), tp_usrreq() | |
54 | * | |
55 | * FUNCTION and ARGUMENTS: | |
56 | * stashes a performance-measurement event for the given reference (ref) | |
57 | * (kind) tells which kind of event, timev is the time to be stored | |
58 | * with this event, (seq), (win), and (size) are integers that usually | |
59 | * refer to the sequence number, window number (on send) and | |
60 | * size of tpdu or window. | |
61 | * | |
62 | * RETURNS: Nada | |
63 | * | |
64 | * SIDE EFFECTS: | |
65 | * | |
66 | * NOTES: | |
67 | */ | |
68 | void | |
69 | tpmeas(ref, kind, timev, seq, win, size) | |
70 | u_int ref; | |
71 | u_int kind; | |
72 | struct timeval *timev; | |
73 | u_int seq, win, size; | |
74 | { | |
75 | register struct tp_Meas *tpm; | |
76 | static int mseq; | |
77 | ||
78 | tpm = &tp_Meas[tp_Measn++]; | |
79 | tp_Measn %= TPMEASN; | |
80 | ||
81 | tpm->tpm_kind = kind; | |
82 | tpm->tpm_tseq = mseq++; | |
83 | tpm->tpm_ref = ref; | |
84 | if(kind == TPtime_from_ll) | |
85 | bcopy((caddr_t)timev, (caddr_t)&tpm->tpm_time, sizeof(struct timeval)); | |
86 | else | |
87 | bcopy( (caddr_t)&time, | |
88 | (caddr_t)&tpm->tpm_time, sizeof(struct timeval) ); | |
89 | tpm->tpm_seq = seq; | |
90 | tpm->tpm_window = win; | |
91 | tpm->tpm_size = size; | |
92 | } | |
93 | ||
94 | #endif TP_PERF_MEAS |