app/trace: assert history ptr

This is just assert to assure the Klocwork
static analizer that ptr is not NULL.

Change-Id: I458af194991fb1874fb7d32db55513a1f66408c0
Signed-off-by: Liu Xiaodong <xiaodong.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8745
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: <dongx.yi@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
This commit is contained in:
Liu Xiaodong 2021-07-13 04:35:33 -04:00 committed by Tomasz Zawadzki
parent e5c3791c4e
commit 413808e155

View File

@ -197,6 +197,7 @@ get_next_buffer(struct spdk_trace_entry_buffer *buf, uint16_t lcore)
struct spdk_trace_history *history;
history = spdk_get_per_lcore_history(g_histories, lcore);
assert(history);
if (spdk_unlikely((void *)buf == &history->entries[history->num_entries - 1])) {
return (struct spdk_trace_entry_buffer *)&history->entries[0];