Skip to content
Browse files

bug fix to the formatting of vertexes.

  • Loading branch information...
1 parent 329e823 commit a21faf1cf067852c23d19cdfe55301a1657c726f @huiqing huiqing committed Sep 17, 2012
Showing with 18 additions and 3 deletions.
  1. +18 −3 src/percept2_dot.erl
View
21 src/percept2_dot.erl
@@ -247,10 +247,11 @@ format_process_tree_vertex({{Pid={pid, {_P1, P2, P3}}, Name, Entry}, CleanPid})
_ -> Pid
end,
PidStr = "<" ++ pid2str(Pid1) ++ ">",
- lists:flatten(io_lib:format("~s; ~p;\\n~p",
- [PidStr, Name, Entry]));
+ lists:flatten(io_lib:format("~s; ~p;\\n", [PidStr, Name])) ++
+ format_entry(Entry);
+
format_process_tree_vertex(Other) ->
- io_lib:format("~p", [Other]).
+ io_lib:format("~p", [Other]).
format_process_tree_edge(V1, V2, Label, CleanPid) ->
String = ["\"",format_process_tree_vertex({V1, CleanPid}),"\"", " -> ",
@@ -259,6 +260,20 @@ format_process_tree_edge(V1, V2, Label, CleanPid) ->
"\"", "fontsize=20 fontname=\"Verdana\"", "];\n"].
+format_entry(undefined) ->
+ "undefined";
+format_entry({M, F, A}) ->
+ MStr = atom_to_list(M),
+ FStr = atom_to_list(F),
+ case length(MStr)>25 orelse length(FStr)>25 of
+ true ->
+ "{"++MStr++",\\n"++FStr++","
+ ++integer_to_list(A)++"}";
+ false ->
+ "{"++MStr++","++FStr++","
+ ++integer_to_list(A)++"}"
+ end.
+
calc_dim(String) ->
calc_dim(String, 1, 0, 0).

0 comments on commit a21faf1

Please sign in to comment.
Something went wrong with that request. Please try again.