* RFC: have maint print statistics print a little more
@ 2003-02-13 1:54 Jason Molenda
2003-02-13 2:31 ` David Carlton
2003-02-13 14:52 ` Elena Zannoni
0 siblings, 2 replies; 4+ messages in thread
From: Jason Molenda @ 2003-02-13 1:54 UTC (permalink / raw)
To: gdb-patches
[-- Attachment #1: Type: text/plain, Size: 1305 bytes --]
At Apple we're often faced with a mysteriously slow gdb. It would
be very helpful to know if we've just expanded all the psymtabs
into symtabs, or if we have some problem from the compiler that is
causing us to get a vastly larger number of psymtabs for header
files than we would normally have.
This patch adds a few new entries to the objfile information printed
by maint print statistics:
Statistics for '/home/jmolenda/sware/gdb/b/gdb/gdb':
Number of "stab" symbols read: 139907
Number of "minimal" symbols read: 8022
Number of "partial" symbols read: 24584
Number of "types" defined: 4794
* Number of psym tables (not yet expanded): 904
* Number of symbol tables: 260
* Number of symbol tables with line tables: 32
* Number of symbol tables with blockvectors: 33
Space used by a.out string tables: 1060259
Total memory used for psymbol obstack: 1190666
Total memory used for psymbol cache: 513072
Total memory used for macro cache: 4072
Total memory used for symbol obstack: 1717613
Total memory used for type obstack: 550039
I highlighted the new entries with '*'. This would be a very useful
piece of information when presented with a slow gdb here at Apple
- I think other folks may find it useful as well.
This patch introduces no new testsuite failures.
Comments?
J
[-- Attachment #2: pa.txt --]
[-- Type: text/plain, Size: 1736 bytes --]
2003-02-12 Jason Molenda (jmolenda@apple.com)
* symmis.c (print_objfile_statistics): Include information about
the number of psymtabs and symtabs in each object file.
Index: symmisc.c
===================================================================
RCS file: /cvs/src/src/gdb/symmisc.c,v
retrieving revision 1.14
diff -u -p -r1.14 symmisc.c
--- symmisc.c 18 Jan 2003 15:55:53 -0000 1.14
+++ symmisc.c 13 Feb 2003 01:48:50 -0000
@@ -179,6 +179,9 @@ void
print_objfile_statistics (void)
{
struct objfile *objfile;
+ struct symtab *s;
+ struct partial_symtab *ps;
+ int i, linetables, blockvectors;
immediate_quit++;
ALL_OBJFILES (objfile)
@@ -199,6 +202,28 @@ print_objfile_statistics (void)
if (OBJSTAT (objfile, n_types) > 0)
printf_filtered (" Number of \"types\" defined: %d\n",
OBJSTAT (objfile, n_types));
+ i = 0;
+ ALL_OBJFILE_PSYMTABS (objfile, ps)
+ {
+ if (ps->readin == 0)
+ i++;
+ }
+ printf_filtered (" Number of psym tables (not yet expanded): %d\n", i);
+ i = linetables = blockvectors = 0;
+ ALL_OBJFILE_SYMTABS (objfile, s)
+ {
+ i++;
+ if (s->linetable != NULL)
+ linetables++;
+ if (s->primary == 1)
+ blockvectors++;
+ }
+ printf_filtered (" Number of symbol tables: %d\n", i);
+ printf_filtered (" Number of symbol tables with line tables: %d\n",
+ linetables);
+ printf_filtered (" Number of symbol tables with blockvectors: %d\n",
+ blockvectors);
+
if (OBJSTAT (objfile, sz_strtab) > 0)
printf_filtered (" Space used by a.out string tables: %d\n",
OBJSTAT (objfile, sz_strtab));
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: RFC: have maint print statistics print a little more
2003-02-13 1:54 RFC: have maint print statistics print a little more Jason Molenda
@ 2003-02-13 2:31 ` David Carlton
2003-02-13 14:52 ` Elena Zannoni
1 sibling, 0 replies; 4+ messages in thread
From: David Carlton @ 2003-02-13 2:31 UTC (permalink / raw)
To: Jason Molenda; +Cc: gdb-patches
On Wed, 12 Feb 2003 17:53:58 -0800, Jason Molenda
<jason-swarelist@molenda.com> said:
> At Apple we're often faced with a mysteriously slow gdb. It would
> be very helpful to know if we've just expanded all the psymtabs into
> symtabs, or if we have some problem from the compiler that is
> causing us to get a vastly larger number of psymtabs for header
> files than we would normally have.
> This patch adds a few new entries to the objfile information printed
> by maint print statistics:
> * Number of psym tables (not yet expanded): 904
> * Number of symbol tables: 260
> * Number of symbol tables with line tables: 32
> * Number of symbol tables with blockvectors: 33
Sounds like a nice idea to me; I've spent more time than I'd like
playing with psymtabs recently, and Daniel Jacobowitz and I were just
talking about a patch to fix one "expand all the psymtabs into
symtabs" bug; the easier it is for people to be aware of the existence
of such bugs, the better.
David Carlton
carlton@math.stanford.edu
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: RFC: have maint print statistics print a little more
2003-02-13 1:54 RFC: have maint print statistics print a little more Jason Molenda
2003-02-13 2:31 ` David Carlton
@ 2003-02-13 14:52 ` Elena Zannoni
2003-02-14 1:15 ` Jason Molenda
1 sibling, 1 reply; 4+ messages in thread
From: Elena Zannoni @ 2003-02-13 14:52 UTC (permalink / raw)
To: Jason Molenda; +Cc: gdb-patches
Jason Molenda writes:
> At Apple we're often faced with a mysteriously slow gdb. It would
> be very helpful to know if we've just expanded all the psymtabs
> into symtabs, or if we have some problem from the compiler that is
> causing us to get a vastly larger number of psymtabs for header
> files than we would normally have.
>
> This patch adds a few new entries to the objfile information printed
> by maint print statistics:
>
> Statistics for '/home/jmolenda/sware/gdb/b/gdb/gdb':
> Number of "stab" symbols read: 139907
> Number of "minimal" symbols read: 8022
> Number of "partial" symbols read: 24584
> Number of "types" defined: 4794
> * Number of psym tables (not yet expanded): 904
> * Number of symbol tables: 260
> * Number of symbol tables with line tables: 32
> * Number of symbol tables with blockvectors: 33
> Space used by a.out string tables: 1060259
> Total memory used for psymbol obstack: 1190666
> Total memory used for psymbol cache: 513072
> Total memory used for macro cache: 4072
> Total memory used for symbol obstack: 1717613
> Total memory used for type obstack: 550039
>
>
> I highlighted the new entries with '*'. This would be a very useful
> piece of information when presented with a slow gdb here at Apple
> - I think other folks may find it useful as well.
>
> This patch introduces no new testsuite failures.
Yes, but the new output needs to be tested. It is just because the .*
patterns in the maint.exp file. Could you add the new output to the
test file?
Otherwise, looks good.
elena
>
> Comments?
>
> J
> 2003-02-12 Jason Molenda (jmolenda@apple.com)
>
> * symmis.c (print_objfile_statistics): Include information about
> the number of psymtabs and symtabs in each object file.
>
> Index: symmisc.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/symmisc.c,v
> retrieving revision 1.14
> diff -u -p -r1.14 symmisc.c
> --- symmisc.c 18 Jan 2003 15:55:53 -0000 1.14
> +++ symmisc.c 13 Feb 2003 01:48:50 -0000
> @@ -179,6 +179,9 @@ void
> print_objfile_statistics (void)
> {
> struct objfile *objfile;
> + struct symtab *s;
> + struct partial_symtab *ps;
> + int i, linetables, blockvectors;
>
> immediate_quit++;
> ALL_OBJFILES (objfile)
> @@ -199,6 +202,28 @@ print_objfile_statistics (void)
> if (OBJSTAT (objfile, n_types) > 0)
> printf_filtered (" Number of \"types\" defined: %d\n",
> OBJSTAT (objfile, n_types));
> + i = 0;
> + ALL_OBJFILE_PSYMTABS (objfile, ps)
> + {
> + if (ps->readin == 0)
> + i++;
> + }
> + printf_filtered (" Number of psym tables (not yet expanded): %d\n", i);
> + i = linetables = blockvectors = 0;
> + ALL_OBJFILE_SYMTABS (objfile, s)
> + {
> + i++;
> + if (s->linetable != NULL)
> + linetables++;
> + if (s->primary == 1)
> + blockvectors++;
> + }
> + printf_filtered (" Number of symbol tables: %d\n", i);
> + printf_filtered (" Number of symbol tables with line tables: %d\n",
> + linetables);
> + printf_filtered (" Number of symbol tables with blockvectors: %d\n",
> + blockvectors);
> +
> if (OBJSTAT (objfile, sz_strtab) > 0)
> printf_filtered (" Space used by a.out string tables: %d\n",
> OBJSTAT (objfile, sz_strtab));
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: RFC: have maint print statistics print a little more
2003-02-13 14:52 ` Elena Zannoni
@ 2003-02-14 1:15 ` Jason Molenda
0 siblings, 0 replies; 4+ messages in thread
From: Jason Molenda @ 2003-02-14 1:15 UTC (permalink / raw)
To: Elena Zannoni; +Cc: gdb-patches
[-- Attachment #1: Type: text/plain, Size: 954 bytes --]
On Thu, Feb 13, 2003 at 09:57:05AM -0500, Elena Zannoni wrote:
> Yes, but the new output needs to be tested. It is just because the .*
> patterns in the maint.exp file. Could you add the new output to the
> test file?
>
> Otherwise, looks good.
Thanks, I assume this was permission to commit? I probably should
have asked that fifteen seconds ago. :-)
Eli reminded me to update any relevant documentation - maint print
statistics isn't documented. That itself could be considered a bug,
of course.
I committed the patch below. I can back it out if I misread the
above.
[ChangeLog]
2003-02-12 Jason Molenda (jmolenda@apple.com)
* symmisc.c (print_objfile_statistics): Include information about
the number of psymtabs and symtabs in each object file.
[testsuite/ChangeLog]
2003-02-13 Jason Molenda (jmolenda@apple.com)
* gdb.base/maint.exp: Update maint print statistics regexp to include
new entries.
J
[-- Attachment #2: pa.txt --]
[-- Type: text/plain, Size: 3311 bytes --]
[ChangeLog]
2003-02-12 Jason Molenda (jmolenda@apple.com)
* symmisc.c (print_objfile_statistics): Include information about
the number of psymtabs and symtabs in each object file.
[testsuite/ChangeLog]
2003-02-13 Jason Molenda (jmolenda@apple.com)
* gdb.base/maint.exp: Update maint print statistics regexp to include
new entries.
Index: symmisc.c
===================================================================
RCS file: /cvs/src/src/gdb/symmisc.c,v
retrieving revision 1.14
diff -u -p -r1.14 symmisc.c
--- symmisc.c 18 Jan 2003 15:55:53 -0000 1.14
+++ symmisc.c 14 Feb 2003 01:12:07 -0000
@@ -179,6 +179,9 @@ void
print_objfile_statistics (void)
{
struct objfile *objfile;
+ struct symtab *s;
+ struct partial_symtab *ps;
+ int i, linetables, blockvectors;
immediate_quit++;
ALL_OBJFILES (objfile)
@@ -199,6 +202,28 @@ print_objfile_statistics (void)
if (OBJSTAT (objfile, n_types) > 0)
printf_filtered (" Number of \"types\" defined: %d\n",
OBJSTAT (objfile, n_types));
+ i = 0;
+ ALL_OBJFILE_PSYMTABS (objfile, ps)
+ {
+ if (ps->readin == 0)
+ i++;
+ }
+ printf_filtered (" Number of psym tables (not yet expanded): %d\n", i);
+ i = linetables = blockvectors = 0;
+ ALL_OBJFILE_SYMTABS (objfile, s)
+ {
+ i++;
+ if (s->linetable != NULL)
+ linetables++;
+ if (s->primary == 1)
+ blockvectors++;
+ }
+ printf_filtered (" Number of symbol tables: %d\n", i);
+ printf_filtered (" Number of symbol tables with line tables: %d\n",
+ linetables);
+ printf_filtered (" Number of symbol tables with blockvectors: %d\n",
+ blockvectors);
+
if (OBJSTAT (objfile, sz_strtab) > 0)
printf_filtered (" Space used by a.out string tables: %d\n",
OBJSTAT (objfile, sz_strtab));
Index: testsuite/gdb.base/maint.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/maint.exp,v
retrieving revision 1.17
diff -u -p -r1.17 maint.exp
--- testsuite/gdb.base/maint.exp 24 Dec 2002 04:03:46 -0000 1.17
+++ testsuite/gdb.base/maint.exp 14 Feb 2003 01:12:09 -0000
@@ -180,7 +180,7 @@ gdb_expect {
send_gdb "maint print statistics\n"
gdb_expect {
- -re "Statistics for.*break.*Number of \"minimal\" symbols read.*Number of \"partial\" symbols read.*Number of \"types\" defined.*Total memory used for psymbol obstack.*Total memory used for psymbol cache.*Total memory used for symbol obstack.*Total memory used for type obstack.*$gdb_prompt $"\
+ -re "Statistics for.*break.*Number of \"minimal\" symbols read.*Number of \"partial\" symbols read.*Number of \"types\" defined.*Number of psym tables \\(not yet expanded\\).*Number of symbol tables.*Number of symbol tables with line tables.*Number of symbol tables with blockvectors.*Total memory used for psymbol obstack.*Total memory used for psymbol cache.*Total memory used for symbol obstack.*Total memory used for type obstack.*$gdb_prompt $"\
{ pass "maint print statistics" }
-re ".*$gdb_prompt $" { fail "maint print statistics" }
timeout { fail "(timeout) maint print statistics" }
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2003-02-14 1:15 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-02-13 1:54 RFC: have maint print statistics print a little more Jason Molenda
2003-02-13 2:31 ` David Carlton
2003-02-13 14:52 ` Elena Zannoni
2003-02-14 1:15 ` Jason Molenda
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox