chore: Delete zombie tests

master
Sean McBride 3 years ago
parent c464f326ae
commit 8a8f7d995b

@ -1,120 +0,0 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <fcntl.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <sys/uio.h>
#define BUF_MAX 44
#define RDWR_MAX 1
#if RDWR_MAX > 1
int
main(int argc, char **argv) __attribute__((optnone))
{
char buf[RDWR_MAX][BUF_MAX] = { 0 };
printf("%s enter [in:%s, out:%s]\n", argv[0], argv[1], argv[2]);
int fdr = open(argv[1], O_RDONLY, S_IRUSR | S_IRGRP);
if (fdr < 0) {
perror("fopen");
return -1;
}
int fdw = creat(argv[2], S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH);
if (fdw < 0) {
perror("creat");
return -1;
}
int n = 0;
struct iovec iov[RDWR_MAX] = { 0 };
for (int i = 0; i < RDWR_MAX; i++) {
iov[i].iov_base = buf[i];
iov[i].iov_len = BUF_MAX;
}
while ((n = readv(fdr, iov, RDWR_MAX)) > 0) {
int wvcnt = n / BUF_MAX;
if (n % BUF_MAX) {
iov[wvcnt].iov_len = n % BUF_MAX;
wvcnt++;
}
if (writev(fdw, iov, wvcnt) != n) perror("writev");
memset(buf, 0, RDWR_MAX * BUF_MAX);
for (int i = 0; i < RDWR_MAX; i++) {
iov[i].iov_base = buf[i];
iov[i].iov_len = BUF_MAX;
}
n = 0;
}
close(fdr);
close(fdw);
printf("%s done\n", argv[0]);
return 0;
}
#else
int
main(int argc, char **argv) __attribute__((optnone))
{
char buf[BUF_MAX] = { 0 };
printf("%s enter [in:%s, out:%s]\n", argv[0], argv[1], argv[2]);
#ifdef USE_OPEN
int fdr = open(argv[1], O_RDONLY, S_IRUSR | S_IRGRP);
if (fdr < 0) {
perror("fopen");
return -1;
}
int fdw = creat(argv[2], S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH);
if (fdw < 0) {
perror("creat");
return -1;
}
int n = 0;
while ((n = read(fdr, buf, BUF_MAX)) > 0) {
if (write(fdw, buf, n) != n) perror("write");
memset(buf, 0, BUF_MAX);
n = 0;
}
if (n < 0) perror("read");
close(fdr);
close(fdw);
#else
FILE *fpr = fopen(argv[1], "r");
if (!fpr) {
perror("fopen");
return -1;
}
FILE *fpw = fopen(argv[2], "w");
if (!fpw) {
perror("fopen");
return -1;
}
while (!feof(fpr)) {
char *p = NULL;
if ((p = fgets(buf, BUF_MAX, fpr)) == NULL)
perror("fgets");
else {
if (fputs(p, fpw) < 0) perror("fputs");
p = NULL;
}
memset(buf, 0, BUF_MAX);
}
fclose(fpr);
fclose(fpw);
#endif
printf("%s done\n", argv[0]);
return 0;
}
#endif

@ -1,27 +0,0 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#define ITERS 50000000
int
main(int argc, char **argv) __attribute__((optnone))
{
printf("%s enter\n", argv[0]);
int n = 0, e = 1;
if (argc == 2) {
n = atoi(argv[1]);
if (n > 0) e = 0;
}
while (e || n > 0) {
int i = ITERS;
n--;
while (i-- > 0) {
int j = ITERS;
while (j-- > 0) __asm__ __volatile__("nop" : : : "memory");
}
printf("%s\n", argv[0]);
}
printf("%s done\n", argv[0]);
}

@ -1,4 +0,0 @@
#!/bin/bash
# fib(20)
# Perhaps this can be improved to pass a body without an additional file
ab -n 100000 -c 64 -s 999999999 -p client1_body.txt -v 4 -r localhost:10000/

@ -1,4 +0,0 @@
#!/bin/bash
# fib(10)
# Perhaps this can be improved to pass a body without an additional file
ab -n 100000 -c 64 -s 999999999 -p client2_body.txt -v 4 -r localhost:10001/

