From: Geoffrey Keating Date: Thu, 5 Jun 2008 02:09:33 +0000 (+0000) Subject: Apply patch from binutils to demangle local-source names. Binutils X-Git-Tag: 1.1.2~66 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e11dfce31fa6f8fbcffc49939be5116671e8daf5;p=platform%2Fupstream%2Fsysprof.git Apply patch from binutils to demangle local-source names. Binutils Wed Jun 4 21:52:17 2008 Søren Sandmann * demangle.c: Apply patch from binutils to demangle local-source names. Binutils changelog: 2007-05-05 Geoffrey Keating * cp-demangle.c (d_name): Detect local-source-name. (d_prefix): Likewise. (d_unqualified_name): Implement local-source-name. * sysprof.c: Update copyright statement svn path=/trunk/; revision=434 --- diff --git a/ChangeLog b/ChangeLog index 895aded..b501193 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +Wed Jun 4 21:52:17 2008 Søren Sandmann + + * demangle.c: Apply patch from binutils to demangle local-source + names. Binutils changelog: + + 2007-05-05 Geoffrey Keating + + * cp-demangle.c (d_name): Detect local-source-name. + (d_prefix): Likewise. + (d_unqualified_name): Implement local-source-name. + + * sysprof.c: Update copyright statement + Mon Jun 2 01:35:25 2008 Søren Sandmann * demangle.c: Remove weird comment. diff --git a/TODO b/TODO index b726d50..b806b89 100644 --- a/TODO +++ b/TODO @@ -23,9 +23,14 @@ Before 1.0.4: Before 1.2: -* For glibc, the debug files do not contain .strtab and .symtab, but - the original files do. The algorithm in binfile.c must be modified - accordingly. +* Hack to disable recursion for binaries without symbols causes the + symbols to not work the way other symbols do. A better approach is + probably to simply generate a new symbol for every appearance except + leaf nodes, which should still be considered one symbol (or maybe be + considered the same symbol if they have the same parent). In fact + "has same parent" may be the correct criterion in all cases. + +* It crashes sometimes. * Find out what is going on with kernel threads: @@ -40,9 +45,10 @@ Before 1.2: * Is the move-to-front in process_locate_map() really worth it? -* Whenever we fail to lock the atomic variable, track this, and send the information - to userspace as an indication of the overhead of the profiling. Although there is - inherent aliasing here since stack scanning happens at regular intervals. +* Whenever we fail to lock the atomic variable, track this, and send the + information to userspace as an indication of the overhead of the profiling. + Although there is inherent aliasing here since stack scanning happens at + regular intervals. * Apparently, if you upgrade the kernel, then don't re-run configure, the kernel Makefile will delete all of /lib/modules//kernel @@ -823,6 +829,19 @@ Later: -=-=-=-=-=-=-=-=-=-=-=-=-=-=- ALREADY DONE: -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- +* Find out why the strings + + _ZL11DisplayLineP20nsDisplayListBuilderRK6nsRectS3_R19nsLineList_iteratoriRiRK16nsDisplayListSetP12nsBlockFrame + _ZL11DisplayRowsP20nsDisplayListBuilderP7nsFrameRK6nsRectRK16nsDisplayListSet _ZL11DrawBordersP10gfxContextR7gfxRectS2_PhPdS4_PjPP14nsBorderColorsijiP6nsRect _ZL11HandleEventP10nsGUIEvent + _ZL12IsContentLEQP13nsDisplayItemS0_Pv + _ZL15expose_event_cbP10_GtkWidgetP15_GdkEventExpose + + do not get demangled. + +* For glibc, the debug files do not contain .strtab and .symtab, but + the original files do. The algorithm in binfile.c must be modified + accordingly. + * If we profile something that is not very CPU bound, sysprof itself seems to get a disproportionate amount of the samples. Should look into this. Fixed by only returning from poll when there is more diff --git a/demangle.c b/demangle.c index a6c9c45..ac0381b 100644 --- a/demangle.c +++ b/demangle.c @@ -1944,7 +1944,8 @@ d_prefix (di) if (IS_DIGIT (peek) || IS_LOWER (peek) || peek == 'C' - || peek == 'D') + || peek == 'D' + || peek == 'L') dc = d_unqualified_name (di); else if (peek == 'S') dc = d_substitution (di, 1); @@ -1978,6 +1979,9 @@ d_prefix (di) /* ::= ::= ::= + ::= + + ::= L */ static struct demangle_component * @@ -2000,6 +2004,19 @@ d_unqualified_name (di) } else if (peek == 'C' || peek == 'D') return d_ctor_dtor_name (di); + else if (peek == 'L') + { + struct demangle_component * ret; + + d_advance (di, 1); + + ret = d_source_name (di); + if (ret == NULL) + return NULL; + if (! d_discriminator (di)) + return NULL; + return ret; + } else return NULL; } diff --git a/elfparser.c b/elfparser.c index 5f839cd..b2dea5d 100644 --- a/elfparser.c +++ b/elfparser.c @@ -651,11 +651,11 @@ elf_parser_get_text_offset (ElfParser *parser) static gchar * make_hex_string (const guchar *data, int n_bytes) { - GString *string = g_string_new (NULL); - const char hex_digits[] = { + static const char hex_digits[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' }; + GString *string = g_string_new (NULL); int i; for (i = 0; i < n_bytes; ++i) diff --git a/sysprof.c b/sysprof.c index 7d311e9..a7b05fa 100644 --- a/sysprof.c +++ b/sysprof.c @@ -1,6 +1,6 @@ /* Sysprof -- Sampling, systemwide CPU profiler * Copyright 2004, Red Hat, Inc. - * Copyright 2004, 2005, 2006, 2007, Soeren Sandmann + * Copyright 2004, 2005, 2006, 2007, 2008, Soeren Sandmann * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -665,7 +665,7 @@ on_about_activated (GtkWidget *widget, gpointer data) gtk_show_about_dialog (GTK_WINDOW (app->main_window), "logo", app->icon, name_property, APPLICATION_NAME, - "copyright", "Copyright 2004-2007, S"OSLASH"ren Sandmann", + "copyright", "Copyright 2004-2008, S"OSLASH"ren Sandmann", "version", PACKAGE_VERSION, NULL); }