diff --git a/ChangeLog b/ChangeLog index d824282d..eddc8051 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Mon Mar 5 16:55:39 2007 Søren Sandmann + + * binfile.c (already_warned): New function. Only warn once about + bad CRC's. + 2007-03-02 Soren Sandmann * sysprof-text.c (dump_data): Make this function static diff --git a/binfile.c b/binfile.c index 636607e9..bffa39f8 100644 --- a/binfile.c +++ b/binfile.c @@ -68,6 +68,26 @@ read_inode (const char *filename) return statbuf.st_ino; } +static gboolean +already_warned (const char *name) +{ + static GPtrArray *warnings; + int i; + + if (!warnings) + warnings = g_ptr_array_new (); + + for (i = 0; i < warnings->len; ++i) + { + if (strcmp (warnings->pdata[i], name) == 0) + return TRUE; + } + + g_ptr_array_add (warnings, g_strdup (name)); + + return FALSE; +} + static ElfParser * separate_debug_file_exists (const char *name, guint32 crc) { @@ -89,7 +109,8 @@ separate_debug_file_exists (const char *name, guint32 crc) if (file_crc != crc) { - g_print ("warning: %s has wrong crc \n", name); + if (!already_warned (name)) + g_print ("warning: %s has wrong crc \n", name); elf_parser_free (parser); @@ -136,9 +157,12 @@ get_debug_file (ElfParser *elf, tries[1] = g_build_filename (dir, ".debug", basename, NULL); tries[2] = g_build_filename ("/usr", "lib", "debug", dir, basename, NULL); tries[3] = g_build_filename (debug_file_directory, dir, basename, NULL); - + for (i = 0; i < N_TRIES; ++i) { +#if 0 + g_print ("trying: %s\n", tries[i]); +#endif result = separate_debug_file_exists (tries[i], crc32); if (result) { diff --git a/profile.c b/profile.c index f4eb5fa7..f87701b0 100644 --- a/profile.c +++ b/profile.c @@ -75,21 +75,6 @@ create_format (void) return format; } -static int -compute_total (StackNode *node) -{ - StackNode *n; - int total = 0; - - for (n = node; n != NULL; n = n->next) - { - if (n->toplevel) - total += n->total; - } - - return total; -} - static void serialize_call_tree (StackNode *node, SFileOutput *output) @@ -599,6 +584,21 @@ profile_caller_free (ProfileCaller *caller) g_free (caller); } +static int +compute_total (StackNode *node) +{ + StackNode *n; + int total = 0; + + for (n = node; n != NULL; n = n->next) + { + if (n->toplevel) + total += n->total; + } + + return total; +} + static void build_object_list (StackNode *node, gpointer data) { diff --git a/sfile.c b/sfile.c index 9fd90148..ce472b7d 100644 --- a/sfile.c +++ b/sfile.c @@ -175,7 +175,7 @@ struct SFileInput GHashTable *instructions_by_location; }; -gboolean +static gboolean check_name (Instruction *instr, const char *name) { diff --git a/sfile.h b/sfile.h index abee28b3..20f8aa55 100644 --- a/sfile.h +++ b/sfile.h @@ -78,6 +78,18 @@ SerializerFormat *serializer_make_pointer (Serializer *serialiser, * enums, optionals, selections, empties * * + * Other things: + * + * "selections" - when several different types are possible - would need lambda transitions in and out + * + * ability to allow 'ignored' elements that are simply skipped at parse time. This could become important + * for future-proofing files. + * + * unions maybe? + * + * + * + * *============================================== * Also think about versioning - apps will want to be able to read and write * different versions of the format, and they want to be able to sniff the diff --git a/sysprof.c b/sysprof.c index c4f664ef..24f2c62c 100644 --- a/sysprof.c +++ b/sysprof.c @@ -1405,7 +1405,6 @@ build_gui (Application *app) gtk_widget_realize (GTK_WIDGET (app->main_window)); /* Tool items */ - app->start_button = glade_xml_get_widget (xml, "start_button"); app->profile_button = glade_xml_get_widget (xml, "profile_button"); app->reset_button = glade_xml_get_widget (xml, "reset_button");