Commit c3f109f9 authored by Daniel Verkamp's avatar Daniel Verkamp
Browse files

trace: Increase the size of trace name



According to the analysis, the largest name size is
24 not including '\0' (NVMF_RDMA_WRITE_COMPLETE),
so change the the size of name. Also add a check
to avoid the str exceeding our defined name size.

Change-Id: Iddf2cb52a3f5358306a59fc66bb997fa8098cde0
Signed-off-by: default avatarZiye Yang <ziye.yang@intel.com>
parent 7fc640b2
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -78,7 +78,7 @@ struct spdk_trace_object {
#define SPDK_TPOINT_ID(group, tpoint)	((group * 64) + tpoint)

struct spdk_trace_tpoint {
	char		name[24];
	char		name[44];
	char		short_name[4];
	uint16_t	tpoint_id;
	uint8_t		owner_type;
+2 −2
Original line number Diff line number Diff line
@@ -255,8 +255,8 @@ spdk_trace_register_description(const char *name, const char *short_name,
	tpoint = &g_trace_histories->tpoint[tpoint_id];
	assert(tpoint->tpoint_id == 0);

	strncpy(tpoint->name, name, sizeof(tpoint->name));
	strncpy(tpoint->short_name, short_name, sizeof(tpoint->short_name));
	snprintf(tpoint->name, sizeof(tpoint->name), "%s", name);
	snprintf(tpoint->short_name, sizeof(tpoint->short_name), "%s", short_name);
	tpoint->tpoint_id = tpoint_id;
	tpoint->object_type = object_type;
	tpoint->owner_type = owner_type;