work 1k to 1m functions

main
phani 5 years ago
parent f8cc5edb89
commit da43b22407

@ -20,6 +20,18 @@ u32 ncores = 0, sbox_ncores = 0, sbox_core_st = 0;
pthread_t rtthd[SBOX_NCORES]; pthread_t rtthd[SBOX_NCORES];
static unsigned long long
get_time()
{
struct timeval Tp;
int stat;
stat = gettimeofday (&Tp, NULL);
if (stat != 0)
printf ("Error return from gettimeofday: %d", stat);
return (Tp.tv_sec * 1000000 + Tp.tv_usec);
}
static void static void
usage(char *cmd) usage(char *cmd)
{ {
@ -141,7 +153,11 @@ main(int argc, char** argv)
/* in current dir! */ /* in current dir! */
struct module *m = module_alloc(args, args, ac, 0, 0, 0, 0, 0, 0); struct module *m = module_alloc(args, args, ac, 0, 0, 0, 0, 0, 0);
assert(m); assert(m);
//unsigned long long st = get_time(), en;
struct sandbox *s = sandbox_alloc(m, args, 0, NULL); struct sandbox *s = sandbox_alloc(m, args, 0, NULL);
//en = get_time();
//fprintf(stderr, "%llu\n", en - st);
exit(0); exit(0);
#endif #endif

@ -2,7 +2,7 @@ include Makefile.inc
BENCH_DIR=../../silverfish/code_benches/ BENCH_DIR=../../silverfish/code_benches/
TESTS=fibonacci empty work TESTS=fibonacci empty work work1k work10k work100k work1m
#TESTS=forever filesys sockserver sockclient empty #TESTS=forever filesys sockserver sockclient empty
TESTSRT=$(TESTS:%=%_rt) TESTSRT=$(TESTS:%=%_rt)
BENCHES=adpcm basic_math binarytrees bitcount blowfish crc dijkstra fft function_pointers \ BENCHES=adpcm basic_math binarytrees bitcount blowfish crc dijkstra fft function_pointers \

@ -0,0 +1,13 @@
{
"active" : "yes",
"name" : "work100k",
"path" : "work100k_wasm.so",
"port" : 10000,
"argsize" : 1,
"http-req-headers" : [ ],
"http-req-content-type" : "text/plain",
"http-req-size": 102600,
"http-resp-headers" : [ ],
"http-resp-size" : 102600,
"http-resp-content-type" : "text/plain"
}

@ -0,0 +1,13 @@
{
"active" : "yes",
"name" : "work10k",
"path" : "work10k_wasm.so",
"port" : 10000,
"argsize" : 1,
"http-req-headers" : [ ],
"http-req-content-type" : "text/plain",
"http-req-size": 10480,
"http-resp-headers" : [ ],
"http-resp-size" : 10480,
"http-resp-content-type" : "text/plain"
}

@ -0,0 +1,13 @@
{
"active" : "yes",
"name" : "work1k",
"path" : "work1k_wasm.so",
"port" : 10000,
"argsize" : 1,
"http-req-headers" : [ ],
"http-req-content-type" : "text/plain",
"http-req-size": 1200,
"http-resp-headers" : [ ],
"http-resp-size" : 1200,
"http-resp-content-type" : "text/plain"
}

@ -0,0 +1,13 @@
{
"active" : "yes",
"name" : "work1m",
"path" : "work1m_wasm.so",
"port" : 10000,
"argsize" : 1,
"http-req-headers" : [ ],
"http-req-content-type" : "text/plain",
"http-req-size": 1048576,
"http-resp-headers" : [ ],
"http-resp-size" : 1048776,
"http-resp-content-type" : "text/plain"
}

@ -2,24 +2,9 @@
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#define CPU_CYCS 2100 #ifndef MAX_BUF
#define MAX_BUF (1024*1024*1) //1m #define MAX_BUF (1024*1024*1) //1m
#endif
#define ITERS_15US 125500
#define MULTIPLE 5
#define SPIN_ITERS (ITERS_15US*MULTIPLE)
__attribute__((optnone)) static void
wrk(void)
{
unsigned int spin = 0;
while (spin < SPIN_ITERS) {
//__asm__ __volatile__("nop": : :"memory");
spin++;
}
}
//__attribute__((optnone)) int //__attribute__((optnone)) int
int int

@ -0,0 +1,24 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.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 = rdtsc(), en = 0;
// wrk();
// en = rdtsc();
// 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;
}

@ -0,0 +1,24 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.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 = rdtsc(), en = 0;
// wrk();
// en = rdtsc();
// 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;
}

@ -0,0 +1,24 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.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 = rdtsc(), en = 0;
// wrk();
// en = rdtsc();
// 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;
}

@ -0,0 +1,24 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.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 = rdtsc(), en = 0;
// wrk();
// en = rdtsc();
// 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