Rework plist/qos printing, diffing and logging

* Use the parameter tables to pretty-print QoS and plist, rather than a
  hard-coded function supporting only the QoS.

* Support diffing two plists: a single table-driven function can handle
  both nn_plist_t and ddsi_qos_t, and it removes the discrepancy between
  the two types.

* Log content of discovery samples in trace rather than merely printing
  "(plist)"

Signed-off-by: Erik Boasson <eb@ilities.com>
This commit is contained in:
Erik Boasson 2020-01-08 12:26:21 +01:00 committed by eboasson
parent 6bd28fb4b1
commit 08c9db0934
25 changed files with 575 additions and 320 deletions

View file

@ -146,8 +146,8 @@ static bool pubsub_qos_eq_h (const dds_qos_t *a, dds_entity_t ent)
struct ddsrt_log_cfg logcfg;
dds_log_cfg_init (&logcfg, 0, DDS_LC_ERROR, stderr, stderr);
DDS_CLOG (DDS_LC_ERROR, &logcfg, "pub/sub: delta = %"PRIx64"\n", delta);
nn_log_xqos (DDS_LC_ERROR, &logcfg, a); DDS_CLOG (DDS_LC_ERROR, &logcfg, "\n");
nn_log_xqos (DDS_LC_ERROR, &logcfg, b); DDS_CLOG (DDS_LC_ERROR, &logcfg, "\n");
nn_xqos_log (DDS_LC_ERROR, &logcfg, a); DDS_CLOG (DDS_LC_ERROR, &logcfg, "\n");
nn_xqos_log (DDS_LC_ERROR, &logcfg, b); DDS_CLOG (DDS_LC_ERROR, &logcfg, "\n");
}
dds_delete_qos (b);
return delta == 0;
@ -168,8 +168,8 @@ static bool reader_qos_eq_h (const dds_qos_t *a, dds_entity_t ent)
struct ddsrt_log_cfg logcfg;
dds_log_cfg_init (&logcfg, 0, DDS_LC_ERROR, stderr, stderr);
DDS_CLOG (DDS_LC_ERROR, &logcfg, "reader: delta = %"PRIx64"\n", delta);
nn_log_xqos (DDS_LC_ERROR, &logcfg, a); DDS_CLOG (DDS_LC_ERROR, &logcfg, "\n");
nn_log_xqos (DDS_LC_ERROR, &logcfg, b); DDS_CLOG (DDS_LC_ERROR, &logcfg, "\n");
nn_xqos_log (DDS_LC_ERROR, &logcfg, a); DDS_CLOG (DDS_LC_ERROR, &logcfg, "\n");
nn_xqos_log (DDS_LC_ERROR, &logcfg, b); DDS_CLOG (DDS_LC_ERROR, &logcfg, "\n");
}
dds_delete_qos (b);
return delta == 0;
@ -190,8 +190,8 @@ static bool writer_qos_eq_h (const dds_qos_t *a, dds_entity_t ent)
struct ddsrt_log_cfg logcfg;
dds_log_cfg_init (&logcfg, 0, DDS_LC_ERROR, stderr, stderr);
DDS_CLOG (DDS_LC_ERROR, &logcfg, "writer: delta = %"PRIx64"\n", delta);
nn_log_xqos (DDS_LC_ERROR, &logcfg, a); DDS_CLOG (DDS_LC_ERROR, &logcfg, "\n");
nn_log_xqos (DDS_LC_ERROR, &logcfg, b); DDS_CLOG (DDS_LC_ERROR, &logcfg, "\n");
nn_xqos_log (DDS_LC_ERROR, &logcfg, a); DDS_CLOG (DDS_LC_ERROR, &logcfg, "\n");
nn_xqos_log (DDS_LC_ERROR, &logcfg, b); DDS_CLOG (DDS_LC_ERROR, &logcfg, "\n");
}
dds_delete_qos (b);
return delta == 0;
@ -275,8 +275,8 @@ MPT_ProcessEntry (rw_publisher,
struct ddsrt_log_cfg logcfg;
dds_log_cfg_init (&logcfg, 0, DDS_LC_ERROR, stderr, stderr);
DDS_CLOG (DDS_LC_ERROR, &logcfg, "matched reader: delta = %"PRIx64"\n", delta);
nn_log_xqos (DDS_LC_ERROR, &logcfg, qos); DDS_CLOG (DDS_LC_ERROR, &logcfg, "\n");
nn_log_xqos (DDS_LC_ERROR, &logcfg, ep->qos); DDS_CLOG (DDS_LC_ERROR, &logcfg, "\n");
nn_xqos_log (DDS_LC_ERROR, &logcfg, qos); DDS_CLOG (DDS_LC_ERROR, &logcfg, "\n");
nn_xqos_log (DDS_LC_ERROR, &logcfg, ep->qos); DDS_CLOG (DDS_LC_ERROR, &logcfg, "\n");
}
MPT_ASSERT (delta == 0, "writer %zu %zu matched reader QoS mismatch\n", i, j);
dds_delete_qos (ep->qos);
@ -427,8 +427,8 @@ MPT_ProcessEntry (rw_subscriber,
struct ddsrt_log_cfg logcfg;
dds_log_cfg_init (&logcfg, 0, DDS_LC_ERROR, stderr, stderr);
DDS_CLOG (DDS_LC_ERROR, &logcfg, "matched writer: delta = %"PRIx64"\n", delta);
nn_log_xqos (DDS_LC_ERROR, &logcfg, qos); DDS_CLOG (DDS_LC_ERROR, &logcfg, "\n");
nn_log_xqos (DDS_LC_ERROR, &logcfg, ep->qos); DDS_CLOG (DDS_LC_ERROR, &logcfg, "\n");
nn_xqos_log (DDS_LC_ERROR, &logcfg, qos); DDS_CLOG (DDS_LC_ERROR, &logcfg, "\n");
nn_xqos_log (DDS_LC_ERROR, &logcfg, ep->qos); DDS_CLOG (DDS_LC_ERROR, &logcfg, "\n");
}
MPT_ASSERT (delta == 0, "reader %zu %zu matched writer QoS mismatch\n", i, j);
dds_delete_qos (ep->qos);