Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
emulab-devel
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
143
Issues
143
List
Boards
Labels
Service Desk
Milestones
Merge Requests
6
Merge Requests
6
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
emulab
emulab-devel
Commits
8f349249
Commit
8f349249
authored
Apr 09, 2003
by
Mike Hibler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Once again remove the hacky/hokey LOSSRATE code,
hopefully never to return again!
parent
ff4f97d3
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
0 additions
and
166 deletions
+0
-166
os/frisbee.redux/GNUmakefile.in
os/frisbee.redux/GNUmakefile.in
+0
-3
os/frisbee.redux/client.c
os/frisbee.redux/client.c
+0
-40
os/frisbee.redux/event.c
os/frisbee.redux/event.c
+0
-12
os/frisbee.redux/event.h
os/frisbee.redux/event.h
+0
-3
os/frisbee.redux/network.c
os/frisbee.redux/network.c
+0
-85
os/frisbee.redux/server.c
os/frisbee.redux/server.c
+0
-23
No files found.
os/frisbee.redux/GNUmakefile.in
View file @
8f349249
...
...
@@ -33,9 +33,6 @@ SERVEROBJS = server.o $(SHAREDOBJS)
CFLAGS = -O2 -g -Wall -static $(PTHREADCFLAGS) -DSTATS
LDFLAGS = -static
# Hacky loss rate flag
#CFLAGS += -DDOLOSSRATE
# Define this if you implementation of cond_vars works well
#CFLAGS += -DCONDVARS_WORK
...
...
os/frisbee.redux/client.c
View file @
8f349249
...
...
@@ -47,9 +47,6 @@ int maxinprogress = MAXINPROGRESS;
int
redodelay
=
CLIENT_REQUEST_REDO_DELAY
;
int
idledelay
=
CLIENT_WRITER_IDLE_DELAY
;
int
startdelay
=
0
,
startat
=
0
;
#ifdef DOLOSSRATE
int
lossrate
=
0
;
#endif
int
debug
=
0
;
int
tracing
=
0
;
...
...
@@ -356,26 +353,14 @@ main(int argc, char **argv)
strncpy
(
traceprefix
,
event
.
data
.
start
.
traceprefix
,
64
);
else
traceprefix
[
0
]
=
0
;
#ifdef DOLOSSRATE
if
(
event
.
data
.
start
.
plr
>=
0
.
0
&&
event
.
data
.
start
.
plr
<=
1
.
0
)
lossrate
=
(
int
)(
event
.
data
.
start
.
plr
*
0x7fffffff
);
else
lossrate
=
0
;
#endif
log
(
"Starting: slice=%d, startat=%d, startdelay=%d, zero=%d, "
"randomize=%d, nothreads=%d, debug=%d, tracing=%d, "
"pkttimeout=%d, idletimer=%d, idledelay=%d, redodelay=%d, "
#ifdef DOLOSSRATE
"plr=%.2f, "
#endif
"maxmem=%d, chunkbufs=%d, maxwritebumfem=%d, "
"maxreadahead=%d, maxinprogress=%d"
,
slice
,
startat
,
startdelay
,
zero
,
randomize
,
nothreads
,
debug
,
tracing
,
pkttimeout
,
idletimer
,
idledelay
,
redodelay
,
#ifdef DOLOSSRATE
lossrate
?
event
.
data
.
start
.
plr
:
0
,
#endif
maxmem
,
maxchunkbufs
,
maxwritebufmem
,
maxreadahead
,
maxinprogress
);
}
...
...
@@ -1266,35 +1251,10 @@ PlayFrisbee(void)
Stats
.
u
.
v1
.
redodelay
=
redodelay
;
Stats
.
u
.
v1
.
randomize
=
randomize
;
p
->
msg
.
leave2
.
stats
=
Stats
;
#if 1
/* XXX hack, make sure stats get through */
delay
=
0
;
while
(
delay
<
10
)
{
Packet_t
rep
;
int
readretry
;
PacketSend
(
p
,
0
);
for
(
readretry
=
0
;
readretry
<
10
;
readretry
++
)
{
fsleep
(
100000
);
while
(
PacketReceive
(
&
rep
)
==
0
)
{
if
(
rep
.
hdr
.
subtype
==
PKTSUBTYPE_LEAVE2
&&
rep
.
hdr
.
type
==
PKTTYPE_REPLY
)
goto
gotit
;
}
}
delay
++
;
}
gotit:
#else
PacketSend
(
p
,
0
);
#endif
log
(
""
);
ClientStatsDump
(
myid
,
&
Stats
);
#ifdef DOLOSSRATE
dump_network
();
#endif
#else
p
->
hdr
.
type
=
PKTTYPE_REQUEST
;
p
->
hdr
.
subtype
=
PKTSUBTYPE_LEAVE
;
...
...
os/frisbee.redux/event.c
View file @
8f349249
...
...
@@ -211,16 +211,6 @@ parse_event(Event_t *event, char *etype, char *buf)
gotevent
=
1
;
continue
;
}
#ifdef DOLOSSRATE
{
double
plr
;
if
(
sscanf
(
cp
,
"PLR=%lf"
,
&
plr
)
==
1
)
{
event
->
data
.
start
.
plr
=
plr
;
gotevent
=
1
;
continue
;
}
}
#endif
}
}
return
0
;
...
...
@@ -289,7 +279,6 @@ EventInit(char *server)
strcpy
(
ipbuf
,
inet_ntoa
(
myip
));
ipaddr
=
ipbuf
;
#if 1
/*
* Hideous Hack Alert!
*
...
...
@@ -304,7 +293,6 @@ EventInit(char *server)
return
1
;
}
else
if
(
debug
)
log
(
"client number %d for event handling"
,
clientnum
);
#endif
/*
* Convert server/port to elvin thing.
...
...
os/frisbee.redux/event.h
View file @
8f349249
...
...
@@ -33,9 +33,6 @@ typedef struct {
int
trace
;
/* tracing level */
char
traceprefix
[
STRSIZE
];
/* prefix for trace output file */
#ifdef DOLOSSRATE
double
plr
;
#endif
}
start
;
struct
{
int
exitstatus
;
...
...
os/frisbee.redux/network.c
View file @
8f349249
...
...
@@ -22,20 +22,7 @@
#include "decls.h"
#include "utils.h"
#ifdef DOLOSSRATE
#define LOSSONSENDER
#define LOSSONRECVER
#endif
#ifdef DOLOSSRATE
extern
int
lossrate
;
#endif
#ifdef STATS
#ifdef DOLOSSRATE
unsigned
long
rpackets
,
rpacketslost
;
unsigned
long
spackets
,
spacketslost
;
#endif
unsigned
long
nonetbufs
;
#define DOSTAT(x) (x)
#else
...
...
@@ -53,24 +40,6 @@ struct in_addr myipaddr;
static
int
nobufdelay
=
-
1
;
int
broadcast
=
0
;
void
dump_network
(
void
)
{
#ifdef DOLOSSRATE
if
(
lossrate
==
0
)
return
;
if
(
spacketslost
)
fprintf
(
stderr
,
"Lost %lu of %lu send packets (%.2f%%)
\n
"
,
spacketslost
,
spackets
,
(
double
)
spacketslost
*
100
/
spackets
);
if
(
rpacketslost
)
fprintf
(
stderr
,
"Lost %lu of %lu recv packets (%.2f%%)
\n
"
,
rpacketslost
,
rpackets
,
(
double
)
rpacketslost
*
100
/
rpackets
);
#endif
}
static
void
CommonInit
(
void
)
{
...
...
@@ -222,31 +191,7 @@ PacketReceive(Packet_t *p)
{
struct
sockaddr_in
from
;
int
mlen
,
alen
;
#ifdef DOLOSSRATE
#ifdef LOSSONRECVER
struct
timeval
now
,
then
;
if
(
lossrate
)
{
/*
* XXX cannot rely on socket timeout value since we need to
* treat received and dropped packets as though they never
* arrived. This is still not correct as a receive timeout
* could still be up to twice as long as it should be, but
* I don't want to mess with the socket timeout on every
* recv call.
*/
gettimeofday
(
&
then
,
0
);
if
((
then
.
tv_usec
+=
PKTRCV_TIMEOUT
)
>=
1000000
)
{
then
.
tv_sec
++
;
then
.
tv_usec
-=
1000000
;
}
again:
gettimeofday
(
&
now
,
0
);
if
(
timercmp
(
&
now
,
&
then
,
>=
))
return
-
1
;
}
#endif
#endif
alen
=
sizeof
(
from
);
bzero
(
&
from
,
alen
);
if
((
mlen
=
recvfrom
(
sock
,
p
,
sizeof
(
*
p
),
0
,
...
...
@@ -270,21 +215,6 @@ PacketReceive(Packet_t *p)
return
1
;
}
#ifdef DOLOSSRATE
#ifdef LOSSONRECVER
DOSTAT
(
rpackets
++
);
if
(
lossrate
&&
random
()
<
lossrate
)
{
/* XXX hack: don't loose join/leave messages, screws stats */
if
(
p
->
hdr
.
subtype
!=
PKTSUBTYPE_JOIN
&&
p
->
hdr
.
subtype
!=
PKTSUBTYPE_LEAVE
&&
p
->
hdr
.
subtype
!=
PKTSUBTYPE_LEAVE2
)
{
DOSTAT
(
rpacketslost
++
);
goto
again
;
}
}
#endif
#endif
return
0
;
}
...
...
@@ -301,21 +231,6 @@ PacketSend(Packet_t *p, int *resends)
struct
sockaddr_in
to
;
int
len
,
delays
;
#ifdef DOLOSSRATE
#ifdef LOSSONSENDER
DOSTAT
(
spackets
++
);
if
(
lossrate
&&
random
()
<
lossrate
)
{
/* XXX hack: don't loose join/leave messages, screws stats */
if
(
p
->
hdr
.
subtype
!=
PKTSUBTYPE_JOIN
&&
p
->
hdr
.
subtype
!=
PKTSUBTYPE_LEAVE
&&
p
->
hdr
.
subtype
!=
PKTSUBTYPE_LEAVE2
)
{
DOSTAT
(
spacketslost
++
);
return
;
}
}
#endif
#endif
len
=
sizeof
(
p
->
hdr
)
+
p
->
hdr
.
datalen
;
p
->
hdr
.
srcip
=
myipaddr
.
s_addr
;
...
...
os/frisbee.redux/server.c
View file @
8f349249
...
...
@@ -50,9 +50,6 @@ struct in_addr mcastif;
char
*
filename
;
struct
timeval
IdleTimeStamp
,
FirstReq
,
LastReq
;
volatile
int
activeclients
;
#ifdef DOLOSSRATE
int
lossrate
=
0
;
#endif
/* Forward decls */
void
quit
(
int
);
...
...
@@ -439,12 +436,6 @@ ClientLeave2(Packet_t *p)
break
;
}
}
#if 1
/* XXX let the client know we got the goods */
p
->
hdr
.
type
=
PKTTYPE_REPLY
;
p
->
hdr
.
datalen
=
sizeof
(
p
->
msg
.
leave2
);
PacketReply
(
p
);
#endif
#else
activeclients
--
;
...
...
@@ -804,17 +795,6 @@ main(int argc, char **argv)
case
'W'
:
bandwidth
=
atol
(
optarg
);
break
;
#ifdef DOLOSSRATE
/* XXX this is not the emulab way! */
case
'L'
:
{
double
plr
=
atof
(
optarg
);
if
(
plr
<
0
||
plr
>
1
)
fatal
(
"bad loss rate: %f"
,
plr
);
lossrate
=
(
int
)(
plr
*
0x7fffffff
);
break
;
}
#endif
case
'h'
:
case
'?'
:
default:
...
...
@@ -925,9 +905,6 @@ main(int argc, char **argv)
Stats
.
intervals
,
Stats
.
missed
);
log
(
" spurious wakeups: %d"
,
Stats
.
wakeups
);
log
(
" max workq size: %d"
,
WorkQMax
);
#ifdef DOLOSSRATE
dump_network
();
#endif
}
#endif
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment