Commit 8f8a56af authored by Jim Harris's avatar Jim Harris
Browse files

trace: fix calculation of histories_size



The last lcore_offsets value already marks the total
size of the histories file - we don't need to also
add sizeof(struct spdk_trace_flags).

Note that this only affected the amount of memory that
was mmap'ed.  It did not result in any observable
failure.

Fixes issue #997.

Reported-by: tinnfu (GitHub submitter)
Signed-off-by: default avatarJim Harris <james.r.harris@intel.com>
Change-Id: I70fef16241cf00228bc515678cca1721f440c925

Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/473049


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatartinnfu <tinnfu@gmail.com>
parent 4036f95b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -91,7 +91,7 @@ spdk_trace_init(const char *shm_name, uint64_t num_entries)
	for (i = 1; i < (int)SPDK_COUNTOF(lcore_offsets); i++) {
		lcore_offsets[i] = spdk_get_trace_history_size(num_entries) + lcore_offsets[i - 1];
	}
	histories_size = sizeof(struct spdk_trace_flags) + lcore_offsets[SPDK_TRACE_MAX_LCORE];
	histories_size = lcore_offsets[SPDK_TRACE_MAX_LCORE];

	snprintf(g_shm_name, sizeof(g_shm_name), "%s", shm_name);