Closed honggyukim closed 6 years ago
I also tried to generate graphviz output for v8 recorded data. But it gets crashed as follows:
$ uftrace record -t 1ms d8 --expose-gc -e 'gc()'
$ uftrace dump --graphviz
Segmentation fault (core dumped)
Here is the backtrace info.
$ gdb --args `which uftrace` dump --graphviz
(gdb) r
Starting program: /home/honggyu/usr/bin/uftrace dump --graphviz
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Thread 2.1 "uftrace" received signal SIGHUP, Hangup.
[Switching to Thread 0x7ffff7fc7740 (LWP 93551)]
0x00007ffff689c5b3 in select () from /lib/x86_64-linux-gnu/libc.so.6
(gdb) bt
#0 0x00007ffff689c5b3 in select () from /lib/x86_64-linux-gnu/libc.so.6
#1 0x000000000042f385 in start_command (argv=0x7fffffffe170) at /home/honggyu/work/uftrace/utils/pager.c:49
#2 0x000000000042f54c in start_pager () at /home/honggyu/work/uftrace/utils/pager.c:97
#3 0x00000000004073db in main (argc=3, argv=0x7fffffffe438) at /home/honggyu/work/uftrace/uftrace.c:1040
Please do it without pager
Tested with --no-pager
again.
$ uftrace dump --graphviz --no-pager
# version":"uftrace v0.9-22-gab2d2 ( dwarf python tui perf sched )",
# command_line "uftrace record -t 1ms d8 --expose-gc -e gc()"
digraph "/home/honggyu/work/v8/git/v8/out/x64.release.pg.g/d8" {
# Attributes
splines=ortho;
concentrate=true;
node [shape="rect",fontsize="7",style="filled"];
edge [fontsize="7"];
Segmentation fault (core dumped)
Here is gdb backtrace info.
(gdb) r
Starting program: /home/honggyu/usr/bin/uftrace dump --graphviz --no-pager
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
# version":"uftrace v0.9-22-gab2d2 ( dwarf python tui perf sched )",
# command_line "uftrace record -t 1ms d8 --expose-gc -e gc()"
digraph "/home/honggyu/work/v8/git/v8/out/x64.release.pg.g/d8" {
# Attributes
splines=ortho;
concentrate=true;
node [shape="rect",fontsize="7",style="filled"];
edge [fontsize="7"];
Program received signal SIGSEGV, Segmentation fault.
0x0000000000000000 in ?? ()
(gdb) bt
#0 0x0000000000000000 in ?? ()
#1 0x000000000041bdb5 in dump_replay_event (ops=0x7fffffffdf40, task=0xa03dc8) at /home/honggyu/work/uftrace/cmds/dump.c:1401
#2 0x000000000041bea3 in do_dump_replay (ops=0x7fffffffdf40, opts=0x7fffffffe200, handle=0x7fffffffdfc0) at /home/honggyu/work/uftrace/cmds/dum
p.c:1427
#3 0x000000000041c39a in command_dump (argc=0, argv=0x7fffffffe448, opts=0x7fffffffe200) at /home/honggyu/work/uftrace/cmds/dump.c:1535
#4 0x0000000000407554 in main (argc=0, argv=0x7fffffffe448) at /home/honggyu/work/uftrace/uftrace.c:1068
Here is the problematic source line.
1395│ else {
1396│ struct uftrace_perf_reader *perf;
1397│
1398│ assert(task->h->last_perf_idx >= 0);
1399│ perf = &task->h->perf[task->h->last_perf_idx];
1400│
1401├───────────────> ops->perf_event(ops, perf, rec);
1402│ }
(gdb) p ops
$1 = (struct uftrace_dump_ops *) 0x7fffffffdf40
(gdb) p *ops
$2 = {
header = 0x41b039 <print_graphviz_header>,
task_start = 0x0,
inverted_time = 0x0,
task_rstack = 0x41b12c <print_graphviz_task_rstack>,
task_event = 0x0,
kernel_start = 0x0,
cpu_start = 0x0,
kernel_func = 0x0,
kernel_event = 0x0,
lost = 0x0,
perf_start = 0x0,
perf_event = 0x0,
footer = 0x41b2d3 <print_graphviz_footer>
}
OK, it should be converted to use call_if_nonull()
too.
@honggyukim I'd like to cook a patch to fix some problems in the dump command, can I have your sign-off for the above patch?
Sure, please do that. Thanks!
It'd be nice if you could test check/dump branch whether I messed up something..
@honggyukim thank you for good work!! have you draw the clang CFG?? how about it?
Thanks @namhyung! But I got segfault when running dot
again.
$ uftrace dump --graphviz > clang.dot
$ dot -Tpng clang.dot -o clang.png
Segmentation fault (core dumped)
Please download the dot file and test it - clang.dot.txt Thanks!
@honggyukim thank you for good work!! have you draw the clang CFG?? how about it?
@ParkHanbum I just run clang binary to compile a target program, but the recorded data cannot be converted to .png
file.
I'm not sure it's our fault or not
It seems that it could be a fault of dot program.
I've tried it with v8, but cannot get .png
file as well.
$ uftrace dump --graphviz > v8.dot
$ dot -Tpng v8.dot -o v8.png
Warning: no position for edge with xlabel Calls : 1
Warning: no position for edge with xlabel Calls : 1
Warning: no position for edge with xlabel Calls : 1
Warning: no position for edge with xlabel Calls : 1
Warning: no position for edge with xlabel Calls : 1
Warning: no position for edge with xlabel Calls : 1
Warning: no position for edge with xlabel Calls : 1
Warning: no position for edge with xlabel Calls : 1
Warning: no position for edge with xlabel Calls : 1
Warning: no position for edge with xlabel Calls : 3
Warning: no position for edge with xlabel Calls : 20
Warning: no position for edge with xlabel Calls : 21
Oh.. The above output is just a warning so I got the png file.
@honggyukim Dots can not handle more than about 200 elements. recently master branch of dot is also same.
instead, you can use neato to draw huge size of dot document. but when neato drawing dot element, it does not align according to its hierarchy. so, the figure drawed by neato looks chaostic than the figure that drawed by dot.
I don't know but they have different layout engines - you could also try fdp
or sfdp
.
Dots can not handle more than about 200 elements.
@ParkHanbum If so, why don't we add a warning message if there are too many elements?
I've tried to generate graphviz output for clang and v8, but failed.
Here is the dot file info.
I've made the following change, then those "Error" disapeared.
But this time, dot binary itself crashed.