Commit d89e62e7 authored by YafeiWangAlice's avatar YafeiWangAlice Committed by Tomasz Zawadzki
Browse files

spdk_top: In CORES tab, spdk_top can't collect the right poller count under certain conditions.



spdk_top can't collect the right poller count when thread count is more than core count. Max index of g_threads_info[] should be thread count NOT cores count.

Signed-off-by: default avatarYafeiWangAlice <yafei.wang@samsung.com>
Change-Id: Iff95fb1aa7f84626a559741ad135a2cbeed04f90
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/13574


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 avatarChangpeng Liu <changpeng.liu@intel.com>
Reviewed-by: default avatarPaul Luse <paul.e.luse@intel.com>
Reviewed-by: default avatarKrzysztof Karas <krzysztof.karas@intel.com>
Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
parent 62378c24
Loading
Loading
Loading
Loading
+6 −8
Original line number Diff line number Diff line
@@ -1027,14 +1027,6 @@ get_cores_data(void)
				cores_info[i].last_busy = g_cores_info[j].busy;
				cores_info[i].last_idle = g_cores_info[j].idle;
			}
			/* Do not consider threads which changed cores when issuing
			 * RPCs to get_core_data and get_thread_data and threads
			 * not currently assigned to this core. */
			if ((int)cores_info[i].lcore == g_threads_info[j].core_num) {
				cores_info[i].pollers_count += g_threads_info[j].active_pollers_count +
							       g_threads_info[j].timed_pollers_count +
							       g_threads_info[j].paused_pollers_count;
			}
		}
	}

@@ -1053,6 +1045,12 @@ get_cores_data(void)
			for (k = 0; k < g_last_threads_count; k++) {
				if (core_info->threads.thread[j].id == g_threads_info[k].id) {
					g_threads_info[k].core_num = core_info->lcore;
					/* Do not consider threads which changed cores when issuing
					 * RPCs to get_core_data and get_thread_data and threads
					 * not currently assigned to this core. */
					core_info->pollers_count += g_threads_info[k].active_pollers_count +
								    g_threads_info[k].timed_pollers_count +
								    g_threads_info[k].paused_pollers_count;
				}
			}
		}