Implement this function

Sat May  7 13:57:17 2005  Søren Sandmann  <sandmann@redhat.com>

	* sfile.c (sfile_output_free): Implement this function

	* sfile.c (sfile_input_free): Implement this function
This commit is contained in:
Søren Sandmann
2005-05-07 17:57:59 +00:00
committed by Søren Sandmann Pedersen
parent 582efc99b2
commit c427b88352
5 changed files with 51 additions and 31 deletions

View File

@ -1,3 +1,9 @@
Sat May 7 13:57:17 2005 Søren Sandmann <sandmann@redhat.com>
* sfile.c (sfile_output_free): Implement this function
* sfile.c (sfile_input_free): Implement this function
Fri May 6 23:38:48 2005 Søren Sandmann <sandmann@redhat.com> Fri May 6 23:38:48 2005 Søren Sandmann <sandmann@redhat.com>
* sysprof-module.c (do_generate): Another desparate hack to try * sysprof-module.c (do_generate): Another desparate hack to try

View File

@ -180,7 +180,7 @@ separate_debug_file_exists (const char *name, unsigned long crc)
return crc == file_crc; return crc == file_crc;
} }
/* FIXME: this should be detected by config.h */ /* FIXME - not10: this should probably be detected by config.h -- find out what gdb does*/
static const char *debug_file_directory = "/usr/lib/debug"; static const char *debug_file_directory = "/usr/lib/debug";
static char * static char *

View File

@ -212,7 +212,7 @@ profile_load (const char *filename, GError **err)
sfile_begin_get_record (input, "profile"); sfile_begin_get_record (input, "profile");
sfile_get_integer (input, "size", &profile->size); sfile_get_integer (input, "size", &profile->size);
sfile_get_pointer (input, "call_tree", &profile->call_tree); sfile_get_pointer (input, "call_tree", (void **)&profile->call_tree);
n = sfile_begin_get_list (input, "objects"); n = sfile_begin_get_list (input, "objects");
for (i = 0; i < n; ++i) for (i = 0; i < n; ++i)
@ -295,7 +295,7 @@ generate_key (Process *process, gulong address)
static char * static char *
generate_presentation_name (Process *process, gulong address) generate_presentation_name (Process *process, gulong address)
{ {
/* FIXME using 0 to indicate "process" is broken */ /* FIXME - not10 - using 0 to indicate "process" is broken */
if (address) if (address)
{ {
const Symbol *symbol = process_lookup_symbol (process, address); const Symbol *symbol = process_lookup_symbol (process, address);
@ -306,10 +306,6 @@ generate_presentation_name (Process *process, gulong address)
{ {
return g_strdup_printf ("%s", process_get_cmdline (process)); return g_strdup_printf ("%s", process_get_cmdline (process));
} }
#if 0
/* FIXME - don't return addresses and stuff */
return generate_key (profile, process, address);
#endif
} }
static void static void

48
sfile.c
View File

@ -353,6 +353,9 @@ sformat_new_union (const char *name,
} }
#endif #endif
#define RECORD_SHIFT (sizeof (SType) * 8 - 1)
#define LIST_SHIFT (sizeof (SType) * 8 - 2)
static SType static SType
define_type (SType *type, SType fallback) define_type (SType *type, SType fallback)
{ {
@ -369,6 +372,20 @@ define_type (SType *type, SType fallback)
return fallback; return fallback;
} }
static gboolean
is_record_type (SType type)
{
/* FIMXE - not10 */
return TRUE;
}
static gboolean
is_list_type (SType type)
{
/* FIXME - not10 */
return TRUE;
}
gpointer gpointer
sformat_new_record (const char * name, sformat_new_record (const char * name,
SType *type, SType *type,
@ -641,20 +658,6 @@ struct SFileInput
GHashTable *instructions_by_location; GHashTable *instructions_by_location;
}; };
static gboolean
is_record_type (SType type)
{
/* FIXME */
return TRUE;
}
static gboolean
is_list_type (SType type)
{
/* FIXME */
return TRUE;
}
void void
sfile_begin_get_record (SFileInput *file, const char *name) sfile_begin_get_record (SFileInput *file, const char *name)
{ {
@ -1610,13 +1613,26 @@ sfile_output_save (SFileOutput *sfile,
void void
sfile_input_free (SFileInput *file) sfile_input_free (SFileInput *file)
{ {
/* FIXME */ free_instructions (file->instructions, file->n_instructions);
g_hash_table_destroy (file->instructions_by_location);
g_free (file);
} }
void void
sfile_output_free (SFileOutput *sfile) sfile_output_free (SFileOutput *sfile)
{ {
/* FIXME */ Instruction *instructions;
int n_instructions;
n_instructions = sfile->instructions->len;
instructions = g_array_free (sfile->instructions, FALSE);
free_instructions (instructions, n_instructions);
g_hash_table_destroy (sfile->objects);
g_free (sfile);
} }

18
sfile.h
View File

@ -27,9 +27,9 @@ typedef guint SType;
* *
* Serializer *serializer_new (SerializerFormat *format); * Serializer *serializer_new (SerializerFormat *format);
* *
* SerializerReadContext *serializer_begin_read (serializer *serialize, * SerializerReadContext *serializer_begin_read_filename (serializer *serialize,
* const char *filename, * const char *filename,
* GError *err); * GError *err);
* serializer_get_blah (SerializerReadContext *); * serializer_get_blah (SerializerReadContext *);
* void serialzier_end_read (...); * void serialzier_end_read (...);
* *
@ -82,8 +82,10 @@ void sformat_free (SFormat *format);
SFileInput * sfile_load (const char *filename, SFileInput * sfile_load (const char *filename,
SFormat *format, SFormat *format,
GError **err); GError **err);
void sfile_begin_get_record (SFileInput *file, const char *name); void sfile_begin_get_record (SFileInput *file,
int sfile_begin_get_list (SFileInput *file, const char *name); const char *name);
int sfile_begin_get_list (SFileInput *file,
const char *name);
void sfile_get_pointer (SFileInput *file, void sfile_get_pointer (SFileInput *file,
const char *name, const char *name,
gpointer *pointer); gpointer *pointer);
@ -111,9 +113,9 @@ void sfile_loader_free (SFileLoader *loader);
/* - Writing - */ /* - Writing - */
/* FIXME: see if we can't get rid of the names. It should be /* FIXME - not10: see if we can't get rid of the names. It
= * possible to pass NULL to state_transition_check() and * should be possible to pass NULL to state_transition_check()
* have it interprete that as "whatever". We would need * and have it interprete that as "whatever". We would need
* a way to get the name back then, though. * a way to get the name back then, though.
*/ */