summaryrefslogtreecommitdiff
path: root/regress/sys/kern/sosplice/perf/Makefile
blob: 81676cd0625daced2b61bd9588006b5a8df5d791 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#	$OpenBSD: Makefile,v 1.1 2013/01/08 21:42:19 bluhm Exp $

PROG ?=		relay
CFLAGS +=	-Wall -Werror
CFLAGS +=	-Wstrict-prototypes -Wmissing-prototypes
CFLAGS +=	-Wmissing-declarations
CFLAGS +=	-Wshadow -Wpointer-arith -Wcast-qual
CFLAGS +=	-Wsign-compare -Wbounded
NOMAN =		yes

TARGETS =	tcp-copy tcp-splice udp-copy udp-splice
CLEANFILES +=	copy splice

.include <bsd.regress.mk>

copy splice: ${PROG}
	ln -s relay $@

.for p in tcp udp
.for r in copy splice

run-regress-$p-$r: $r
.if empty (REMOTE_SSH)
	./$r ${p:S/tcp//:S/udp/-u/} 12345 localhost 12346 & \
	rpid=$$! ; \
	tcpbench ${p:S/tcp//:S/udp/-u/} -t 7 -s -p 12346 & \
	sleep 1 ; \
	tcpbench ${p:S/tcp//:S/udp/-u/} -t 5 localhost ; \
	kill $$rpid ; \
	pkill -x tcpbench
.else
	ssh -f ${REMOTE_SSH} 'cd ${.CURDIR} && make PROG= LOCAL_ADDR=${LOCAL_ADDR} REMOTE_ADDR=${REMOTE_ADDR} remote-regress-$p-$r' ; \
	tcpbench ${p:S/tcp//:S/udp/-u/} -t 7 -b ${LOCAL_ADDR} -s -p 12346 & \
	sleep 1 ; \
	tcpbench ${p:S/tcp//:S/udp/-u/} -t 5 ${REMOTE_ADDR} ; \
	pkill -x tcpbench
.endif
	sleep 1

remote-regress-$p-$r: $r
	./$r ${p:S/tcp//:S/udp/-u/} -b ${REMOTE_ADDR} 12345 ${LOCAL_ADDR} 12346 & \
	rpid=$$! ; \
	sleep 7 ; \
	kill $$rpid

.endfor
.endfor