perfmon: check for duplicates after other checks
[vpp.git] / src / plugins / perfmon / perfmon.c
index 1569036..594a987 100644 (file)
@@ -398,9 +398,6 @@ perfmon_init (vlib_main_t *vm)
       clib_error_t *err;
       uword *p;
 
-      if (hash_get_mem (pm->bundle_by_name, b->name) != 0)
-       clib_panic ("duplicate bundle name '%s'", b->name);
-
       if ((p = hash_get_mem (pm->source_by_name, b->source)) == 0)
        {
          log_debug ("missing source '%s', skipping bundle '%s'", b->source,
@@ -426,6 +423,9 @@ perfmon_init (vlib_main_t *vm)
          continue;
        }
 
+      if (hash_get_mem (pm->bundle_by_name, b->name) != 0)
+       clib_panic ("duplicate bundle name '%s'", b->name);
+
       hash_set_mem (pm->bundle_by_name, b->name, b);
       log_debug ("bundle '%s' regisrtered", b->name);