Commit aa37b4f9 authored by Jim Harris's avatar Jim Harris Committed by Ben Walker
Browse files

spdk_trace: improve formatting



This ensures the per-event arguments are always lined
up in the output.

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

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


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
parent 8bcbe397
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -136,6 +136,7 @@ static void
print_arg(bool arg_is_ptr, const char *arg_string, uint64_t arg)
{
	if (arg_string[0] == 0) {
		printf("%24s", "");
		return;
	}

@@ -182,8 +183,8 @@ print_event(struct spdk_trace_entry *e, uint64_t tsc_rate,
	printf("%-*s ", (int)sizeof(d->name), d->name);
	print_size(e->size);

	if (d->new_object) {
	print_arg(d->arg1_is_ptr, d->arg1_name, e->arg1);
	if (d->new_object) {
		print_object_id(d->object_type, stats->index[e->object_id]);
	} else if (d->object_type != OBJECT_NONE) {
		if (stats->start.find(e->object_id) != stats->start.end()) {
@@ -200,8 +201,6 @@ print_event(struct spdk_trace_entry *e, uint64_t tsc_rate,
		} else {
			printf("id:    N/A");
		}
	} else {
		print_arg(d->arg1_is_ptr, d->arg1_name, e->arg1);
	}
	printf("\n");
}