ifdef LB_PERF
LB_PERF_FLAGS:=-DLB_PERF -DLB_PERF_DROP
LB_PERF_TOOLS:=perftest_logjobs
- COMMON_LIB:=-lglite_lb_common_perf_${nothrflavour}
- COMMON_LIB_THR:=-lglite_lb_common_perf_${thrflavour}
-else
- COMMON_LIB:=-lglite_lb_common_${nothrflavour}
- COMMON_LIB_THR:=-lglite_lb_common_${thrflavour}
endif
+COMMON_LIB:=-lglite_lb_common_${nothrflavour}
+COMMON_LIB_THR:=-lglite_lb_common_${thrflavour}
CFLAGS:=${DEBUG} \
-I${top_srcdir}/src -I${top_srcdir}/interface \
${INSTALL} -m 755 "$$p" "${PREFIX}/examples/glite-lb-$$p"; \
done
${INSTALL} -m 755 ${top_srcdir}/examples/export.sh "${PREFIX}/examples/glite-lb-export.sh"
+ ${INSTALL} -m 755 ${top_srcdir}/examples/log_dag.sh "${PREFIX}/examples/glite-lb-log_dag.sh"
${INSTALL} -m 644 ${MAN_GZ} ${PREFIX}/share/man/man1
clean:
#include <unistd.h>
#include <string.h>
#include <getopt.h>
-
+#include "glite/lb/context-int.h"
#include "glite/lb/lb_perftest.h"
+extern int edg_wll_DoLogEvent(edg_wll_Context context, edg_wll_LogLine logline);
+extern int edg_wll_DoLogEventProxy(edg_wll_Context context, edg_wll_LogLine logline);
+
/*
extern char *optarg;
extern int opterr,optind;
{
char *destname= NULL,*testname = NULL,*filename = NULL;
+ char *event;
int lbproxy = 0, num_jobs = 1;
int opt;
+ edg_wll_Context ctx;
+
+ edg_wll_InitContext(&ctx);
opterr = 0;
fprintf(stderr,"%s: glite_wll_perftest_init failed\n",argv[0]);
}
+ while (glite_wll_perftest_produceEventString(&event)) {
+ if (lbproxy) {
+ ctx->p_tmp_timeout = ctx->p_sync_timeout;
+ if (edg_wll_DoLogEventProxy(ctx,event)) {
+ char *et,*ed;
+ edg_wll_Error(ctx,&et,&ed);
+ fprintf(stderr,"edg_wll_DoLogEvent(): %s (%s)\n",et,ed);
+ exit(1);
+ }
+ } else {
+ ctx->p_tmp_timeout = ctx->p_log_timeout;
+ if (edg_wll_DoLogEvent(ctx,event)) {
+ char *et,*ed;
+ edg_wll_Error(ctx,&et,&ed);
+ fprintf(stderr,"edg_wll_DoLogEvent(): %s (%s)\n",et,ed);
+ exit(1);
+ }
+
+ }
+ }
+ edg_wll_FreeContext(ctx);
return 0;
}
JOBID_LIB:=-lglite_wmsutils_cjobid
endif
-ifdef LB_PERF
- PERF_HDRS:=lb_perftest.h
- PERF_OBJS:=lb_perftest.o
-endif
+PERF_HDRS:=lb_perftest.h
+PERF_OBJS:=lb_perftest.o
CFLAGS:=${DEBUG} -I${top_srcdir}/src -I${top_srcdir}/interface \
-I. \
xml_conversions.h log_proto.h events_parse.h il_string.h il_msg.h \
escape.h ulm_parse.h trio.h lb_maildir.h ${PERF_HDRS}
-ifdef LB_PERF
-STATICLIB:=libglite_lb_common_perf_${nothrflavour}.a
-THRSTATICLIB:=libglite_lb_common_perf_${thrflavour}.a
-LTLIB:=libglite_lb_common_perf_${nothrflavour}.la
-THRLTLIB:=libglite_lb_common_perf_${thrflavour}.la
-else
STATICLIB:=libglite_lb_common_${nothrflavour}.a
THRSTATICLIB:=libglite_lb_common_${thrflavour}.a
LTLIB:=libglite_lb_common_${nothrflavour}.la
THRLTLIB:=libglite_lb_common_${thrflavour}.la
-endif
REPORTS:=${top_srcdir}/reports
glite_wll_perftest_consumeEventString(const char *event_string);
int
-glite_wll_perftest_consumeEventIlMsg(const char *msg, int len);
+glite_wll_perftest_consumeEventIlMsg(const char *msg);
int
glite_wll_perftest_createJobId(const char *bkserver,
int
-glite_wll_perftest_consumeEventIlMsg(const char *msg, int len)
+glite_wll_perftest_consumeEventIlMsg(const char *msg)
{
int ret = 0;
char *event;
gettimeofday(&endtime, NULL);
/* decode event */
- if(decode_il_msg(&event, msg+17) < 0) {
+ if(decode_il_msg(&event, msg) < 0) {
fprintf(stderr, "PERFTEST: error decoding consumed event, aborting!\n");
abort();
}
${LINK} -o $@ ${LOGD_OBJS} ${COMMON_LIB}_${nothrflavour}
glite_lb_logd_perf: ${LOGD_OBJS}
- ${LINK} -o $@ ${LOGD_OBJS} ${COMMON_LIB}_perf_${nothrflavour}
+ ${LINK} -o $@ ${LOGD_OBJS} ${COMMON_LIB}_${nothrflavour}
glite_lb_logd_nofile: ${LOGD_NOBJS}
${LINK} -o $@ ${LOGD_NOBJS} ${COMMON_LIB}_${nothrflavour}
glite_lb_logd_perf_nofile: ${LOGD_NOBJS}
- ${LINK} -o $@ ${LOGD_NOBJS} ${COMMON_LIB}_perf_${nothrflavour}
+ ${LINK} -o $@ ${LOGD_NOBJS} ${COMMON_LIB}_${nothrflavour}
glite_lb_interlogd: ${INTERLOG_OBJS}
${LINK} -o $@ ${INTERLOG_OBJS} ${COMMON_LIB}_${thrflavour}
${LINK} -o $@ ${INTERLOG_NOBJS} ${COMMON_LIB}_${thrflavour}
glite_lb_interlogd_perf: ${INTERLOG_OBJS}
- ${LINK} -o $@ ${INTERLOG_OBJS} ${COMMON_LIB}_perf_${thrflavour}
+ ${LINK} -o $@ ${INTERLOG_OBJS} ${COMMON_LIB}_${thrflavour}
glite_lb_interlogd_perf_empty: ${INTERLOG_EMPTY_OBJS}
- ${LINK} -o $@ ${INTERLOG_EMPTY_OBJS} ${COMMON_LIB}_perf_${thrflavour}
+ ${LINK} -o $@ ${INTERLOG_EMPTY_OBJS} ${COMMON_LIB}_${thrflavour}
glite_lb_interlogd_perf_inline_empty: ${INTERLOG_INLINE_EMPTY_OBJS}
${LINK} -o $@ ${INTERLOG_INLINE_EMPTY_OBJS} \
- ${COMMON_LIB}_perf_${thrflavour}
+ ${COMMON_LIB}_${thrflavour}
stage: compile
$(MAKE) install PREFIX=${stagedir} DOSTAGE=yes
#include "logd_proto.h"
#include "glite/lb/consumer.h"
#include "glite/security/glite_gss.h"
+#ifdef LB_PERF
+#include "glite/lb/lb_perftest.h"
+#endif
static const char rcsid[] = "@(#)$Id$";
static int verbose = 0;
if (mysignal(SIGTERM, handle_signal) == SIG_ERR) { perror("signal"); exit(1); }
if (mysignal(SIGCHLD, handle_signal) == SIG_ERR) { perror("signal"); exit(1); }
+#ifdef LB_PERF
+ glite_wll_perftest_init(NULL, NULL, NULL, NULL, 0);
+#endif
+
edg_wll_gss_watch_creds(cert_file,&cert_mtime);
/* XXX DK: support noAuth */
ret = edg_wll_gss_acquire_cred_gsi(cert_file, key_file, &cred, &my_subject_name,
/* if not command, save message to file */
+#ifdef LOGD_NOFILE
+ edg_wll_ll_log(LOG_DEBUG,"Calling perftest\n");
+ glite_wll_perftest_consumeEventString(msg);
+ edg_wll_ll_log(LOG_DEBUG,"o.k.\n");
+ filepos = 0;
+#else
if(strstr(msg, "DG.TYPE=\"command\"") == NULL) {
/* compose the name of the log file */
-// edg_wll_ll_log(LOG_DEBUG,"Composing filename from prefix \"%s\" and jobId \"%s\"...",prefix,jobId);
+ edg_wll_ll_log(LOG_DEBUG,"Composing filename from prefix \"%s\" and jobId \"%s\"...",prefix,jobId);
count = strlen(prefix);
strncpy(outfilename,prefix,count); count_total=count;
strncpy(outfilename+count_total,".",1); count_total+=1; count=strlen(jobId);
strncpy(outfilename+count_total,jobId,count); count_total+=count;
outfilename[count_total]='\0';
-// edg_wll_ll_log(LOG_DEBUG,"o.k.\n");
-#ifndef LOGD_NOFILE
+ edg_wll_ll_log(LOG_DEBUG,"o.k.\n");
edg_wll_ll_log(LOG_INFO,"Writing message to \"%s\"...",outfilename);
i = 0;
free(errd);
goto edg_wll_log_proto_server_end;
} else edg_wll_ll_log(LOG_INFO,"o.k.");
-#endif
} else {
filepos = 0;
}
+#endif
/* if not priority send now the answer back to client */
}
#ifdef LB_PERF
} else {
- glite_wll_perftest_consumeEventIlMsg(msg->msg);
+ glite_wll_perftest_consumeEventIlMsg(msg->msg+17);
code = LB_OK;
}
#endif
TEST_LIBS:=-L${cppunit_prefix}/lib -lcppunit
TEST_INC:=-I${cppunit_prefix}/include
+ifdef LB_PERF
+ STATIC_LIB_BK:=${stagedir}/lib/libglite_lb_bkserver_perf.a
+ LB_PERF_FLAGS:=-DLB_PERF
+else
+ STATIC_LIB_BK:=${stagedir}/lib/libglite_lb_bkserver.a
+endif
+
SUFFIXES = .T
DEBUG:=-g -O0 -Wall
-I${mysql_prefix}/include -I${mysql_prefix}/include/mysql \
-I${globus_prefix}/include/${nothrflavour} \
-I${gridsite_prefix}/include -I${globus_prefix}/include/${nothrflavour}/openssl \
- -D_GNU_SOURCE ${LB_STANDALONE_FLAGS}
+ -D_GNU_SOURCE ${LB_STANDALONE_FLAGS} ${LB_PERF_FLAGS}
LINK:=libtool --mode=link ${CC} ${LDFLAGS}
SRVBONES_LIB:= -L${stagedir}/lib -lglite_lb_server_bones
-LB_SERVER_SHARE_LIB:=${stagedir}/lib/libglite_lb_bkserver.a
-LB_PROXY_COMMON_LIB:= -L${stagedir}/lib -lglite_lb_common_${nothrflavour}
-COMMON_LIBS:= -L${stagedir}/lib -lglite_lb_common_${nothrflavour} -lglite_security_gss_${nothrflavour}
GRIDSITE_LIBS = -lgridsite_globus `xml2-config --libs`
vomsflavour := _${nothrflavour}
LB_PROXY_LIBS:= \
- ${LB_SERVER_SHARE_LIB} \
+ ${STATIC_LIB_BK} \
${SRVBONES_LIB} \
-lglite_lb_common_${nothrflavour} \
-lglite_security_gss_${nothrflavour} \
-glite_lb_proxy: lbproxy.o fake_write2rgma.o ${LB_SERVER_SHARE_LIB}
+glite_lb_proxy: lbproxy.o fake_write2rgma.o ${STATIC_LIB_BK}
@echo DEBUG: mysql_version=${mysql_version} mysql_prefix=${mysql_prefix}
@echo DEBUG: shell: x$(shell echo ${mysql_version} | cut -d. -f1,2)x
${LINK} -o $@ lbproxy.o fake_write2rgma.o ${LB_PROXY_LIBS}
#include "glite/lb/srvbones.h"
#include "glite/lb/context.h"
#include "glite/lb/context-int.h"
+#ifdef LB_PERF
+#include "glite/lb/lb_perftest.h"
+#endif
extern int edg_wll_DBCheckVersion(edg_wll_Context);
extern edg_wll_ErrorCode edg_wll_Open(edg_wll_Context ctx, char *cs);
cdata->mysql = ctx->mysql;
edg_wll_FreeContext(ctx);
+#ifdef LB_PERF
+ glite_wll_perftest_init(NULL, NULL, NULL, NULL, 0);
+#endif
+
*data = cdata;
return 0;
}
# GLITE_LB_SERVER_WITH_WS=no
endif
+ifdef LB_PERF
+ STATIC_LIB_BK:=libglite_lb_bkserver_perf.a
+ LB_PERF_FLAGS:=-DLB_PERF
+else
+ STATIC_LIB_BK:=libglite_lb_bkserver.a
+endif
+
ifeq ($(GLITE_LB_SERVER_WITH_WS),yes)
WS_CFLAGS=-DGLITE_LB_SERVER_WITH_WS
NSMAP=LoggingAndBookkeeping.nsmap
-I${mysql_prefix}/include -I${mysql_prefix}/include/mysql \
-I${globus_prefix}/include/${nothrflavour} \
$(GRIDSITE_CFLAGS) \
- -D_GNU_SOURCE ${LB_STANDALONE_FLAGS}
+ -D_GNU_SOURCE ${LB_STANDALONE_FLAGS} ${LB_PERF_FLAGS}
TEST_LIBS:=-L${cppunit_prefix}/lib -lcppunit
TEST_INC:=-I${cppunit_prefix}/include
lock.o openserver.o query.o userjobs.o db_store.o request.o store.o \
stored_master.o srv_purge.o server_state.o dump.o lb_authz.o load.o \
notification.o il_notification.o notif_match.o stats.o
-STATIC_LIB_BK:=libglite_lb_bkserver.a
glite_lb_bkserverd: ${NSMAP} ${BKSERVER_OBJS}
${LINKXX} -o $@ ${BKSERVER_OBJS} ${BKSERVER_LIBS}
edg_wll_ResetError(ctx);
ret = read_il_data(ctx, &buf, gss_plain_reader);
if ( ret < 0 ) return(ret);
-
+#ifdef LB_PERF
+ glite_wll_perftest_consumeEventIlMsg(buf);
+#else
if ( !(ret = handle_request(ctx, buf)) ) {
if ( (err = edg_wll_Error(ctx, NULL, &errd)) ) edg_wll_ResetError(ctx);
}
+#endif
free(buf);
+
if ( (len = create_reply(ctx, &buf)) > 0 ) {
if ( edg_wll_plain_write_full(&ctx->connProxy->conn, buf, len, &ctx->p_tmp_timeout) < 0 ) {
if ( errd ) free(errd);