mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2026-02-12 16:10:54 +00:00
New function. Only warn once about bad CRC's.
Mon Mar 5 16:55:39 2007 Søren Sandmann <sandmann@redhat.com> * binfile.c (already_warned): New function. Only warn once about bad CRC's. svn path=/trunk/; revision=361
This commit is contained in:
committed by
Søren Sandmann Pedersen
parent
7800fcd870
commit
7b821752f9
@ -1,3 +1,8 @@
|
|||||||
|
Mon Mar 5 16:55:39 2007 Søren Sandmann <sandmann@redhat.com>
|
||||||
|
|
||||||
|
* binfile.c (already_warned): New function. Only warn once about
|
||||||
|
bad CRC's.
|
||||||
|
|
||||||
2007-03-02 Soren Sandmann <sandmann@daimi.au.dk>
|
2007-03-02 Soren Sandmann <sandmann@daimi.au.dk>
|
||||||
|
|
||||||
* sysprof-text.c (dump_data): Make this function static
|
* sysprof-text.c (dump_data): Make this function static
|
||||||
|
|||||||
24
binfile.c
24
binfile.c
@ -68,6 +68,26 @@ read_inode (const char *filename)
|
|||||||
return statbuf.st_ino;
|
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 *
|
static ElfParser *
|
||||||
separate_debug_file_exists (const char *name, guint32 crc)
|
separate_debug_file_exists (const char *name, guint32 crc)
|
||||||
{
|
{
|
||||||
@ -89,6 +109,7 @@ separate_debug_file_exists (const char *name, guint32 crc)
|
|||||||
|
|
||||||
if (file_crc != crc)
|
if (file_crc != crc)
|
||||||
{
|
{
|
||||||
|
if (!already_warned (name))
|
||||||
g_print ("warning: %s has wrong crc \n", name);
|
g_print ("warning: %s has wrong crc \n", name);
|
||||||
|
|
||||||
elf_parser_free (parser);
|
elf_parser_free (parser);
|
||||||
@ -139,6 +160,9 @@ get_debug_file (ElfParser *elf,
|
|||||||
|
|
||||||
for (i = 0; i < N_TRIES; ++i)
|
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);
|
result = separate_debug_file_exists (tries[i], crc32);
|
||||||
if (result)
|
if (result)
|
||||||
{
|
{
|
||||||
|
|||||||
30
profile.c
30
profile.c
@ -75,21 +75,6 @@ create_format (void)
|
|||||||
return format;
|
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
|
static void
|
||||||
serialize_call_tree (StackNode *node,
|
serialize_call_tree (StackNode *node,
|
||||||
SFileOutput *output)
|
SFileOutput *output)
|
||||||
@ -599,6 +584,21 @@ profile_caller_free (ProfileCaller *caller)
|
|||||||
g_free (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
|
static void
|
||||||
build_object_list (StackNode *node, gpointer data)
|
build_object_list (StackNode *node, gpointer data)
|
||||||
{
|
{
|
||||||
|
|||||||
2
sfile.c
2
sfile.c
@ -175,7 +175,7 @@ struct SFileInput
|
|||||||
GHashTable *instructions_by_location;
|
GHashTable *instructions_by_location;
|
||||||
};
|
};
|
||||||
|
|
||||||
gboolean
|
static gboolean
|
||||||
check_name (Instruction *instr,
|
check_name (Instruction *instr,
|
||||||
const char *name)
|
const char *name)
|
||||||
{
|
{
|
||||||
|
|||||||
12
sfile.h
12
sfile.h
@ -78,6 +78,18 @@ SerializerFormat *serializer_make_pointer (Serializer *serialiser,
|
|||||||
* enums, optionals, selections, empties
|
* 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
|
* 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
|
* different versions of the format, and they want to be able to sniff the
|
||||||
|
|||||||
@ -1405,7 +1405,6 @@ build_gui (Application *app)
|
|||||||
gtk_widget_realize (GTK_WIDGET (app->main_window));
|
gtk_widget_realize (GTK_WIDGET (app->main_window));
|
||||||
|
|
||||||
/* Tool items */
|
/* Tool items */
|
||||||
|
|
||||||
app->start_button = glade_xml_get_widget (xml, "start_button");
|
app->start_button = glade_xml_get_widget (xml, "start_button");
|
||||||
app->profile_button = glade_xml_get_widget (xml, "profile_button");
|
app->profile_button = glade_xml_get_widget (xml, "profile_button");
|
||||||
app->reset_button = glade_xml_get_widget (xml, "reset_button");
|
app->reset_button = glade_xml_get_widget (xml, "reset_button");
|
||||||
|
|||||||
Reference in New Issue
Block a user