public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/25742] New: var create through mi mode on std::istream sometimes very slow
@ 2020-03-28  5:44 b.r.carlsson at gmail dot com
  2020-04-03 20:24 ` [Bug c++/25742] " tromey at sourceware dot org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: b.r.carlsson at gmail dot com @ 2020-03-28  5:44 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=25742

            Bug ID: 25742
           Summary: var create through mi mode on std::istream sometimes
                    very slow
           Product: gdb
           Version: 9.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
          Assignee: unassigned at sourceware dot org
          Reporter: b.r.carlsson at gmail dot com
  Target Milestone: ---

I need some help to further investigate a problem.
When using VSCode to debug using gdb, it unfortunately load the variables for
all the frames in current thread.
VSCode uses gdb's mi mode to get a visualization of these variables.

Most var-create takes 1 or 2 ms. But a few takes hundreds or a couple of
thousand ms.
The worst is std::istream taking around 2 seconds to be created, from the log:
1: (51975) <-1343-var-create - * "is"
1: (54172)
->1343^done,name="var80",numchild="0",value="{...}",type="std::istream
&",thread-id="2",has_more="0"
1: (54172) ->(gdb)
1: (54172) 1343: elapsed time 2197

I can't say that I can reproduce it while running normal gdb, not using mi
mode. And I can't reproduce in a simple small test project, with just a main
and one function call with an std::istream, then the var-create is down to
around 1 ms.

When I test it now I run gdb without my gdbinit to avoid the influence of our
pretty-printers.
I did also test to register a pretty-printer for std::istream that just
returned a static text, it got the time down to around 1400 ms.

Any advice on how to further investigate this problem?

Running gdb 9.1 (same problem in 8.2)
Ubuntu 18.04
C++ (a rather big executable with around 100 threads)

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug c++/25742] var create through mi mode on std::istream sometimes very slow
  2020-03-28  5:44 [Bug c++/25742] New: var create through mi mode on std::istream sometimes very slow b.r.carlsson at gmail dot com
@ 2020-04-03 20:24 ` tromey at sourceware dot org
  2020-04-04  7:34 ` b.r.carlsson at gmail dot com
  2020-04-16 13:40 ` b.r.carlsson at gmail dot com
  2 siblings, 0 replies; 4+ messages in thread
From: tromey at sourceware dot org @ 2020-04-03 20:24 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=25742

Tom Tromey <tromey at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tromey at sourceware dot org

--- Comment #1 from Tom Tromey <tromey at sourceware dot org> ---
(In reply to Björn Carlsson from comment #0)

> Any advice on how to further investigate this problem?

I had hoped that "set debug timestamp 1" woudl help, but this
appears to maybe be broken and/or not interact properly with
CU expansion logging.

I guess all I can suggest is to come up with a "-batch" formula
to reproduce the bug, and then run this under a profiler and
see what happens.

My guess is that either (1) gdb is expanding too many CUs in
response to this request, or (2) the CU that is being expanded
is unusually large.

However, that's just a guess, and it would be good to know for sure.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug c++/25742] var create through mi mode on std::istream sometimes very slow
  2020-03-28  5:44 [Bug c++/25742] New: var create through mi mode on std::istream sometimes very slow b.r.carlsson at gmail dot com
  2020-04-03 20:24 ` [Bug c++/25742] " tromey at sourceware dot org
@ 2020-04-04  7:34 ` b.r.carlsson at gmail dot com
  2020-04-16 13:40 ` b.r.carlsson at gmail dot com
  2 siblings, 0 replies; 4+ messages in thread
From: b.r.carlsson at gmail dot com @ 2020-04-04  7:34 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=25742

--- Comment #2 from Björn Carlsson <b.r.carlsson at gmail dot com> ---
A profiler, of course, I will try to set that up.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug c++/25742] var create through mi mode on std::istream sometimes very slow
  2020-03-28  5:44 [Bug c++/25742] New: var create through mi mode on std::istream sometimes very slow b.r.carlsson at gmail dot com
  2020-04-03 20:24 ` [Bug c++/25742] " tromey at sourceware dot org
  2020-04-04  7:34 ` b.r.carlsson at gmail dot com
@ 2020-04-16 13:40 ` b.r.carlsson at gmail dot com
  2 siblings, 0 replies; 4+ messages in thread
From: b.r.carlsson at gmail dot com @ 2020-04-16 13:40 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=25742

Björn Carlsson <b.r.carlsson at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |b.r.carlsson at gmail dot com

--- Comment #3 from Björn Carlsson <b.r.carlsson at gmail dot com> ---
Created attachment 12467
  --> https://sourceware.org/bugzilla/attachment.cgi?id=12467&action=edit
oprofile report

I made this profiling by attaching to gdb with oprofile just before stepping
within VSCode and aborting oprofile when VSCode finished with the work of
creating variables for the watch window. I have a feeling it's not detailed
enough, but I will post it anyway, perhaps it's a step in process at least.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-04-16 13:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-28  5:44 [Bug c++/25742] New: var create through mi mode on std::istream sometimes very slow b.r.carlsson at gmail dot com
2020-04-03 20:24 ` [Bug c++/25742] " tromey at sourceware dot org
2020-04-04  7:34 ` b.r.carlsson at gmail dot com
2020-04-16 13:40 ` b.r.carlsson at gmail dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).