Commit 1128edc1 authored by Jim Harris's avatar Jim Harris
Browse files

app/trace: emit owner descriptions



Now that we have a real description for an event's owner, print those
descriptions instead of the old owner_type prefix + poller_id.

Note that we need to take the event's tsc into account, if it is older than
when the associated owner was registered we should not print the description
because it is for an owner that was unregistered after the event was
generated.

Signed-off-by: default avatarJim Harris <jim.harris@samsung.com>
Change-Id: I9257306b5fe9fd7273abcb9b14e4fc136c417742
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/22648


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <smatsumoto@nvidia.com>
Community-CI: Mellanox Build Bot
Reviewed-by: default avatarKonrad Sztyber <konrad.sztyber@intel.com>
parent a6e5d032
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -133,6 +133,7 @@ static void
print_event(struct spdk_trace_parser_entry *entry, uint64_t tsc_rate, uint64_t tsc_offset)
{
	struct spdk_trace_entry		*e = entry->entry;
	struct spdk_trace_owner		*owner;
	const struct spdk_trace_tpoint	*d;
	float				us;
	size_t				i;
@@ -145,10 +146,12 @@ print_event(struct spdk_trace_parser_entry *entry, uint64_t tsc_rate, uint64_t t
	if (g_print_tsc) {
		printf("(%9ju) ", e->tsc - tsc_offset);
	}
	if (g_file->owner_type[d->owner_type].id_prefix) {
		printf("%c%02d ", g_file->owner_type[d->owner_type].id_prefix, e->owner_id);
	owner = spdk_get_trace_owner(g_file, e->owner_id);
	/* For now, only try to print first 64 bytes of description. */
	if (e->owner_id > 0 && owner->tsc < e->tsc) {
		printf("%-*s ", 64, owner->description);
	} else {
		printf("%4s", " ");
		printf("%-*s ", 64, "");
	}

	printf("%-*s ", (int)sizeof(d->name), d->name);