Commit c99e1d60 authored by Ben Walker's avatar Ben Walker Committed by Tomasz Zawadzki
Browse files

thread: Passing NULL to spdk_thread_get_last_tsc gets current thread


value

If the user passes NULL for the thread, just use the current thread
to get the last tsc.

Signed-off-by: default avatarBen Walker <benjamin.walker@intel.com>
Change-Id: I1a2b61d9765e1ef59927ffec7c49f2a2b62590f6
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4320


Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
Reviewed-by: default avatarAleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
parent 7deedab6
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -822,6 +822,10 @@ spdk_thread_get_stats(struct spdk_thread_stats *stats)
uint64_t
spdk_thread_get_last_tsc(struct spdk_thread *thread)
{
	if (thread == NULL) {
		thread = _get_thread();
	}

	return thread->tsc_last;
}