diff --git a/include/spdk/trace.h b/include/spdk/trace.h index c90e2228c..f7a8181dd 100644 --- a/include/spdk/trace.h +++ b/include/spdk/trace.h @@ -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; diff --git a/lib/trace/trace.c b/lib/trace/trace.c index 9052f3c47..bf7f80fd8 100644 --- a/lib/trace/trace.c +++ b/lib/trace/trace.c @@ -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;