Mon Mar 27 23:04:30 2006  Soeren Sandmann  <sandmann@redhat.com>

        * TODO: Updates.

        * sfile.c (handle_{begin,end}_element): Don't generate begin/end
        instructions for value elements.

        * sfile.c (build_instructions): Remove debugging spew.
This commit is contained in:
Soeren Sandmann
2006-03-28 04:08:14 +00:00
committed by Søren Sandmann Pedersen
parent 6534ca13c0
commit 9e612d798a
3 changed files with 43 additions and 44 deletions

View File

@ -1,3 +1,12 @@
Mon Mar 27 23:04:30 2006 Soeren Sandmann <sandmann@redhat.com>
* TODO: Updates.
* sfile.c (handle_{begin,end}_element): Don't generate begin/end
instructions for value elements.
* sfile.c (build_instructions): Remove debugging spew.
Mon Mar 27 21:44:04 2006 Soeren Sandmann <sandmann@redhat.com>
* sformat.[ch]: New files containing a simplified and sanitized

32
TODO
View File

@ -128,16 +128,6 @@ Before 1.2:
- split out dfa in its own generic class
- Formats should become first-class, stand-alone objects that offers
help with parsing and nothing else.
ParseContext* format_get_parse_context (format, err);
gboolean parse_context_begin (parse_context, name, err);
gboolean parse_context_end (parse_format, name, err);
basically, a Format encapsulates a DFA, and a ParseContext encapsulates
the current state.
- make a generic representation of xml files with quarks for strings:
struct item {
int begin/end/text;
@ -313,6 +303,18 @@ When the interrupt happens,
Later:
- Find out if sysprof accurately reports time spent handling pagefaults.
There is evidence that it doesn't:
- a version of sysprof took 10 seconds to load a certain profile.
Profiling itself it appeared that most of the time was spent
in the GMarkup parser
- a newer version of sysprof with significantly more compact
Instructions took about 5 seconds, but the profile looked
about the same.
The difference between the two versions has to be in page faults/
memory speed, but the profiles looked identically.
Try and reproduce this result in a more controlled experiment.
- See if it is possible to group the X server activity under the process that
generated it.
@ -490,6 +492,16 @@ Later:
DONE:
- Formats should become first-class, stand-alone objects that offers
help with parsing and nothing else.
ParseContext* format_get_parse_context (format, err);
gboolean parse_context_begin (parse_context, name, err);
gboolean parse_context_end (parse_format, name, err);
basically, a Format encapsulates a DFA, and a ParseContext encapsulates
the current state.
- make stackstash ref counted
- Charge 'self' properly to processes that don't get any stack trace at all

46
sfile.c
View File

@ -210,10 +210,6 @@ sfile_get_pointer (SFileInput *file,
{
Instruction *instruction;
instruction = file->current_instruction++;
g_return_if_fail (stype_is_pointer (instruction->type) &&
check_name (instruction, name));
instruction = file->current_instruction++;
g_return_if_fail (stype_is_pointer (instruction->type));
@ -228,12 +224,7 @@ sfile_get_pointer (SFileInput *file,
g_hash_table_insert (file->instructions_by_location, location, instruction);
}
instruction = file->current_instruction++;
g_return_if_fail (stype_is_pointer (instruction->type) &&
check_name (instruction, name));
}
}
void
sfile_get_integer (SFileInput *file,
@ -242,19 +233,11 @@ sfile_get_integer (SFileInput *file,
{
Instruction *instruction;
instruction = file->current_instruction++;
g_return_if_fail (stype_is_integer (instruction->type) &&
check_name (instruction, name));
instruction = file->current_instruction++;
g_return_if_fail (stype_is_integer (instruction->type));
if (integer)
*integer = instruction->u.integer.value;
instruction = file->current_instruction++;
g_return_if_fail (stype_is_integer (instruction->type) &&
check_name (instruction, name));
}
void
@ -264,19 +247,11 @@ sfile_get_string (SFileInput *file,
{
Instruction *instruction;
instruction = file->current_instruction++;
g_return_if_fail (stype_is_string (instruction->type) &&
check_name (instruction, name));
instruction = file->current_instruction++;
g_return_if_fail (stype_is_string (instruction->type));
if (string)
*string = g_strdup (instruction->u.string.value);
instruction = file->current_instruction++;
g_return_if_fail (stype_is_string (instruction->type) &&
check_name (instruction, name));
}
static void
@ -386,10 +361,12 @@ handle_begin_element (GMarkupParseContext *parse_context,
set_unknown_element_error (err, "<%s> unexpected here", element_name);
return;
}
/* FIXME - not10: is there really a reason to add begin/end instructions for values? */
instruction.kind = BEGIN;
g_array_append_val (build->instructions, instruction);
if (stype_is_list (instruction.type) || stype_is_record (instruction.type))
{
instruction.kind = BEGIN;
g_array_append_val (build->instructions, instruction);
}
}
static void
@ -408,9 +385,12 @@ handle_end_element (GMarkupParseContext *context,
return;
}
instruction.kind = END;
if (stype_is_list (instruction.type) || stype_is_record (instruction.type))
{
instruction.kind = END;
g_array_append_val (build->instructions, instruction);
g_array_append_val (build->instructions, instruction);
}
}
static gboolean
@ -671,8 +651,6 @@ build_instructions (const char *contents, SFormat *format, int *n_instructions,
*n_instructions = build.instructions->len;
g_print ("n instructions: %d\n", *n_instructions);
return (Instruction *)g_array_free (build.instructions, FALSE);
}