@ -1,19 +0,0 @@
#!/bin/bash
# Executes the runtime in GDB
# Substitutes the absolute path from the container with a path relatively derived from the location of this script
# This allows debugging outside of the Docker container
# Also disables pagination and stopping on SIGUSR1
declare project_path="$(
cd "$(dirname "$1")/../.."
pwd
)"
echo $project_path
cd ../../bin
export LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH"
gdb --eval-command="handle SIGUSR1 nostop" \
--eval-command="set pagination off" \
--eval-command="set substitute-path /sledge/runtime $project_path" \
--eval-command="run ../tests/preemption/test_fibonacci_multiple.json" \
./sledgert
cd ../../tests

@ -1,10 +0,0 @@
LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_fibonacci_multiple.json
# fib(20)
ab -n 100000 -c 100 -p post_body.txt -v 4 localhost:10000/
# fib(10)
ab -n 100000 -c 100 -p post_body2.txt -v 4 localhost:10001/

@ -1,9 +0,0 @@
{
"name": "fibonacci",
"path": "fibonacci_wasm.so",
"port": 10000,
"relative-deadline-us": 50000,
"http-req-size": 1024,
"http-resp-size": 1024,
"http-resp-content-type": "text/plain"
}

@ -1,18 +0,0 @@
{
"name": "fibonacci",
"path": "fibonacci_wasm.so",
"port": 10000,
"relative-deadline-us": 80000,
"http-req-size": 1024,
"http-resp-size": 1024,
"http-resp-content-type": "text/plain"
},
{
"name": "fibonacci2",
"path": "fibonacci_wasm.so",
"port": 10001,
"relative-deadline-us": 20000,
"http-req-size": 1024,
"http-resp-size": 1024,
"http-resp-content-type": "text/plain"
}

@ -1,53 +0,0 @@
/* code from http://www.cs.rpi.edu/~moorthy/Courses/os98/Pgms/socket.html */
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#include <string.h>
#include <unistd.h>
void
error(char *msg)
{
perror(msg);
exit(0);
}
int
main(int argc, char *argv[])
{
int sockfd, portno, n;
struct sockaddr_in serv_addr;
struct hostent * server;
char buffer[256] = "The quick brown fox jumps over the lazy dog";
if (argc < 3) {
fprintf(stderr, "usage %s hostname port\n", argv[0]);
exit(0);
}
portno = atoi(argv[2]);
sockfd = socket(AF_INET, SOCK_STREAM, 0);
if (sockfd < 0) error("ERROR opening socket");
server = gethostbyname(argv[1]);
if (server == NULL) {
fprintf(stderr, "ERROR, no such host\n");
exit(0);
}
bzero((char *)&serv_addr, sizeof(serv_addr));
serv_addr.sin_family = AF_INET;
bcopy((char *)server->h_addr, (char *)&serv_addr.sin_addr.s_addr, server->h_length);
serv_addr.sin_port = htons(portno);
if (connect(sockfd, (struct sockaddr *)&serv_addr, sizeof(serv_addr)) < 0) error("ERROR connecting");
printf("Sending message %s\n", buffer);
n = send(sockfd, buffer, strlen(buffer), 0);
if (n < 0) error("ERROR writing to socket");
bzero(buffer, 256);
n = recv(sockfd, buffer, 255, 0);
if (n < 0) error("ERROR reading from socket");
printf("%s\n", buffer);
close(sockfd);
return 0;
}

