Commit 87696292 authored by Konrad Sztyber's avatar Konrad Sztyber
Browse files

test/stub: add option to enable logs



Enabling the logs can be very useful when debugging multiprocess issues.

Signed-off-by: default avatarKonrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I09d5ea2981eb4e949d34f84517cfa5619a02d07b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/24789


Reviewed-by: default avatarJim Harris <jim.harris@samsung.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <smatsumoto@nvidia.com>
parent 1e148deb
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -49,6 +49,7 @@ usage(char *executable_name)
	printf(" -i shared memory ID [required]\n");
	printf(" -m mask    core mask for DPDK\n");
	printf(" -n channel number of memory channels used for DPDK\n");
	printf(" -L flag    enable log flag\n");
	printf(" -p core    main (primary) core for DPDK\n");
	printf(" -s size    memory size in MB for DPDK\n");
	printf(" -t msec    sleep time (ms) between checking for admin completions\n");
@@ -146,9 +147,18 @@ main(int argc, char **argv)
	opts.rpc_addr = NULL;
	opts.env_context = "--proc-type=primary";

	while ((ch = getopt(argc, argv, "i:m:n:p:q:s:t:H")) != -1) {
	while ((ch = getopt(argc, argv, "i:m:n:p:q:s:t:HL:")) != -1) {
		if (ch == 'm') {
			opts.reactor_mask = optarg;
		} else if (ch == 'L') {
			if (spdk_log_set_flag(optarg) != 0) {
				SPDK_ERRLOG("unknown flag: %s\n", optarg);
				usage(argv[0]);
				exit(EXIT_FAILURE);
			}
#ifdef DEBUG
			opts.print_level = SPDK_LOG_DEBUG;
#endif
		} else if (ch == '?' || ch == 'H') {
			usage(argv[0]);
			exit(EXIT_SUCCESS);