Commit 29c0e0dc authored by Michael Piszczek's avatar Michael Piszczek Committed by Tomasz Zawadzki
Browse files

thread: add spdk_poller_get_id



Issue: spdk_top tracked pollers by the poller name string and the
thread_id they are running on. This shows incorrect stats when
multiple pollers exist on the same thread with the same name.
Solution: Added a unique poller id for each poller on a thread and
to allow spdk_top to track pollers by thread_id and poller_id.

Signed-off-by: default avatarMichael Piszczek <mpiszczek@ddn.com>
Change-Id: I1879e2afc9a929d1df9e8e35510f0092c5443bdc
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5868


Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
parent c0babf53
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -1310,6 +1310,7 @@ Example response:
        "timed_pollers": [
          {
            "name": "spdk_rpc_subsystem_poll",
            "id": 1,
            "state": "waiting",
            "run_count": 12345,
            "busy_count": 10000,
+1 −0
Original line number Diff line number Diff line
@@ -48,6 +48,7 @@ struct io_device;
struct spdk_thread;

const char *spdk_poller_get_name(struct spdk_poller *poller);
uint64_t spdk_poller_get_id(struct spdk_poller *poller);
const char *spdk_poller_get_state_str(struct spdk_poller *poller);
uint64_t spdk_poller_get_period_ticks(struct spdk_poller *poller);
void spdk_poller_get_stats(struct spdk_poller *poller, struct spdk_poller_stats *stats);
+1 −0
Original line number Diff line number Diff line
@@ -261,6 +261,7 @@ rpc_get_poller(struct spdk_poller *poller, struct spdk_json_write_ctx *w)

	spdk_json_write_object_begin(w);
	spdk_json_write_named_string(w, "name", spdk_poller_get_name(poller));
	spdk_json_write_named_uint64(w, "id", spdk_poller_get_id(poller));
	spdk_json_write_named_string(w, "state", spdk_poller_get_state_str(poller));
	spdk_json_write_named_uint64(w, "run_count", stats.run_count);
	spdk_json_write_named_uint64(w, "busy_count", stats.busy_count);
+1 −1
Original line number Diff line number Diff line
@@ -35,7 +35,7 @@ SPDK_ROOT_DIR := $(abspath $(CURDIR)/../..)
include $(SPDK_ROOT_DIR)/mk/spdk.common.mk

SO_VER := 6
SO_MINOR := 0
SO_MINOR := 1

C_SRCS = thread.c
LIBNAME = thread
+1 −0
Original line number Diff line number Diff line
@@ -58,6 +58,7 @@

	# internal functions in spdk_internal/thread.h
	spdk_poller_get_name;
	spdk_poller_get_id;
	spdk_poller_get_state_str;
	spdk_poller_get_period_ticks;
	spdk_poller_get_stats;
Loading