mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2026-02-10 15:10:53 +00:00
more updates
Sun May 8 16:31:32 2005 Søren Sandmann <sandmann@redhat.com> * TODO: more updates * sysprof.c: Try loading the module before complaining
This commit is contained in:
committed by
Søren Sandmann Pedersen
parent
aaa38daad8
commit
11c0561976
38
sysprof.c
38
sysprof.c
@ -430,6 +430,15 @@ sorry (GtkWidget *parent_window,
|
||||
gtk_widget_destroy (dialog);
|
||||
}
|
||||
|
||||
|
||||
static gboolean
|
||||
load_module (void)
|
||||
{
|
||||
int retval = system ("/sbin/modprobe sysprof-module");
|
||||
|
||||
return (retval == 0);
|
||||
}
|
||||
|
||||
static void
|
||||
on_start_toggled (GtkWidget *widget, gpointer data)
|
||||
{
|
||||
@ -441,19 +450,28 @@ on_start_toggled (GtkWidget *widget, gpointer data)
|
||||
|
||||
if (app->input_fd == -1)
|
||||
{
|
||||
int fd = open ("/proc/sysprof-trace", O_RDONLY);
|
||||
int fd;
|
||||
|
||||
fd = open ("/proc/sysprof-trace", O_RDONLY);
|
||||
if (fd < 0)
|
||||
{
|
||||
sorry (app->main_window,
|
||||
"Can't open /proc/sysprof-trace. You need to insert\n"
|
||||
"the sysprof kernel module. Type\n"
|
||||
"\n"
|
||||
" modprobe sysprof-module\n"
|
||||
"\n"
|
||||
"as root.");
|
||||
load_module();
|
||||
|
||||
update_sensitivity (app);
|
||||
return;
|
||||
fd = open ("/proc/sysprof-trace", O_RDONLY);
|
||||
|
||||
if (fd < 0)
|
||||
{
|
||||
sorry (app->main_window,
|
||||
"Can't open /proc/sysprof-trace. You need to insert\n"
|
||||
"the sysprof kernel module. Run\n"
|
||||
"\n"
|
||||
" modprobe sysprof-module\n"
|
||||
"\n"
|
||||
"as root.");
|
||||
|
||||
update_sensitivity (app);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
app->input_fd = fd;
|
||||
|
||||
Reference in New Issue
Block a user