This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: JIT debugging (Attach and speed)
- From: Yichao Yu <yyc1992 at gmail dot com>
- To: Pedro Alves <palves at redhat dot com>
- Cc: gdb at sourceware dot org, Paul Pluzhnikov <ppluzhnikov at google dot com>
- Date: Wed, 23 Mar 2016 23:14:32 -0400
- Subject: Re: JIT debugging (Attach and speed)
- Authentication-results: sourceware.org; auth=none
- References: <CAMvDr+TKDYeECiUK7Kz7TGSRF826Vq24z_=CPQXz1vyxmMUm_w at mail dot gmail dot com> <56F168D7 dot 9050405 at redhat dot com> <56F16F8F dot 9050404 at redhat dot com> <CAMvDr+TRSF16fKnnb9tWD4Xctek31Sdgx2m1ct=UctXL_b9vuA at mail dot gmail dot com> <56F1759F dot 3070100 at redhat dot com> <CAMvDr+QcMrHk6y7hGr1NaijEXK=dH+J0CGJZs6m_Rk2D2oSm-g at mail dot gmail dot com> <56F17A23 dot 90909 at redhat dot com> <CAMvDr+ST=4a11-B=ymUQDRdOCZmVUgdfkhFbUDknvjkaGjtGWw at mail dot gmail dot com> <CAMvDr+Ra3yi465XBcJR=oYtOM8+-=1Hj2xs32n-wYVpiN_exUQ at mail dot gmail dot com> <56F2DF69 dot 9030908 at redhat dot com> <CAMvDr+RxhEhRCHDFYhcpo29ma6z0CMYF1ZEryBzq2VPyaj4nmQ at mail dot gmail dot com> <56F2F31F dot 4000104 at redhat dot com> <CAMvDr+S1h46g=dxnKP5UBGrVnSfrf=S84ZmNtE4LU_D1SUKBXw at mail dot gmail dot com> <56F34041 dot 2000301 at redhat dot com>
> The prototype patch below (also in users/palves/jit-speedup, along
> with the attach fixes), simply delays computing a frame until
> it's necessary, and it cuts down the time for:
(The patch seems to have some white space breakage but the branch works great.)
> gdb ---args ./testsuite/outputs/gdb.base/jit/jit-main ./testsuite/outputs/gdb.base/jit/jit-solib.so 2000
>
> from "takes too long so I canceled it" minutes, to around 2 seconds, for me.
There's indeed a huge improvement. The test I was using with ~2000 JIT
objects goes drops from ~400s to 7.5s (~3s without gdb). However a
rough scaling test suggests that the scaling is still ~O(n^2) 20k JIT
objects takes ~500s (~130s without gdb). It seems that the master was
actually super quadratic (if this is a word) when dealing with
multiple JIT objects.
> Having a pending breakpoint that is never resolved slows things down
> significantly again though... The perf profile shows that breakpoint_re_set
> ends up calling parse_linespec which wants the selected block, which wants
> the selected frame, and then we're back at the same... Maybe we
> could reconsider how pending breakpoints are re-parsed, and which
> context they're parsed in. Not sure.
>
> Still, very promising.
>
Indeed. It's already so much better.