rpms/sysprof/devel README.Fedora, NONE, 1.1 sysprof-1.0.9-warn-for-missing-module.patch, NONE, 1.1 sysprof.spec, 1.9, 1.10

Gianluca Sforna (giallu) fedora-extras-commits at redhat.com
Thu Dec 27 10:08:18 UTC 2007


Author: giallu

Update of /cvs/extras/rpms/sysprof/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv13546

Modified Files:
	sysprof.spec 
Added Files:
	README.Fedora sysprof-1.0.9-warn-for-missing-module.patch 
Log Message:
* Thu Dec 27 2007 Gianluca Sforna <giallu gmail com> - 1.0.9-3
- add subpackage with kernel module sources
- obsolete kmod-sysprof
- add patch for warning user about missing module
- add README.Fedora file with module build procedure



--- NEW FILE README.Fedora ---
How to build the kernel module for sysprof

In order to build and install in the proper location the sysprof kernel
module, run as root:


sysprof-1.0.9-warn-for-missing-module.patch:

--- NEW FILE sysprof-1.0.9-warn-for-missing-module.patch ---
Index: sysprof-1.0.9/sysprof.c
===================================================================
--- sysprof-1.0.9.orig/sysprof.c
+++ sysprof-1.0.9/sysprof.c
@@ -543,32 +543,67 @@ on_start_toggled (GtkWidget *widget, gpo
 
     if (app->input_fd == -1)
     {
-	int fd;
 
-	fd = open ("/proc/sysprof-trace", O_RDONLY);
-	if (fd < 0)
-	{
-	    load_module();
-
-	    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;
-	    }
-	}
+        // Check for kernel module existence
+        gchar * modules_path;
+        gchar * standard_output;
+        gchar * standard_error;
+        int exit_status = -1;
+        if (g_spawn_command_line_sync ("/bin/uname -r",
+                    &standard_output, &standard_error,
+                    &exit_status,
+                    NULL))
+        {
+            g_strchomp( standard_output );
+            gchar * module_path;
+            module_path = g_strdup_printf( "/lib/modules/%s/extra/sysprof-module.ko", standard_output );
+
+            if ( ! g_file_test( module_path, G_FILE_TEST_EXISTS ))
+            {
+                sorry (app->main_window,
+                        "Can not find sysprof kernel module in:\n\n"
+                        "       %s\n\n"
+                        "Please see:\n"
+                        "\n"
+                        "       %s/README.Fedora\n"
+                        "\n"
+                        "for more info about module installation.", module_path, PACKAGE_DOCDIR );
+                g_free( module_path );
+                update_sensitivity (app);
+                return;
+
+            }
+            g_free (standard_output);
+            g_free (standard_error);
+            g_free( module_path );
+        }
+
+        int fd;
+
+        fd = open ("/proc/sysprof-trace", O_RDONLY);
+        if (fd < 0)
+        {
+            load_module();
+
+            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;
-	fd_add_watch (app->input_fd, app);
+        app->input_fd = fd;
+        fd_add_watch (app->input_fd, app);
     }
     
     fd_set_read_callback (app->input_fd, on_read);


Index: sysprof.spec
===================================================================
RCS file: /cvs/extras/rpms/sysprof/devel/sysprof.spec,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- sysprof.spec	7 Dec 2007 21:43:24 -0000	1.9
+++ sysprof.spec	27 Dec 2007 10:07:36 -0000	1.10
@@ -1,6 +1,6 @@
 Name:           sysprof      
 Version:        1.0.9
-Release:        2%{?dist}
+Release:        3%{?dist}
 Summary:        Sysprof is a sampling CPU profiler
 Group:          Development/System
 License:        GPLv2+
@@ -9,12 +9,16 @@
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 Source1:        sysprof.desktop
+Source2:        README.Fedora
+Patch0:         sysprof-1.0.9-warn-for-missing-module.patch
 
 BuildRequires:  gtk2-devel => 2.6
 BuildRequires:  libglade2-devel
 BuildRequires:  binutils-devel
 BuildRequires:  desktop-file-utils
 
+Requires:       sysprof-module = %{version}
+
 ExclusiveArch:  %{ix86} x86_64
 
 %description
@@ -23,12 +27,41 @@
 Sysprof handles shared libraries and applications do not need to be
 recompiled. In fact they don't even have to be restarted.
 
+
+%package module
+Summary:        Source code for the required kernel module
+Group:          Development/System
+Requires:       kernel-devel
+Requires:       %{name} = %{version}
+
+# Replace old kmods - to be removed in Fedora 11
+Obsoletes:      kmod-sysprof <= 1.0.9-3
+
+
+%description module
+Sysprof needs a kernel module to be inserted before profiling could start.
+
+This package provides the necessary source files for building sysprof-module
+
+The full build/install procedure is described in:
+%{_docdir}/%{name}-%{version}/README.Fedora
+
+
 %prep
 %setup -q
+%patch0 -p1
+# Finish up README file
+cp %{SOURCE2} ./README.Fedora
+echo "cd %{_docdir}/sysprof-module-%{version}/module" >> README.Fedora
+echo "make modules install" >> README.Fedora
 
 
 %build
 %configure --disable-kernel-module
+
+# Add info about README.Fedora
+echo "#define PACKAGE_DOCDIR \"%{_docdir}/sysprof-module-%{version}\"" >> config.h
+
 make %{?_smp_mflags}
 
 
@@ -55,7 +88,19 @@
 %{_datadir}/sysprof/sysprof.glade
 %{_datadir}/applications/*.desktop
 
+
+%files module
+%defattr(-,root,root,-)
+%doc README.Fedora config.h module/
+
+
 %changelog
+* Thu Dec 27 2007 Gianluca Sforna <giallu gmail com> - 1.0.9-3
+- add subpackage with kernel module sources
+- obsolete kmod-sysprof
+- add patch for warning user about missing module
+- add README.Fedora file with module build procedure
+
 * Fri Dec 07 2007 Release Engineering <rel-eng at fedoraproject dot org> - 1.0.9-2
 - Rebuild for deps
 




More information about the fedora-extras-commits mailing list