@ -1,52 +0,0 @@
/* A simple server in the internet domain using TCP
The port number is passed as an argument */
/* code from: http://www.cs.rpi.edu/~moorthy/Courses/os98/Pgms/socket.html */
#include <stdio.h>
#include <stdlib.h>
#include <strings.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <unistd.h>
#include <netinet/in.h>
void
error(char *msg)
{
perror(msg);
exit(1);
}
int
main(int argc, char *argv[])
{
int sockfd, newsockfd, portno, clilen;
char buffer[256];
struct sockaddr_in serv_addr, cli_addr;
int n;
if (argc < 2) {
fprintf(stderr, "ERROR, no port provided\n");
exit(1);
}
sockfd = socket(AF_INET, SOCK_STREAM, 0);
if (sockfd < 0) error("ERROR opening socket");
bzero((char *)&serv_addr, sizeof(serv_addr));
portno = atoi(argv[1]);
serv_addr.sin_family = AF_INET;
serv_addr.sin_addr.s_addr = INADDR_ANY;
serv_addr.sin_port = htons(portno);
if (bind(sockfd, (struct sockaddr *)&serv_addr, sizeof(serv_addr)) < 0) error("ERROR on binding");
listen(sockfd, 5);
clilen = sizeof(cli_addr);
newsockfd = accept(sockfd, (struct sockaddr *)&cli_addr, &clilen);
if (newsockfd < 0) error("ERROR on accept");
bzero(buffer, 256);
n = recv(newsockfd, buffer, 255, 0);
if (n < 0) error("ERROR reading from socket");
printf("Here is the message: %s\n", buffer);
n = send(newsockfd, "I got your message", 18, 0);
if (n < 0) error("ERROR writing to socket");
close(newsockfd);
close(sockfd);
return 0;
}

@ -1,9 +0,0 @@
{
"name": "cifar10",
"path": "cifar10_wasm.so",
"port": 10000,
"relative-deadline-us": 50000,
"http-req-size": 4096,
"http-resp-size": 128,
"http-resp-content-type": "text/plain"
}

@ -1,9 +0,0 @@
{
"name": "empty",
"path": "empty_wasm.so",
"port": 10000,
"relative-deadline-us": 50000,
"http-req-size": 1024,
"http-resp-size": 1024,
"http-resp-content-type": "text/plain"
}

@ -1,10 +0,0 @@
{
"name": "fibonacci",
"path": "fibonacci_wasm.so",
"port": 10000,
"expected-execution-us": 600,
"relative-deadline-us": 2000,
"http-req-size": 1024,
"http-resp-size": 1024,
"http-resp-content-type": "text/plain"
}

@ -1,9 +0,0 @@
{
"name": "gocr",
"path": "gocr_wasm.so",
"port": 10000,
"relative-deadline-us": 50000,
"http-req-size": 10240,
"http-resp-size": 128,
"http-resp-content-type": "text/plain"
}

@ -1,120 +0,0 @@
{
"name": "adpcm",
"path": "adpcm_wasm.so",
"port": 10000,
"relative-deadline-us": 50000,
},
{
"name": "bitcount",
"path": "bitcount_wasm.so",
"port": 10002,
"relative-deadline-us": 50000,
},
{
"name": "basic_math",
"path": "basic_math_wasm.so",
"port": 10004,
"relative-deadline-us": 50000,
},
{
"name": "binarytrees",
"path": "binarytrees_wasm.so",
"port": 10006,
"relative-deadline-us": 50000,
},
{
"name": "crc",
"path": "crc_wasm.so",
"port": 10008,
"relative-deadline-us": 50000,
},
{
"name": "dijkstra",
"path": "dijkstra_wasm.so",
"port": 10010,
"relative-deadline-us": 50000,
},
{
"name": "forever",
"path": "forever_wasm.so",
"port": 10012,
"relative-deadline-us": 50000,
},
{
"name": "fornever",
"path": "forever_wasm.so",
"port": 10014,
"relative-deadline-us": 50000,
},
{
"name": "fft",
"path": "fft_wasm.so",
"port": 10016,
"relative-deadline-us": 50000,
},
{
"name": "function_pointers",
"path": "function_pointers_wasm.so",
"port": 10018,
"relative-deadline-us": 50000,
},
{
"name": "gsm",
"path": "gsm_wasm.so",
"port": 10020,
"relative-deadline-us": 50000,
},
{
"name": "libjpeg",
"path": "libjpeg_wasm.so",
"port": 10022,
"relative-deadline-us": 50000,
},
{
"name": "mandelbrot",
"path": "mandelbrot_wasm.so",
"port": 10024,
"relative-deadline-us": 50000,
},
{
"name": "matrix_multiply",
"path": "matrix_multiply_wasm.so",
"port": 10026,
"relative-deadline-us": 50000,
},
{
"name": "particia",
"path": "partricia_wasm.so",
"port": 10028,
"relative-deadline-us": 50000,
},
{
"name": "sqlite",
"path": "sqlite_wasm.so",
"port": 10030,
"relative-deadline-us": 50000,
},
{
"name": "stringsearch",
"path": "stringsearch_wasm.so",
"port": 10032,
"relative-deadline-us": 50000,
},
{
"name": "filesys",
"path": "filesys_wasm.so",
"port": 10034,
"relative-deadline-us": 50000,
},
{
"name": "sockserver",
"path": "sockserver_wasm.so",
"port": 10036,
"relative-deadline-us": 50000,
},
{
"name": "sockclient",
"path": "sockclient_wasm.so",
"port": 10038,
"relative-deadline-us": 50000,
}

