Commit e9030f36 authored by GangCao's avatar GangCao Committed by Tomasz Zawadzki
Browse files

trace: add an assert for the valid history



Change-Id: I4dd97351354af8ccdd0684afda06e6f2e8889839
Signed-off-by: default avatarGangCao <gang.cao@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9828


Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
parent fa36884a
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -342,6 +342,7 @@ spdk_trace_parser::init(const spdk_trace_parser_opts *opts)
	if (opts->lcore == SPDK_TRACE_MAX_LCORE) {
		for (i = 0; i < SPDK_TRACE_MAX_LCORE; i++) {
			history = spdk_get_per_lcore_history(_histories, i);
			assert(history);
			if (history->num_entries == 0 || history->entries[0].tsc == 0) {
				continue;
			}
@@ -350,6 +351,7 @@ spdk_trace_parser::init(const spdk_trace_parser_opts *opts)
		}
	} else {
		history = spdk_get_per_lcore_history(_histories, opts->lcore);
		assert(history);
		if (history->num_entries > 0 && history->entries[0].tsc != 0) {
			populate_events(history, history->num_entries);
		}