From 54bc7f29c449daeebfee635fea6d7c3e4f8abda1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Milo=C5=A1=20Mula=C4=8D?= Date: Fri, 7 Mar 2008 14:21:58 +0000 Subject: [PATCH] enable also Direct logging, bypassing LL and IL --- org.glite.lb.client/examples/stresslog.c | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/org.glite.lb.client/examples/stresslog.c b/org.glite.lb.client/examples/stresslog.c index efe45b6..9dc276c 100644 --- a/org.glite.lb.client/examples/stresslog.c +++ b/org.glite.lb.client/examples/stresslog.c @@ -16,19 +16,21 @@ extern int opterr,optind; 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 int edg_wll_DoLogEventDirect(edg_wll_Context context, edg_wll_LogLine logline); static const char *me; static void usage() { - fprintf(stderr,"usage: %s -m bkserver [-x] [-N numjobs] [-n subjobs (each)] -f file_name \n", me); + fprintf(stderr,"usage: %s -m bkserver [-x|-y] [-N numjobs] [-n subjobs (each)] -f file_name \n", me); + fprintf(stderr," - event file not containing DG.JOBID and without -x or -z not containing DG.USER\n"); } int main(int argc, char *argv[]) { char *job = NULL,*server = NULL,*seq = NULL,*filename = NULL; char buf[MAXMSGSIZE]; - int lbproxy = 0, num_subjobs = 0; + int lbproxy = 0, num_subjobs = 0, lbdirect = 0; int done = 0, njobs = 1,i,j; edg_wll_Context ctx; edg_wlc_JobId jobid,*subjobs; @@ -41,9 +43,10 @@ int main(int argc, char *argv[]) me = strdup(argv[0]); do { - switch (getopt(argc,argv,"m:xN:n:f:")) { + switch (getopt(argc,argv,"m:xyN:n:f:")) { case 'm': server = strdup(optarg); break; case 'x': lbproxy = 1; break; + case 'y': lbdirect = 1; break; case 'N': njobs = atoi(optarg); break; case 'n': num_subjobs = atoi(optarg); break; case 'f': filename = (char *) strdup(optarg); break; @@ -51,6 +54,12 @@ int main(int argc, char *argv[]) case -1: done = 1; break; } } while (!done); + + if (lbproxy && lbdirect) { + fprintf(stderr,"%s: only one of -x or -y options may be specified \n",me); + usage(); + exit(1); + } if (!server) { fprintf(stderr,"%s: -m required\n",me); @@ -134,6 +143,13 @@ for (i = 0; i