trace_flags.c: modify errorlog text for duplicate tgroups

Add information which tgroup_ids/_names are duplicated - currently
we only show the second argument of comparison.

Change-Id: Id3c61fc2d86b97e5513d7f5af9d0c5f66a358c5e
Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10738
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
This commit is contained in:
Krzysztof Karas 2021-12-17 08:55:20 +00:00 committed by Tomasz Zawadzki
parent aa499efdb6
commit e45f78b894

View File

@ -429,13 +429,15 @@ spdk_trace_add_register_fn(struct spdk_trace_register_fn *reg_fn)
/* Ensure that no trace point group IDs and names are ever duplicated */
for (_reg_fn = g_reg_fn_head; _reg_fn; _reg_fn = _reg_fn->next) {
if (reg_fn->tgroup_id == _reg_fn->tgroup_id) {
SPDK_ERRLOG("duplicate tgroup_id (%d) with %s\n", _reg_fn->tgroup_id, _reg_fn->name);
SPDK_ERRLOG("group %d, %s has duplicate tgroup_id with %s\n",
reg_fn->tgroup_id, reg_fn->name, _reg_fn->name);
assert(false);
return;
}
if (strcmp(reg_fn->name, _reg_fn->name) == 0) {
SPDK_ERRLOG("duplicate name with %s\n", _reg_fn->name);
SPDK_ERRLOG("name %s is duplicated between groups with ids %d and %d\n",
reg_fn->name, reg_fn->tgroup_id, _reg_fn->tgroup_id);
assert(false);
return;
}