diff options
author | Glenn Elliott <gelliott@cs.unc.edu> | 2014-08-05 13:13:34 -0400 |
---|---|---|
committer | Glenn Elliott <gelliott@cs.unc.edu> | 2014-08-05 13:13:34 -0400 |
commit | ebad47b184dc7dc831659426b86567442c512be0 (patch) | |
tree | 0cdd3a8a0fea6075d434f3c934aa244ecaafc1fd | |
parent | c84aed7b6f91cd0bdd2ee1c4e2113b3a233c6c77 (diff) |
Dot: Include nr_skips in dot output of backedges
-rw-r--r-- | src/pgm.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/pgm.cpp b/src/pgm.cpp index 8765b37..ca3f351 100644 --- a/src/pgm.cpp +++ b/src/pgm.cpp | |||
@@ -3825,6 +3825,7 @@ int pgm_print_graph(graph_t graph, FILE* outs) | |||
3825 | struct pgm_graph* g; | 3825 | struct pgm_graph* g; |
3826 | 3826 | ||
3827 | char namebuf[PGM_NODE_NAME_LEN]; | 3827 | char namebuf[PGM_NODE_NAME_LEN]; |
3828 | char thresh[80]; | ||
3828 | 3829 | ||
3829 | if(!is_valid_graph(graph)) | 3830 | if(!is_valid_graph(graph)) |
3830 | goto out; | 3831 | goto out; |
@@ -3888,8 +3889,17 @@ int pgm_print_graph(graph_t graph, FILE* outs) | |||
3888 | strncpy(namebuf, e->name, PGM_NODE_NAME_LEN); | 3889 | strncpy(namebuf, e->name, PGM_NODE_NAME_LEN); |
3889 | filter_ctrlchars(namebuf, PGM_NODE_NAME_LEN); | 3890 | filter_ctrlchars(namebuf, PGM_NODE_NAME_LEN); |
3890 | 3891 | ||
3892 | if(!e->is_backedge) | ||
3893 | { | ||
3894 | snprintf(thresh, sizeof(thresh), "(%lu)", e->attr.nr_threshold); | ||
3895 | } | ||
3896 | else | ||
3897 | { | ||
3898 | snprintf(thresh, sizeof(thresh), "(%lu, %lu)", e->attr.nr_threshold, e->nr_skips); | ||
3899 | } | ||
3900 | |||
3891 | fprintf(outs, | 3901 | fprintf(outs, |
3892 | "\t%d -> %d [style=%s, color=%s, label=\"%s%s_%s\", headlabel=\"%lu (%lu)\", taillabel=\"%lu\"]\n", | 3902 | "\t%d -> %d [style=%s, color=%s, label=\"%s%s_%s\", headlabel=\"%lu %s\", taillabel=\"%lu\"]\n", |
3893 | e->producer, | 3903 | e->producer, |
3894 | e->consumer, | 3904 | e->consumer, |
3895 | (!e->is_backedge) ? "solid" : "dashed", | 3905 | (!e->is_backedge) ? "solid" : "dashed", |
@@ -3898,7 +3908,7 @@ int pgm_print_graph(graph_t graph, FILE* outs) | |||
3898 | edgeTypeStr(e), | 3908 | edgeTypeStr(e), |
3899 | namebuf, | 3909 | namebuf, |
3900 | e->attr.nr_consume, | 3910 | e->attr.nr_consume, |
3901 | e->attr.nr_threshold, | 3911 | thresh, |
3902 | e->attr.nr_produce); | 3912 | e->attr.nr_produce); |
3903 | } | 3913 | } |
3904 | 3914 | ||
@@ -3910,5 +3920,4 @@ int pgm_print_graph(graph_t graph, FILE* outs) | |||
3910 | 3920 | ||
3911 | out: | 3921 | out: |
3912 | return ret; | 3922 | return ret; |
3913 | |||
3914 | } | 3923 | } |