@ -1,16 +0,0 @@
adpcm_wasm.so:10000:adpcm:2:0:0:0:0
bitcount_wasm.so:10002:bitcount:2:0:0:0:0
basic_math_wasm.so:10004:basic_math:1:0:0:0:0
binarytrees_wasm.so:10006:binarytrees:2:0:0:0:0
crc_wasm.so:10008:crc:2:0:0:0:0
;dijkstra_wasm.so:10010:dijkstra:2:0:0:0:0
forever_wasm.so:10012:forever:1:0:0:0:0
forever_wasm.so:10014:fornever:2:0:0:0:0
;fft_wasm.so:10016:fft:3:0:0:0:0
function_pointers_wasm.so:10018:function_pointers:1:0:0:0:0
gsm_wasm.so:10020:gsm:4:0:0:0:0
;libjpeg_wasm.so:10022:libjpeg:1:0:0:0:0
mandelbrot_wasm.so:10024:mandelbrot:2:0:0:0:0
;matrix_multiply_wasm.so:10026:matrix_multiply:1:0:0:0:0
patricia_wasm.so:10028:patricia:2:0:0:0:0
sqlite_wasm.so:10030:sqlite:1:0:0:0:0

@ -1,36 +0,0 @@
127.0.0.1:10002${ "module" : "bitcount", "args" : [ "bitcount1" , "16777216" ] }
127.0.0.1:10002${ "module" : "bitcount", "args" : [ "bitcount2" , "16777216" ] }
;127.0.0.1:10004${ "module" : "basic_math", "args" : [ "basic_math1" ] }
;127.0.0.1:10004${ "module" : "basic_math", "args" : [ "basic_math2" ] }
;127.0.0.1:10006${ "module" : "binarytrees", "args" : [ "binarytrees1", "16" ] }
;127.0.0.1:10006${ "module" : "binarytrees", "args" : [ "binarytrees2", "16" ] }
;127.0.0.1:10008${ "module" : "crc", "args" : [ "crc1", "crc/large.pcm" ] }
;127.0.0.1:10008${ "module" : "crc", "args" : [ "crc2", "crc/large.pcm" ] }
;127.0.0.1:10010${ "module" : "dijkstra", "args" : [ "dijkstra1", "dijkstra/input.dat" ] }
;127.0.0.1:10010${ "module" : "dijkstra", "args" : [ "dijkstra2", "dijkstra/input.dat" ] }
;127.0.0.1:10012${ "module" : "forever", "args" : [ "forever01" ] }
;127.0.0.1:10012${ "module" : "forever", "args" : [ "forever02" ] }
;127.0.0.1:10014${ "module" : "fornever", "args" : [ "fornever01", "10" ] }
;127.0.0.1:10014${ "module" : "fornever", "args" : [ "fornever02", "20" ] }
;127.0.0.1:10014${ "module" : "fornever", "args" : [ "fornever03", "30" ] }
;127.0.0.1:10014${ "module" : "fornever", "args" : [ "fornever04", "40" ] }
;127.0.0.1:10016${ "module" : "fft", "args" : [ "fft1" , "8", "32768" ] }
;127.0.0.1:10016${ "module" : "fft", "args" : [ "fft2" , "8", "32768" ] }
;127.0.0.1:10018${ "module" : "function_pointers", "args" : [ "function_pointers1" ] }
;127.0.0.1:10018${ "module" : "function_pointers", "args" : [ "function_pointers2" ] }
;127.0.0.1:10020${ "module" : "gsm", "args" : [ "gsm1" , "-fps" , "-c", "gsm/large.au" ] }
;127.0.0.1:10020${ "module" : "gsm", "args" : [ "gsm2" , "-fps" , "-c", "gsm/large.au" ] }
;127.0.0.1:10022${ "module" : "libjpeg", "args" : [ "libjpeg1" ] }
;127.0.0.1:10022${ "module" : "libjpeg", "args" : [ "libjpeg2" ] }
;127.0.0.1:10024${ "module" : "mandelbrot", "args" : [ "mandelbrot1", "5000" ] }
;127.0.0.1:10024${ "module" : "mandelbrot", "args" : [ "mandelbrot2", "5000" ] }
;127.0.0.1:10026${ "module" : "matrix_multiply", "args" : [ "matrix_multiply1" ] }
;127.0.0.1:10026${ "module" : "matrix_multiply", "args" : [ "matrix_multiply2" ] }
;127.0.0.1:10028${ "module" : "patricia", "args" : [ "patricia1" , "large.udp" ] }
;127.0.0.1:10030${ "module" : "sqlite", "args" : [ "sqlite1" ] }
;127.0.0.1:10030${ "module" : "sqlite", "args" : [ "sqlite2" ] }
127.0.0.1:10032${ "module" : "stringsearch", "args" : [ "strsearch1" ] }
127.0.0.1:10032${ "module" : "stringsearch", "args" : [ "strsearch2" ] }
;127.0.0.1:10034${ "module" : "filesys", "args" : [ "filesys1", "fs_in.txt", "fs_out.txt" ] }
;127.0.0.1:10036${ "module" : "sockserver", "args" : [ "sockserv1", "20000" ] }
;127.0.0.1:10038${ "module" : "sockclient", "args" : [ "sockcli1", "localhost", "20000" ] }

