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: Ziye Yang <ziye.yang@intel.com>
This commit is contained in:
parent
7fc640b296
commit
c3f109f91e
@ -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;
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user