Tue Dec 20 16:03:29 2005  Soeren Sandmann  <sandmann@redhat.com>

	* TODO: Updates

	* sysprof-text.c (main): Make it try and load the module before
	complaining.
This commit is contained in:
Soeren Sandmann
2005-12-20 20:51:39 +00:00
committed by Søren Sandmann Pedersen
parent ad5ffd749b
commit c5172c58e6
4 changed files with 53 additions and 30 deletions

View File

@ -1,3 +1,10 @@
Tue Dec 20 16:03:29 2005 Soeren Sandmann <sandmann@redhat.com>
* TODO: Updates
* sysprof-text.c (main): Make it try and load the module before
complaining.
2005-12-20 Kristian Høgsberg <krh@redhat.com>
* Makefile.am: Dist and install udev rule.

12
TODO
View File

@ -52,7 +52,6 @@ Before 1.2:
recursive profiles. Hypothesis: seen_nodes can grow large, and the
algorithm is O(n^2) in the length of the trace.
- make the things we put in a stackstash real
objects so that
- we can save them
@ -100,9 +99,12 @@ Before 1.2:
* Make provisions for forward compatibility: maybe it should be possible
to load records with more fields than specified.
* Figure out how to make sfile.[ch] use less memory.
* Figure out how to make sfile.[ch] use less memory.
- In general clean sfile.[ch] up a little:
- split out dfa in its own generic class
- make a generic representation of xml files with quarks for strings:
struct item {
int begin/end/text;
@ -111,12 +113,12 @@ Before 1.2:
}
perhaps even with iterators. Should be compact and suitable for both
input and output..
- make the api a little saner; add format/content structs
-
- make the api saner; add format/content structs
* See if the auto-expanding can be made more intelligent
- "Everything" should be expanded exactly one level
- all nodes should be expanded at least one level
- all trees should be expanded at least one level
* Send entire stack to user space, then do stackwalking there. That would
allow us to do more complex algorithms, like dwarf, in userspace. Though

View File

@ -176,9 +176,28 @@ open_fd (Collector *collector,
fd = open (SYSPROF_FILE, O_RDONLY);
if (fd < 0)
{
load_module();
fd = open (SYSPROF_FILE, O_RDONLY);
if (load_module())
{
GTimer *timer = g_timer_new ();
while (fd < 0 && g_timer_elapsed (timer, NULL) < 0.5)
{
usleep (100000);
g_print ("open\n");
fd = open (SYSPROF_FILE, O_RDONLY);
}
g_timer_destroy (timer);
if (fd < 0)
{
/* FIXME: set "module is loaded but no file error" */
}
}
/* Wait for udev to discover the new device */
if (fd < 0)
{

View File

@ -75,13 +75,13 @@ no_module (void)
{
perror (SYSPROF_FILE);
fprintf (stderr,
"\n"
"Can't open " SYSPROF_FILE ". You need to insert "
"the sysprof kernel module. Run\n"
"\n"
" modprobe sysprof-module\n"
"\n"
"as root.\n");
"\n"
"Can't open " SYSPROF_FILE ". You need to insert "
"the sysprof kernel module. Run\n"
"\n"
" modprobe sysprof-module\n"
"\n"
"as root.\n");
}
static void
@ -92,7 +92,7 @@ usage (const char *name)
"Usage: \n"
" %s <outfile>\n"
"\n"
"On SIGTERM or SIGINT (Ctrl-C) write the profile to <outfile>\n"
"On SIGTERM or SIGINT (Ctrl-C) the profile will be written to <outfile>\n"
"\n",
name);
}
@ -103,38 +103,33 @@ main (int argc,
{
gboolean quit;
Application *app = g_new0 (Application, 1);
int fd;
fd = open (SYSPROF_FILE, O_RDONLY);
app->collector = collector_new (NULL, NULL);
app->outfile = g_strdup (argv[1]);
app->main_loop = g_main_loop_new (NULL, 0);
/* FIXME: get the real error */
quit = FALSE;
if (fd < 0)
if (!collector_start (app->collector, NULL))
{
no_module ();
no_module();
quit = TRUE;
}
if (argc < 2)
{
usage (argv[0]);
quit = TRUE;
}
if (quit)
return -1;
app->collector = collector_new (NULL, NULL);
app->outfile = g_strdup (argv[1]);
app->main_loop = g_main_loop_new (NULL, 0);
/* FIXME: check the errors */
signal_set_handler (SIGTERM, signal_handler, app, NULL);
signal_set_handler (SIGINT, signal_handler, app, NULL);
/* FIXME: check the error */
collector_start (app->collector, NULL);
g_main_loop_run (app->main_loop);
signal_unset_handler (SIGTERM);