@ -1,33 +0,0 @@
10002$bitcount:bitcount1,16777216
10002$bitcount:bitcount2,16777216
10004$basic_math:basic_math1
10004$basic_math:basic_math2
10006$binarytrees:binarytrees1,16
10006$binarytrees:binarytrees2,16
10008$crc:crc1,crc/large.pcm
10008$crc:crc2,crc/large.pcm
;10010$dijkstra:dijkstra1,dijkstra/input.dat
;10010$dijkstra:dijkstra2,dijkstra/input.dat
;10012$forever:forever01
;10012$forever:forever02
10014$fornever:fornever01,10
10014$fornever:fornever02,20
;10012$forever:forever03
;10012$forever:forever04
10014$fornever:fornever03,30
10014$fornever:fornever04,40
;10016$fft:fft1,8,32768
;10016$fft:fft2,8,32768
;10018$function_pointers:function_pointers1
;10018$function_pointers:function_pointers2
;10020$gsm:gsm1,-fps,-c,gsm/large.au
;10020$gsm:gsm2,-fps,-c,gsm/large.au
;10022$libjpeg:libjpeg1
;10022$libjpeg:libjpeg2
;10024$mandelbrot:mandelbrot1,5000
;10024$mandelbrot:mandelbrot2,5000
;10026$matrix_multiply:matrix_multiply1
;10026$matrix_multiply:matrix_multiply2
;10028$patricia:patricia1,large.udp
;10030$sqlite:sqlite1
;10030$sqlite:sqlite2

@ -1,9 +0,0 @@
{
"name": "lpd",
"path": "lpd_wasm.so",
"port": 10000,
"relative-deadline-us": 50000,
"http-req-size": 102400,
"http-resp-size": 1048576,
"http-resp-content-type": "image/jpeg"
}

@ -1,9 +0,0 @@
{
"name": "resize",
"path": "resize_wasm.so",
"port": 10000,
"relative-deadline-us": 50000,
"http-req-size": 102400,
"http-resp-size": 102400,
"http-resp-content-type": "image/png"
}

