build system for perf/C and perf/C++

This commit is contained in:
Martin Sustrik
2009-08-30 15:47:39 +02:00
parent 6c36673949
commit 314deb6185
14 changed files with 86 additions and 38 deletions

20
perf/cpp/Makefile.am Normal file
View File

@@ -0,0 +1,20 @@
INCLUDES = -I$(top_builddir)/include
bin_PROGRAMS = local_lat remote_lat local_thr remote_thr
local_lat_LDADD = $(top_builddir)/src/libzmq.la
local_lat_SOURCES = local_lat.cpp
local_lat_CXXFLAGS = -Wall -pedantic -Werror
remote_lat_LDADD = $(top_builddir)/src/libzmq.la
remote_lat_SOURCES = remote_lat.cpp
remote_lat_CXXFLAGS = -Wall -pedantic -Werror
local_thr_LDADD = $(top_builddir)/src/libzmq.la
local_thr_SOURCES = local_thr.cpp
local_thr_CXXFLAGS = -Wall -pedantic -Werror
remote_thr_LDADD = $(top_builddir)/src/libzmq.la
remote_thr_SOURCES = remote_thr.cpp
remote_thr_CXXFLAGS = -Wall -pedantic -Werror

View File

@@ -22,6 +22,7 @@
#include <stdlib.h>
#include <unistd.h>
#include <assert.h>
#include <stddef.h>
int main (int argc, char *argv [])
{
@@ -32,7 +33,7 @@ int main (int argc, char *argv [])
}
const char *bind_to = argv [1];
int roundtrip_count = atoi (argv [2]);
int message_size = atoi (argv [3]);
size_t message_size = (size_t) atoi (argv [3]);
zmq::context_t ctx (1, 1);

View File

@@ -21,6 +21,8 @@
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <stddef.h>
#include <stdint.h>
#include <sys/time.h>
int main (int argc, char *argv [])
@@ -32,7 +34,7 @@ int main (int argc, char *argv [])
}
const char *bind_to = argv [1];
int message_count = atoi (argv [2]);
int message_size = atoi (argv [3]);
size_t message_size = (size_t) atoi (argv [3]);
zmq::context_t ctx (1, 1);
@@ -59,10 +61,10 @@ int main (int argc, char *argv [])
end.tv_sec -= start.tv_sec;
start.tv_sec = 0;
long long elapsed = (end.tv_sec * 1000000 + end.tv_usec) -
(start.tv_sec * 1000000 + start.tv_usec);
uint64_t elapsed = ((uint64_t) end.tv_sec * 1000000 + end.tv_usec) -
((uint64_t) start.tv_sec * 1000000 + start.tv_usec);
long long throughput = (long long) message_count * 1000000 / elapsed;
uint64_t throughput = (uint64_t) message_count * 1000000 / elapsed;
printf ("message size: %d [B]\n", (int) message_size);
printf ("message count: %d\n", (int) message_count);

View File

@@ -21,6 +21,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <stddef.h>
#include <sys/time.h>
int main (int argc, char *argv [])
@@ -32,7 +33,7 @@ int main (int argc, char *argv [])
}
const char *connect_to = argv [1];
int roundtrip_count = atoi (argv [2]);
int message_size = atoi (argv [3]);
size_t message_size = (size_t) atoi (argv [3]);
zmq::context_t ctx (1, 1);

View File

@@ -22,6 +22,7 @@
#include <stdlib.h>
#include <unistd.h>
#include <assert.h>
#include <stddef.h>
int main (int argc, char *argv [])
{
@@ -32,7 +33,7 @@ int main (int argc, char *argv [])
}
const char *connect_to = argv [1];
int message_count = atoi (argv [2]);
int message_size = atoi (argv [3]);
size_t message_size = (size_t) atoi (argv [3]);
zmq::context_t ctx (1, 1);