Commit b4b7d5d3 authored by Jim Harris's avatar Jim Harris
Browse files

log: remove "trace" from public API



Signed-off-by: default avatarJim Harris <james.r.harris@intel.com>
Change-Id: I90e7d698cae7577736319e38f089e3b759c9beef

Reviewed-on: https://review.gerrithub.io/435343


Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
parent 3dc8dfb4
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -408,7 +408,7 @@ show_bs_cb(void *arg1, spdk_blob_id blobid, int bserrno)
	printf("\t# free clusters: %" PRIu64 "\n", val);

	bstype = spdk_bs_get_bstype(cli_context->bs);
	spdk_trace_dump(stdout, "\tblobstore type:", &bstype, sizeof(bstype));
	spdk_log_dump(stdout, "\tblobstore type:", &bstype, sizeof(bstype));

	/*
	 * Private info isn't accessible via the public API but
@@ -466,7 +466,7 @@ show_blob(struct cli_context_t *cli_context)
		printf("\n(%d) Name:%s\n", i,
		       spdk_xattr_names_get_name(names, i));
		printf("(%d) Value:\n", i);
		spdk_trace_dump(stdout, "", value, value_len);
		spdk_log_dump(stdout, "", value, value_len);
	}

	/*
+2 −2
Original line number Diff line number Diff line
@@ -1588,7 +1588,7 @@ usage(const char *program_name)
	printf("     subnqn      Subsystem NQN (default: %s)\n", SPDK_NVMF_DISCOVERY_NQN);
	printf("    Example: -r 'trtype:RDMA adrfam:IPv4 traddr:192.168.100.8 trsvcid:4420'\n");

	spdk_tracelog_usage(stdout, "-L");
	spdk_log_usage(stdout, "-L");

	printf(" -i         shared memory group ID\n");
	printf(" -p         core number in decimal to run this application which started from 0\n");
@@ -1632,7 +1632,7 @@ parse_args(int argc, char **argv)
			g_hex_dump = true;
			break;
		case 'L':
			rc = spdk_log_set_trace_flag(optarg);
			rc = spdk_log_set_flag(optarg);
			if (rc < 0) {
				fprintf(stderr, "unknown flag\n");
				usage(argv[0]);
+1 −1
Original line number Diff line number Diff line
@@ -109,7 +109,7 @@ get_host_identifier(struct spdk_nvme_ctrlr *ctrlr)
	}

	if (get_host_id_successful) {
		spdk_trace_dump(stdout, "Get Feature: Host Identifier:", host_id, host_id_size);
		spdk_log_dump(stdout, "Get Feature: Host Identifier:", host_id, host_id_size);
	}

	return 0;
+16 −16
Original line number Diff line number Diff line
@@ -140,47 +140,47 @@ void spdk_log(enum spdk_log_level level, const char *file, const int line, const
	      const char *format, ...) __attribute__((__format__(__printf__, 5, 6)));

/**
 * Dump the trace to a file.
 * Log the contents of a raw buffer to a file.
 *
 * \param fp File to hold the trace.
 * \param fp File to hold the log.
 * \param label Label to print to the file.
 * \param buf Buffer that holds the trace information.
 * \param len Length of trace to dump.
 * \param buf Buffer that holds the log information.
 * \param len Length of buffer to dump.
 */
void spdk_trace_dump(FILE *fp, const char *label, const void *buf, size_t len);
void spdk_log_dump(FILE *fp, const char *label, const void *buf, size_t len);

/**
 * Check whether the trace flag exists and is enabled.
 * Check whether the log flag exists and is enabled.
 *
 * \return true if enabled, or false otherwise.
 */
bool spdk_log_get_trace_flag(const char *flag);
bool spdk_log_get_flag(const char *flag);

/**
 * Enable the trace flag.
 * Enable the log flag.
 *
 * \param flag Trace flag to be enabled.
 * \param flag Log flag to be enabled.
 *
 * \return 0 on success, -1 on failure.
 */
int spdk_log_set_trace_flag(const char *flag);
int spdk_log_set_flag(const char *flag);

/**
 * Clear a trace flag.
 * Clear a log flag.
 *
 * \param flag Trace flag to clear.
 * \param flag Log flag to clear.
 *
 * \return 0 on success, -1 on failure.
 */
int spdk_log_clear_trace_flag(const char *flag);
int spdk_log_clear_flag(const char *flag);

/**
 * Show all the log trace flags and their usage.
 * Show all the log flags and their usage.
 *
 * \param f File to hold all the flags' information.
 * \param trace_arg Command line option to set/enable the trace flag.
 * \param log_arg Command line option to set/enable the log flag.
 */
void spdk_tracelog_usage(FILE *f, const char *trace_arg);
void spdk_log_usage(FILE *f, const char *log_arg);

#ifdef __cplusplus
}
+1 −1
Original line number Diff line number Diff line
@@ -89,7 +89,7 @@ __attribute__((constructor)) static void register_trace_flag_##flag(void) \
	do {										\
		extern struct spdk_log_flag FLAG;					\
		if ((FLAG.enabled) && (LEN)) {						\
			spdk_trace_dump(stderr, (LABEL), (BUF), (LEN));			\
			spdk_log_dump(stderr, (LABEL), (BUF), (LEN));			\
		}									\
	} while (0)

Loading