Commit 8a76c248 authored by Tomasz Zawadzki's avatar Tomasz Zawadzki
Browse files

event/app: allow to enable log flag for release builds



Log flags could also report on SPDK_LOG_INFO level by using
SPDK_INFOLOG() macro. Yet this did not result in additional
log due to check for debug build.

This patch allows release builds to use that flag.
Meanwhile the -L option besides turning on particular log flag
changes print log level to SPDK_LOG_DEBUG.

Applied changes to serveral applications to follow the
behaviour of event framework.

Signed-off-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: Ib0d6cce33263c350d6d83300d60e7d15bdfe4b64
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4557


Reviewed-by: default avatarJacek Kalwas <jacek.kalwas@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarAleksey Marchuk <alexeymar@mellanox.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
parent 779a6bdf
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -26,6 +26,10 @@ A log flag structure, `spdk_log_register_flag`, `spdk_log_get_first_flag`,
enable registering and interacting with log flags. Added `SPDK_INFOLOG`, `SPDK_DEBUGLOG`
and `SPDK_LOGDUMP` macros to display logs for specified log flag.

The log flags in the event framework `-L` and several SPDK applications has been enabled on
release builds of SPDK. On debug builds this option will additionally set
log print level to `SPDK_LOG_DEBUG`.

### ocf

Updated OCF submodule to v20.03.1
+4 −4
Original line number Diff line number Diff line
@@ -45,7 +45,7 @@ Param | Long Param | Type | Default | Descript
-W       | --pci-whitelist        | B:D:F    |                        | @ref cmd_arg_pci_blacklist_whitelist.
-R       | --huge-unlink          | flag     |                        | @ref cmd_arg_huge_unlink
|        | --huge-dir             | string   | the first discovered   | allocate hugepages from a specific mount
-L       | --logflag              | string   |                        | @ref cmd_arg_debug_log_flags
-L       | --logflag              | string   |                        | @ref cmd_arg_log_flags

### Configuration file {#cmd_arg_config_file}

@@ -137,11 +137,11 @@ By default, each DPDK-based application tries to remove any orphaned hugetlbfs
files during its initialization. This option removes hugetlbfs files of the current
process as soon as they're created, but is not compatible with `--shm-id`.

### Debug log {#cmd_arg_debug_log_flags}
### Log flag {#cmd_arg_log_flags}

Enable a specific debug log type. This option can be used more than once. A list of
Enable a specific log type. This option can be used more than once. A list of
all available types is provided in the `--help` output, with `--logflag all`
enabling all of them. Debug logs are only available in debug builds of SPDK.
enabling all of them. Additionally enables debug print level in debug builds of SPDK.

## CPU mask {#cpu_mask}

+1 −5
Original line number Diff line number Diff line
@@ -711,12 +711,8 @@ parse_args(int argc, char **argv)
				usage(argv[0]);
				exit(EXIT_FAILURE);
			}
#ifdef DEBUG
			spdk_log_set_print_level(SPDK_LOG_DEBUG);
#ifndef DEBUG
			fprintf(stderr, "%s must be rebuilt with CONFIG_DEBUG=y for -T flag.\n",
				argv[0]);
			usage(argv[0]);
			return 0;
#endif
			break;
		default:
+1 −5
Original line number Diff line number Diff line
@@ -1830,12 +1830,8 @@ parse_args(int argc, char **argv)
				usage(argv[0]);
				exit(EXIT_FAILURE);
			}
#ifdef DEBUG
			spdk_log_set_print_level(SPDK_LOG_DEBUG);
#ifndef DEBUG
			fprintf(stderr, "%s must be rebuilt with CONFIG_DEBUG=y for -L flag.\n",
				argv[0]);
			usage(argv[0]);
			return 0;
#endif
			break;
		case 'H':
+1 −5
Original line number Diff line number Diff line
@@ -1936,12 +1936,8 @@ parse_args(int argc, char **argv)
				usage(argv[0]);
				exit(EXIT_FAILURE);
			}
#ifdef DEBUG
			spdk_log_set_print_level(SPDK_LOG_DEBUG);
#ifndef DEBUG
			fprintf(stderr, "%s must be rebuilt with CONFIG_DEBUG=y for -T flag.\n",
				argv[0]);
			usage(argv[0]);
			return 0;
#endif
			break;
		case 'V':
Loading