tools/zep_dispatch: don't graph links with weight 0
This commit is contained in:
parent
004b93edca
commit
3e7999387c
2
dist/tools/zep_dispatch/main.c
vendored
2
dist/tools/zep_dispatch/main.c
vendored
@ -105,7 +105,7 @@ static void dispatch_loop(int sock, dispatch_cb_t dispatch, void *ctx)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static topology_t topology;
|
static topology_t topology;
|
||||||
static const char *graphviz_file;
|
static const char *graphviz_file = "example.gv";
|
||||||
static void _info_handler(int signal)
|
static void _info_handler(int signal)
|
||||||
{
|
{
|
||||||
if (signal != SIGUSR1) {
|
if (signal != SIGUSR1) {
|
||||||
|
|||||||
12
dist/tools/zep_dispatch/topology.c
vendored
12
dist/tools/zep_dispatch/topology.c
vendored
@ -151,10 +151,14 @@ int topology_print(const char *file, const topology_t *t)
|
|||||||
|
|
||||||
for (list_node_t *edge = t->edges.next; edge; edge = edge->next) {
|
for (list_node_t *edge = t->edges.next; edge; edge = edge->next) {
|
||||||
struct edge *super = container_of(edge, struct edge, next);
|
struct edge *super = container_of(edge, struct edge, next);
|
||||||
fprintf(out, "\t%s -> %s [ label = \"%.2f\" ]\n",
|
if (super->weight_a_b) {
|
||||||
super->a->name, super->b->name, super->weight_a_b);
|
fprintf(out, "\t%s -> %s [ label = \"%.2f\" ]\n",
|
||||||
fprintf(out, "\t%s -> %s [ label = \"%.2f\" ]\n",
|
super->a->name, super->b->name, super->weight_a_b);
|
||||||
super->b->name, super->a->name, super->weight_b_a);
|
}
|
||||||
|
if (super->weight_b_a) {
|
||||||
|
fprintf(out, "\t%s -> %s [ label = \"%.2f\" ]\n",
|
||||||
|
super->b->name, super->a->name, super->weight_b_a);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fprintf(out, "}\n");
|
fprintf(out, "}\n");
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user