@ -1,9 +0,0 @@
{
"name": "work",
"path": "work_wasm.so",
"port": 10000,
"relative-deadline-us": 50000,
"http-req-size": 1048776,
"http-resp-size": 1048776,
"http-resp-content-type": "text/plain"
}

@ -1,9 +0,0 @@
{
"name": "work100k",
"path": "work100k_wasm.so",
"port": 10000,
"relative-deadline-us": 50000,
"http-req-size": 102600,
"http-resp-size": 102600,
"http-resp-content-type": "text/plain"
}

@ -1,9 +0,0 @@
{
"name": "work10k",
"path": "work10k_wasm.so",
"port": 10000,
"relative-deadline-us": 50000,
"http-req-size": 10480,
"http-resp-size": 10480,
"http-resp-content-type": "text/plain"
}

@ -1,9 +0,0 @@
{
"name": "work1k",
"path": "work1k_wasm.so",
"port": 10000,
"relative-deadline-us": 50000,
"http-req-size": 1200,
"http-resp-size": 1200,
"http-resp-content-type": "text/plain"
}

@ -1,9 +0,0 @@
{
"name": "work1m",
"path": "work1m_wasm.so",
"port": 10000,
"relative-deadline-us": 50000,
"http-req-size": 1048776,
"http-resp-size": 1048776,
"http-resp-content-type": "text/plain"
}

@ -1,30 +0,0 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#ifndef MAX_BUF
#define MAX_BUF (1024 * 1024 * 1) // 1m
#endif
//__attribute__((optnone)) int
int
main(void)
{
char *d = malloc(MAX_BUF + 1);
int r = read(0, d, MAX_BUF);
// unsigned long long st = getcycles(), en = 0;
// wrk();
// en = getcycles();
// if (r <= 0) printf("%llu\n", en > st ? (en - st)/CPU_CYCS : -1);
if (r < 0)
printf("E\n");
else if (r <= 1)
printf("D\n");
else
write(1, d, r);
return 0;
}

@ -1,28 +0,0 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#define MAX_BUF 102400
//__attribute__((optnone)) int
int
main(void)
{
char *d = malloc(MAX_BUF + 1);
int r = read(0, d, MAX_BUF);
// unsigned long long st = getcycles(), en = 0;
// wrk();
// en = getcycles();
// if (r <= 0) printf("%llu\n", en > st ? (en - st)/CPU_CYCS : -1);
if (r < 0)
printf("E\n");
else if (r <= 1)
printf("D\n");
else
write(1, d, r);
return 0;
}

@ -1,28 +0,0 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#define MAX_BUF 10240
//__attribute__((optnone)) int
int
main(void)
{
char *d = malloc(MAX_BUF + 1);
int r = read(0, d, MAX_BUF);
// unsigned long long st = getcycles(), en = 0;
// wrk();
// en = getcycles();
// if (r <= 0) printf("%llu\n", en > st ? (en - st)/CPU_CYCS : -1);
if (r < 0)
printf("E\n");
else if (r <= 1)
printf("D\n");
else
write(1, d, r);
return 0;
}

@ -1,28 +0,0 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#define MAX_BUF 1024
//__attribute__((optnone)) int
int
main(void)
{
char *d = malloc(MAX_BUF + 1);
int r = read(0, d, MAX_BUF);
// unsigned long long st = getcycles(), en = 0;
// wrk();
// en = getcycles();
// if (r <= 0) printf("%llu\n", en > st ? (en - st)/CPU_CYCS : -1);
if (r < 0)
printf("E\n");
else if (r <= 1)
printf("D\n");
else
write(1, d, r);
return 0;
}

@ -1,28 +0,0 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#define MAX_BUF (1024 * 1024 * 1) // 1m
//__attribute__((optnone)) int
int
main(void)
{
char *d = malloc(MAX_BUF + 1);
int r = read(0, d, MAX_BUF);
// unsigned long long st = getcycles(), en = 0;
// wrk();
// en = getcycles();
// if (r <= 0) printf("%llu\n", en > st ? (en - st)/CPU_CYCS : -1);
if (r < 0)
printf("E\n");
else if (r <= 1)
printf("D\n");
else
write(1, d, r);
return 0;
}
Loading…
Cancel
Save