4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 only,
8 * as published by the Free Software Foundation.
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License version 2 for more details (a copy is included
14 * in the LICENSE file that accompanied this code).
16 * You should have received a copy of the GNU General Public License
17 * version 2 along with this program; If not, see
18 * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
20 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
21 * CA 95054 USA or visit www.sun.com if you need additional information or
27 * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
28 * Use is subject to license terms.
30 * Copyright (c) 2013, Intel Corporation.
33 * This file is part of Lustre, http://www.lustre.org/
34 * Lustre is a trademark of Sun Microsystems, Inc.
36 * lustre/utils/loadgen.c
38 * See how many local OSCs we can start whaling on a OST
39 * We're doing direct ioctls instead of going though a system() call to lctl
40 * to avoid the bash overhead.
41 * Adds an osc / echo client pair in each thread and starts echo transactions.
43 * Author: Nathan Rutman <nathan@clusterfs.com>
50 #include <sys/types.h>
60 #include <lnet/lnetctl.h>
61 #include <libcfs/libcfsutil.h>
62 #include <lustre_ioctl.h>
65 static char cmdname[512];
66 static char target[64] = "";
68 static int sig_received = 0;
69 static int o_verbose = 4; /* 0-5 */
70 static int my_oss = 0;
71 static int my_ecs = 0;
73 static int jt_quit(int argc, char **argv) {
74 Parser_quit(argc, argv);
78 static int loadgen_usage(int argc, char **argv)
82 "This is a test program used to simulate large numbers of\n"
83 "clients. The echo obds are used, so the obdecho module must\n"
85 "Typical usage would be:\n"
86 " loadgen> dev lustre-OST0000 set the target device\n"
87 " loadgen> start 20 start 20 echo clients\n"
88 " loadgen> wr 10 5 have 10 clients do the brw_write\n"
89 " test 5 times each\n"
92 return (Parser_help(argc, argv));
95 static int loadgen_verbose(int argc, char **argv);
96 static int loadgen_target(int argc, char **argv);
97 static int loadgen_start_echosrv(int argc, char **argv);
98 static int loadgen_start_clients(int argc, char **argv);
99 static int loadgen_wait(int argc, char **argv);
100 static int loadgen_write(int argc, char **argv);
102 command_t cmdlist[] = {
103 {"device", loadgen_target, 0,
104 "set target ost name (e.g. lustre-OST0000)\n"
105 "usage: device <name> [<nid>]"},
106 {"dl", jt_obd_list, 0, "show all devices\n"
108 {"echosrv", loadgen_start_echosrv, 0, "start an echo server\n"},
109 {"start", loadgen_start_clients, 0, "set up echo clients\n"
110 "usage: start_clients <num>"},
111 {"verbose", loadgen_verbose, 0, "set verbosity level 0-5\n"
112 "usage: verbose <level>"},
113 {"wait", loadgen_wait, 0,
114 "wait for all threads to finish\n"},
115 {"write", loadgen_write, 0,
116 "start a test_brw write test on X clients for Y iterations\n"
117 "usage: write <num_clients> <num_iter> [<delay>]"},
119 /* User interface commands */
120 {"help", loadgen_usage, 0, "help"},
121 {"exit", jt_quit, 0, "quit"},
122 {"quit", jt_quit, 0, "quit"},
128 #define C_STOP 0x0001
129 #define C_CREATE_EVERY 0x0002 /* destroy and recreate every time */
130 #define C_READ 0x0004
131 #define C_WRITE 0x0008
140 struct command_t k_cmd;
141 struct kid_t *k_next;
148 static int live_threads = 0;
149 static struct kid_t *kid_list = NULL;
150 pthread_mutex_t m_list = PTHREAD_MUTEX_INITIALIZER;
152 static struct kid_t *push_kid(int tnum)
155 kid = (struct kid_t *)calloc(1, sizeof(struct kid_t));
157 fprintf(stderr, "malloc failure\n");
160 kid->k_pthread = pthread_self();
161 pthread_mutex_lock(&m_list);
162 kid->k_next = kid_list;
166 pthread_mutex_unlock(&m_list);
170 int trigger_count = 0;
171 int waiting_count = 0;
174 struct timeval trigger_start;
175 struct command_t trigger_cmd;
176 pthread_mutex_t m_trigger = PTHREAD_MUTEX_INITIALIZER;
177 pthread_cond_t cv_trigger = PTHREAD_COND_INITIALIZER;
179 unsigned long long write_bytes;
180 pthread_mutex_t m_count = PTHREAD_MUTEX_INITIALIZER;
182 static void trigger(int command, int threads, int repeat, int delay)
185 pthread_mutex_lock(&m_trigger);
186 trigger_cmd.c_flags = command;
187 trigger_cmd.c_rpt = repeat;
188 trigger_cmd.c_delay = delay;
189 trigger_count = threads;
191 printf("trigger %d cmd c=%d f=%x\n", trigger_count,
192 trigger_cmd.c_rpt, trigger_cmd.c_flags);
193 gettimeofday(&trigger_start, NULL);
195 pthread_mutex_lock(&m_count);
197 pthread_mutex_unlock(&m_count);
199 pthread_cond_broadcast(&cv_trigger);
200 pthread_mutex_unlock(&m_trigger);
203 static __inline__ void stop_all(int unused)
208 static void kill_kids(void)
210 struct kid_t *tmp = kid_list;
213 trigger(C_STOP, 0, 0, 0);
215 pthread_kill(tmp->k_pthread, SIGTERM);
220 static void sig_master(int unused)
226 static int wait_for_threads()
228 struct kid_t *tmp = kid_list;
232 printf("waiting for %d children\n", live_threads);
235 rc = pthread_join(tmp->k_pthread, &statusp);
236 status = (long)statusp;
238 printf("%d: joined, rc = %d, status = %d\n",
239 tmp->k_id, rc, status);
240 kid_list = tmp->k_next;
247 printf("%s done, rc = %d\n", cmdname, rc);
251 static int write_proc(char *proc_path, char *value)
255 fd = open(proc_path, O_WRONLY);
257 fprintf(stderr, "open('%s') failed: %s\n",
258 proc_path, strerror(errno));
261 rc = write(fd, value, strlen(value));
263 fprintf(stderr, "write('%s') failed: %s\n",
264 proc_path, strerror(errno));
271 static int read_proc(char *proc_path, unsigned long long *value)
276 fd = open(proc_path, O_RDONLY);
278 fprintf(stderr, "open('%s') failed: %s\n",
279 proc_path, strerror(errno));
283 rc = read(fd, buf, sizeof(buf));
285 if (errno == EOPNOTSUPP) {
286 /* probably an echo server */
290 fprintf(stderr, "read('%s') failed: %s (%d)\n",
291 proc_path, strerror(errno), errno);
294 *value = strtoull(buf, NULL, 10);
298 static int grant_estimate(int thread)
300 unsigned long long avail, grant;
305 /* I don't really care about protecting this with a mutex */
312 /* Divide /proc/fs/lustre/osc/o_0001/kbytesavail
313 by /proc/fs/lustre/osc/o_0001/cur_grant_bytes to find max clients */
314 sprintf(proc_path, "/proc/fs/lustre/osc/o%.5d/kbytesavail", thread);
315 rc = read_proc(proc_path, &avail);
318 sprintf(proc_path, "/proc/fs/lustre/osc/o%.5d/cur_grant_bytes", thread);
319 rc = read_proc(proc_path, &grant);
325 printf("Estimate %llu clients before we run out of grant space "
326 "(%lluK / %llu)\n", (avail << 10) / grant, avail, grant);
331 /* We hold a thread mutex around create/cleanup because cur_dev is not
332 shared-memory safe */
333 pthread_mutex_t m_config = PTHREAD_MUTEX_INITIALIZER;
335 static int cleanup(char *obdname, int quiet)
340 pthread_mutex_lock(&m_config);
344 rc = jt_lcfg_device(2, args);
346 fprintf(stderr, "%s: can't configure '%s' (%d)\n",
347 cmdname, obdname, rc);
349 rc = jt_obd_cleanup(2, args);
351 fprintf(stderr, "%s: can't cleanup '%s' (%d)\n",
352 cmdname, obdname, rc);
353 rc = jt_obd_detach(1, args);
355 fprintf(stderr, "%s: can't detach '%s' (%d)\n",
356 cmdname, obdname, rc);
358 pthread_mutex_unlock(&m_config);
362 static int echocli_setup(char *oname, char *ename, int *dev)
368 pthread_mutex_lock(&m_config);
373 /* attach "osc" oscname oscuuid */
375 args[2] = args[3] = oname;
376 rc = jt_lcfg_attach(4, args);
378 fprintf(stderr, "%s: can't attach osc '%s' (%d)\n",
380 /* Assume we want e.g. an old one cleaned anyhow. */
383 /* setup ostname "OSS_UUID" */
385 args[2] = "OSS_UUID";
386 rc = jt_lcfg_setup(3, args);
388 fprintf(stderr, "%s: can't setup osc '%s' (%d)\n",
393 /* Large grants cause ENOSPC to be reported, even though
394 there's space left. We can reduce the grant size by
396 sprintf(proc_path, "/proc/fs/lustre/osc/%s/max_dirty_mb", oname);
397 rc = write_proc(proc_path, "1");
398 sprintf(proc_path, "/proc/fs/lustre/osc/%s/max_rpcs_in_flight", oname);
399 rc = write_proc(proc_path, "1");
402 /* attach "echo_client" echoname echouuid */
403 args[1] = "echo_client";
404 args[2] = args[3] = ename;
405 rc = jt_lcfg_attach(4, args);
407 fprintf(stderr, "%s: can't attach '%s' (%d)\n",
410 fprintf(stderr, "%s: is the obdecho module loaded?\n",
416 rc = jt_lcfg_setup(2, args);
418 fprintf(stderr, "%s: can't setup '%s' (%d)\n",
424 rc = jt_obd_device(2, args);
426 fprintf(stderr, "%s: can't set device '%s' (%d)\n",
432 *dev = jt_obd_get_device();
433 pthread_mutex_unlock(&m_config);
437 pthread_mutex_unlock(&m_config);
443 /* We can't use the libptlctl library fns because they are not shared-memory
444 safe with respect to the ioctl device (cur_dev) */
445 static int obj_ioctl(int cmd, struct obd_ioctl_data *data, int unpack)
450 //IOC_PACK(cmdname, data);
451 if (obd_ioctl_pack(data, &buf, sizeof(*data))) {
452 fprintf(stderr, "dev %d invalid ioctl\n", data->ioc_dev);
457 rc = l_ioctl(OBD_DEV_ID, cmd, buf);
460 //IOC_UNPACK(argv[0], data);
461 if (obd_ioctl_unpack(data, buf, sizeof(*data))) {
462 fprintf(stderr, "dev %d invalid reply\n", data->ioc_dev);
474 /* See jt_obd_create */
475 static int obj_create(struct kid_t *kid)
477 struct obd_ioctl_data data;
480 memset(&data, 0, sizeof(data));
481 data.ioc_dev = kid->k_dev;
482 data.ioc_obdo1.o_mode = 0100644;
483 ostid_set_seq_echo(&data.ioc_obdo1.o_oi);
484 ostid_set_id(&data.ioc_obdo1.o_oi, 1);
485 data.ioc_obdo1.o_uid = 0;
486 data.ioc_obdo1.o_gid = 0;
487 data.ioc_obdo1.o_valid = OBD_MD_FLTYPE | OBD_MD_FLMODE |
488 OBD_MD_FLID | OBD_MD_FLUID | OBD_MD_FLGID;
490 rc = obj_ioctl(OBD_IOC_CREATE, &data, 1);
492 fprintf(stderr, "%d: create (%d) %s\n",
493 kid->k_id, rc, strerror(errno));
497 if (!(data.ioc_obdo1.o_valid & OBD_MD_FLID)) {
498 fprintf(stderr, "%d: create oid not valid "LPX64"\n",
499 kid->k_id, data.ioc_obdo1.o_valid);
503 kid->k_objid = ostid_id(&data.ioc_obdo1.o_oi);
506 printf("%d: cr "LPX64"\n", kid->k_id, kid->k_objid);
511 /* See jt_obd_destroy */
512 static int obj_delete(struct kid_t *kid)
514 struct obd_ioctl_data data;
518 printf("%d: del "LPX64"\n", kid->k_id, kid->k_objid);
520 memset(&data, 0, sizeof(data));
521 data.ioc_dev = kid->k_dev;
522 ostid_set_id(&data.ioc_obdo1.o_oi, kid->k_objid);
523 data.ioc_obdo1.o_mode = S_IFREG | 0644;
524 data.ioc_obdo1.o_valid = OBD_MD_FLID | OBD_MD_FLMODE;
526 rc = obj_ioctl(OBD_IOC_DESTROY, &data, 1);
528 fprintf(stderr, "%s-%d: can't destroy obj "LPX64" (%d)\n",
529 cmdname, kid->k_id, kid->k_objid, rc);
535 #define difftime(a, b) \
536 ((a)->tv_sec - (b)->tv_sec + \
537 ((a)->tv_usec - (b)->tv_usec) / 1000000.0)
539 /* See jt_obd_test_brw */
540 static int obj_write(struct kid_t *kid)
542 struct obd_ioctl_data data;
543 struct timeval start;
545 int rc = 0, i, pages = 0;
548 printf("%d: wr "LPX64"\n", kid->k_id, kid->k_objid);
552 len = pages * getpagesize();
554 memset(&data, 0, sizeof(data));
555 data.ioc_dev = kid->k_dev;
556 /* communicate the 'type' of brw test and batching to echo_client.
557 * don't start. we'd love to refactor this lctl->echo_client
559 data.ioc_pbuf1 = (void *)1;
562 ostid_set_seq_echo(&data.ioc_obdo1.o_oi);
563 ostid_set_id(&data.ioc_obdo1.o_oi, kid->k_objid);
564 data.ioc_obdo1.o_mode = S_IFREG;
565 data.ioc_obdo1.o_valid = OBD_MD_FLID | OBD_MD_FLTYPE | OBD_MD_FLMODE |
566 OBD_MD_FLFLAGS | OBD_MD_FLGROUP;
567 data.ioc_obdo1.o_flags = OBD_FL_DEBUG_CHECK;
568 data.ioc_count = len;
571 gettimeofday(&start, NULL);
573 for (i = 1; i <= count; i++) {
574 data.ioc_obdo1.o_valid &= ~(OBD_MD_FLBLOCKS|OBD_MD_FLGRANT);
575 rc = obj_ioctl(OBD_IOC_BRW_WRITE, &data, 0);
577 fprintf(stderr, "%d: write %s\n", kid->k_id,
578 strerror(rc = errno));
582 data.ioc_offset += len;
589 gettimeofday(&end, NULL);
590 diff = difftime(&end, &start);
594 pthread_mutex_lock(&m_count);
595 write_bytes += i * len;
596 pthread_mutex_unlock(&m_count);
599 printf("%d: wrote %dx%d pages in %.3fs (%.3f MB/s): %s",
600 kid->k_id, i, pages, diff,
601 ((double)i * len) / (diff * 1048576.0),
606 fprintf(stderr, "%s-%d: err test_brw obj "LPX64" (%d)\n",
607 cmdname, kid->k_id, kid->k_objid, rc);
611 static int do_work(struct kid_t *kid)
613 int rc = 0, err, iter = 0;
615 if (!(kid->k_cmd.c_flags & C_CREATE_EVERY))
616 rc = obj_create(kid);
618 for (iter = 0; iter < kid->k_cmd.c_rpt; iter++) {
619 if (rc || sig_received)
622 if (kid->k_cmd.c_flags & C_CREATE_EVERY) {
623 rc = obj_create(kid);
628 if (kid->k_cmd.c_flags & C_WRITE) {
630 grant_estimate(kid->k_id);
633 if (kid->k_cmd.c_flags & C_CREATE_EVERY) {
634 err = obj_delete(kid);
638 if ((o_verbose > 3) && (iter % 10 == 0))
639 printf("%d: i%d\n", kid->k_id, iter);
641 sleep(kid->k_cmd.c_delay);
644 if (!(kid->k_cmd.c_flags & C_CREATE_EVERY)) {
645 err = obj_delete(kid);
650 printf("%d: done (%d)\n", kid->k_id, rc);
655 static void report_perf()
660 gettimeofday(&end, NULL);
661 diff = difftime(&end, &trigger_start);
663 pthread_mutex_lock(&m_count);
664 printf("wrote %lluMB in %.3fs (%.3f MB/s)\n",
665 write_bytes >> 20, diff,
666 (write_bytes >> 20) / diff);
667 pthread_mutex_unlock(&m_count);
671 static void *run_one_child(void *threadvp)
674 char oname[10], ename[10];
675 int thread = (long)threadvp, dev = 0;
679 printf("%s: running thread #%d\n", cmdname, thread);
681 sprintf(oname, "o%.5d", thread);
682 sprintf(ename, "e%.5d", thread);
683 rc = echocli_setup(oname, ename, &dev);
685 fprintf(stderr, "%s: can't setup '%s/%s' (%d)\n",
686 cmdname, oname, ename, rc);
687 pthread_exit((void *)(long)rc);
690 kid = push_kid(thread);
697 while(!(rc || sig_received)) {
698 pthread_mutex_lock(&m_trigger);
699 pthread_mutex_lock(&m_list);
701 if ((waiting_count == live_threads) && timer_on) {
706 pthread_mutex_unlock(&m_list);
707 pthread_cond_wait(&cv_trigger, &m_trigger);
711 /* First trigger_count threads will do the work, the rest
715 printf("%d: trigger %d cmd %x\n",
716 kid->k_id, trigger_count,
717 trigger_cmd.c_flags);
719 memcpy(&kid->k_cmd, &trigger_cmd, sizeof(trigger_cmd));
720 pthread_mutex_unlock(&m_trigger);
723 pthread_mutex_unlock(&m_trigger);
728 printf("%s: thread #%d done (%d)\n", cmdname, thread, rc);
734 err = cleanup(ename, 0);
736 err = cleanup(oname, 0);
739 pthread_exit((void *)(long)rc);
743 * PTHREAD_STACK_MIN is 16K minimal stack for threads. This
744 * is stack consumed by one thread, which executes NULL procedure.
745 * We need some more here and 20k stack for one client thread
746 * is enough to not overflow. In same time it does not consume
747 * a lot of memory for large number of threads.
749 * 20K virtual clients will only consume 320M + 400M. Still to
750 * create this number of virtual clients we need to fix 8192
753 #define CLIENT_THREAD_STACK_SIZE (PTHREAD_STACK_MIN + (20 * 1024))
755 static int loadgen_start_clients(int argc, char **argv)
758 struct timespec ts = {0, 1000*1000*100}; /* .1 sec */
764 numt = strtoul(argv[1], NULL, 0);
769 fprintf(stderr, "%s: target OST is not defined, use 'device' "
770 "command\n", cmdname);
774 rc = pthread_attr_init(&attr);
776 fprintf(stderr, "%s: pthread_attr_init:(%d) %s\n",
777 cmdname, rc, strerror(errno));
780 pthread_attr_setstacksize (&attr, CLIENT_THREAD_STACK_SIZE);
781 pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
783 numt += live_threads;
785 printf("start %d to %d\n", i, numt);
786 while(!rc && !sig_received && (i < numt)) {
790 rc = pthread_create(&thread, &attr, run_one_child,
793 fprintf(stderr, "%s: pthread: #%d - (%d) %s\n",
794 cmdname, i, rc, strerror(rc));
798 /* give them slightly different start times */
799 nanosleep(&ts, NULL);
802 pthread_attr_destroy(&attr);
807 static int loadgen_target(int argc, char **argv)
813 if (argc < 2 || argc > 3)
819 nidx = libcfs_str2nid(argv[2]);
820 if (nidx == LNET_NID_ANY) {
821 fprintf(stderr, "%s: invalid nid '%s'\n",
826 /* Local device should be in list */
828 rc = jt_obd_device(2, args);
830 fprintf(stderr, "%s: local device '%s' doesn't "
831 "seem to exist. You must use obdfilter device "
832 "names like 'lustre-OST0000'. Use 'dl' to "
833 "list all devices.\n",
838 /* Use the first local nid */
839 args[1] = (char *)(&nidx);
840 args[1][0] = 1; /* hack to get back first nid */
841 rc = jt_ptl_list_nids(2, args);
843 fprintf(stderr, "%s: can't get local nid (%d)\n",
848 if (strcmp(nid, libcfs_nid2str(nidx)) != 0) {
849 /* if new, do an add_uuid */
850 sprintf(nid, "%s", libcfs_nid2str(nidx));
852 /* Fixme change the uuid for every new one */
853 args[1] = "OSS_UUID";
855 rc = jt_lcfg_add_uuid(3, args);
857 fprintf(stderr, "%s: can't add uuid '%s' (%d)\n",
858 cmdname, args[2], rc);
863 snprintf(target, sizeof(target), "%s", argv[1]);
864 printf("Target OST name is '%s'\n", target);
869 static int loadgen_verbose(int argc, char **argv)
873 o_verbose = atoi(argv[1]);
874 printf("verbosity set to %d\n", o_verbose);
878 static int loadgen_write(int argc, char **argv)
882 if (argc < 3 || argc > 4)
884 threads = atoi(argv[1]);
885 pthread_mutex_lock(&m_list);
886 if (threads > live_threads) {
887 pthread_mutex_unlock(&m_list);
888 fprintf(stderr, "requested %d threads but only %d are running. "
889 "Use 'start' to start some more.\n",
890 threads, live_threads);
893 pthread_mutex_unlock(&m_list);
895 trigger(C_WRITE, threads, atoi(argv[2]),
896 (argc == 4) ? atoi(argv[3]) : 0);
900 char ecsname[] = "echosrv";
901 static int loadgen_stop_echosrv(int argc, char **argv)
903 int verbose = (argc != 9);
906 cleanup(name, verbose);
909 if (my_ecs || (argc == 9)) {
910 cleanup(ecsname, verbose);
916 static int loadgen_start_echosrv(int argc, char **argv)
921 pthread_mutex_lock(&m_config);
925 /* attach obdecho echosrv echosrv_UUID */
927 args[2] = args[3] = ecsname;
928 rc = jt_lcfg_attach(4, args);
930 fprintf(stderr, "%s: can't attach echo server (%d)\n",
932 /* Assume we want e.g. an old one cleaned anyhow. */
938 rc = jt_lcfg_setup(1, args);
940 fprintf(stderr, "%s: can't setup echo server (%d)\n",
945 /* Create an OSS to handle the communications */
946 /* attach ost OSS OSS_UUID */
948 args[2] = args[3] = "OSS";
950 rc = jt_lcfg_attach(4, args);
952 /* Already set up for somebody else, that's fine. */
953 printf("OSS already set up, no problem.\n");
954 pthread_mutex_unlock(&m_config);
958 fprintf(stderr, "%s: can't attach OSS (%d)\n",
965 rc = jt_lcfg_setup(1, args);
967 fprintf(stderr, "%s: can't setup OSS (%d)\n",
972 pthread_mutex_unlock(&m_config);
976 pthread_mutex_unlock(&m_config);
977 loadgen_stop_echosrv(9, argv);
981 static int loadgen_wait(int argc, char **argv)
983 /* Give scripts a chance to start some threads */
991 static int loadgen_init(int argc, char **argv)
996 sprintf(cmdname, "%s", argv[0]);
998 signal(SIGTERM, sig_master);
999 signal(SIGINT, sig_master);
1001 /* Test to make sure obdecho module is loaded */
1003 args[1] = "echo_client";
1004 args[2] = args[3] = "ecc_test";
1005 rc = jt_lcfg_attach(4, args);
1007 fprintf(stderr, "%s: can't attach echo client (%d)\n",
1010 fprintf(stderr, "%s: is the obdecho module loaded?\n",
1014 jt_obd_detach(1, args);
1020 static int loadgen_exit()
1024 printf("stopping %d children\n", live_threads);
1026 rc = wait_for_threads();
1028 loadgen_stop_echosrv(0, NULL);
1033 /* libptlctl interface */
1034 static int loadgen_main(int argc, char **argv)
1039 /* without this threaded errors cause segfault */
1042 if ((rc = ptl_initialize(argc, argv)) < 0)
1044 if ((rc = obd_initialize(argc, argv)) < 0)
1046 if ((rc = dbg_initialize(argc, argv)) < 0)
1049 Parser_init("loadgen> ", cmdlist);
1051 rc = loadgen_init(argc, argv);
1056 rc = Parser_execarg(argc - 1, argv + 1, cmdlist);
1058 rc = Parser_commands();
1061 rc = loadgen_exit();
1064 obd_finalize(argc, argv);
1065 return rc < 0 ? -rc : rc;
1068 #ifndef LIBLUSTRE_TEST
1069 int main (int argc, char **argv)
1072 rc = loadgen_main(argc, argv);
1073 pthread_exit((void *)(long)rc);