rpms/preload/devel preload.cmdline.c.patch, NONE, 1.1 preload.conf.in.patch, NONE, 1.1 preload.init.in.patch, NONE, 1.1 preload.logrotate.in.patch, NONE, 1.1 preload.proc.c.patch, NONE, 1.1 preload.prophet.c.patch, NONE, 1.1 preload.readahead.c.patch, NONE, 1.1 preload.readahead.h.patch, NONE, 1.1 preload.spec, NONE, 1.1 preload.state.c.patch, NONE, 1.1 .cvsignore, 1.1, 1.2 sources, 1.1, 1.2

Marc Wiriadisastra (mwiriadi) fedora-extras-commits at redhat.com
Thu Jan 17 21:23:15 UTC 2008


Author: mwiriadi

Update of /cvs/pkgs/rpms/preload/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv15666/devel

Modified Files:
	.cvsignore sources 
Added Files:
	preload.cmdline.c.patch preload.conf.in.patch 
	preload.init.in.patch preload.logrotate.in.patch 
	preload.proc.c.patch preload.prophet.c.patch 
	preload.readahead.c.patch preload.readahead.h.patch 
	preload.spec preload.state.c.patch 
Log Message:
Initial release


preload.cmdline.c.patch:

--- NEW FILE preload.cmdline.c.patch ---
--- preload-0.4/src/cmdline.c	2005-09-06 18:41:47.000000000 +0800
+++ preload.cvs/src/cmdline.c	2007-11-10 16:05:17.000000000 +0900
@@ -129,7 +129,7 @@
 static void
 version_func (void)
 {
-  printf ("%s\n\nCopyright (C) 2005 Behdad Esfahbod.\n"
+  printf ("%s\n\nCopyright (C) 2005,2006,2007 Behdad Esfahbod.\n"
 	  "This is free software; see the source for copying conditions.  There is NO\n"
 	  "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n"
 	  "\n"
@@ -165,7 +165,7 @@
       fprintf (f, "  -%c, --%-*s  %s\n",
 	       opt->val, max, opt->name,
 	       opt->val == 'h' && help2man ? help2man_str : *hlp);
-      if (*dft && !help2man)
+      if (*dft)
 	fprintf (f, "          %*s(default is %s)\n", max, "", *dft);
     }
 

preload.conf.in.patch:

--- NEW FILE preload.conf.in.patch ---
--- preload-0.4/src/preload.conf.in	2005-11-28 06:12:11.000000000 +0800
+++ preload.cvs/src/preload.conf.in	2007-11-10 05:15:50.000000000 +0900
@@ -6,8 +6,8 @@
 # data gathering and predictions every cycle.  Use an even
 # number.
 #
-# Note: Setting this parameter too low will may reduce the
-# system performance and stability.
+# Note: Setting this parameter too low may reduce system performance
+# and stability.
 #
 # unit: unit_cycle
 # default: default_cycle
@@ -46,7 +46,7 @@
 # The total memory preload uses for prefetching is then computed using
 # the following formulae:
 #
-# 	max (0, TOTAL * memtotal + FREE * memfree) + CHACED * memcached
+# 	max (0, TOTAL * memtotal + FREE * memfree) + CACHED * memcached
 # where TOTAL, FREE, and CACHED are the respective values read at
 # runtime from /proc/meminfo.
 #
@@ -81,7 +81,7 @@
 #
 # Whether preload should monitor running processes and update its
 # model state.  Normally you do want that, that's all preload is
-# about, but you may temporarily want to turn it off for various
+# about, but you may want to temporarily turn it off for various
 # reasons like testing and only make predictions.  Note that if
 # scanning is off, predictions are made based on whatever processes
 # have been running when preload started and the list of running
@@ -94,8 +94,8 @@
 #
 # Whether preload should make prediction and prefetch anything off
 # the disk.  Quite like doscan, you normally want that, that's the
-# other half of what preload is about, but you may temporarily want
-# to turn it off, to only train the model for example.  Note that
+# other half of what preload is about, but you may want to temporarily
+# turn it off, to only train the model for example.  Note that
 # this allows you to turn scan/predict or or off on the fly, by
 # modifying the config file and signalling the daemon.
 #
@@ -132,7 +132,7 @@
 # preload doesn't special-handle device files internally.
 #
 # default: (empty list, accept all)
-mapprefix = /usr;/lib;!/
+mapprefix = /usr;/lib;/lib64;/var/cache;!/
 
 # exeprefix:
 #

preload.init.in.patch:

--- NEW FILE preload.init.in.patch ---
--- preload-0.4/preload.init.in	2006-04-05 23:10:42.000000000 +0800
+++ preload.init.in.orig	2008-01-16 19:25:04.000000000 +0900
@@ -4,7 +4,7 @@
 #
 # Starts the @PACKAGE@ daemon
 #
-# chkconfig: 2345 05 95
+# chkconfig: - 05 95
 # description: @PACKAGE_SUMMARY@
 # processname: @PACKAGE@
 #
@@ -12,7 +12,6 @@
 # Provides:          preload.sourceforge.net
 # Required-Start:    $local_fs $remote_fs $time
 # Required-Stop:     $local_fs $remote_fs $time
-# Default-Start:     2 3 4 5
 # Default-Stop:      0 1 6
 # Short-Description: @PACKAGE_SUMMARY@
 # Description:       Analyzes what applications users run and tries to predict
@@ -30,10 +29,21 @@
 	. @sysconfigdir@/@PACKAGE@
 fi
 
-MIN_MEMORY=${MIN_MEMORY:-256}
 # Check for > MIN_MEMORY MB
+MIN_MEMORY=${MIN_MEMORY:-256}
 free -m | awk '/Mem:/ {exit ($2 >= ('"$MIN_MEMORY"'))?0:1}' || exit 0
 
+# Check for ionice and use idle scheduling if available
+RUNAS=""
+IONICE="/usr/bin/ionice"
+if [ -n "$IONICE_OPTS" ]; then
+	if [ -x "$IONICE" ]; then
+		RUNAS="$IONICE $IONICE_OPTS"
+	else
+		echo "ionice not found, running with normal io priority" >&2
+	fi
+fi
+
 RETVAL=0
 
 #
@@ -44,7 +54,7 @@
 	# Check if it is already running
 	if [ ! -f @subsysdir@/@PACKAGE@ ]; then
 	    echo -n $"Starting @PACKAGE@ daemon: "
-	    daemon @sbindir@/@PACKAGE@ $PRELOAD_OPTS
+	    daemon $RUNAS @sbindir@/@PACKAGE@ $PRELOAD_OPTS
 	    RETVAL=$?
 	    [ $RETVAL -eq 0 ] && touch @subsysdir@/@PACKAGE@
 	    echo

preload.logrotate.in.patch:

--- NEW FILE preload.logrotate.in.patch ---
--- preload-0.4/preload.logrotate.in	2005-08-29 16:34:02.000000000 +0800
+++ preload.cvs/preload.logrotate.in	2007-11-10 16:07:59.000000000 +0900
@@ -2,6 +2,7 @@
     missingok
     notifempty
     size=64k
+    compress
     postrotate
 	/bin/kill -HUP `/sbin/pidof preload 2>/dev/null` 2> /dev/null || true
     endscript

preload.proc.c.patch:

--- NEW FILE preload.proc.c.patch ---
--- preload-0.4/src/proc.c	2005-09-16 23:10:58.000000000 +0800
+++ preload.cvs/src/proc.c	2007-05-12 02:13:51.000000000 +0800
@@ -111,7 +111,7 @@
       long start, end, offset, length;
       int count;
 
-      count = sscanf (buffer, "%lx-%lx %*15s %lx %*u:%*u %*u %"FILELENSTR"s",
+      count = sscanf (buffer, "%lx-%lx %*15s %lx %*x:%*x %*u %"FILELENSTR"s",
 		      &start, &end, &offset, file);
 
       if (count != 4 || !sanitize_file (file) || !accept_file (file, conf->system.mapprefix))

preload.prophet.c.patch:

--- NEW FILE preload.prophet.c.patch ---
--- preload-0.4/src/prophet.c	2005-10-06 18:19:04.000000000 +0800
+++ preload.cvs/src/prophet.c	2007-11-10 05:16:37.000000000 +0900
@@ -215,12 +215,14 @@
       map_prob_print (map);
   }
 
-  g_message ("%dkb available for preloading, using %dkb of it",
+  g_debug ("%dkb available for preloading, using %dkb of it",
 	   memavailtotal, memavailtotal - memavail);
 
   if (i) {
-    g_message ("readaheading %d files", i);
-    preload_readahead ((preload_map_t **)maps_arr->pdata, i);
+    i = preload_readahead ((preload_map_t **)maps_arr->pdata, i);
+    g_debug ("readahead %d files", i);
+  } else {
+    g_debug ("nothing to readahead");
   }
 }
 

preload.readahead.c.patch:

--- NEW FILE preload.readahead.c.patch ---
--- preload-0.4/src/readahead.c	2005-10-07 22:08:47.000000000 +0800
+++ preload.cvs/src/readahead.c	2007-11-10 05:16:37.000000000 +0900
@@ -33,7 +33,7 @@
   const preload_map_t *a = *pa, *b = *pb;
   int i;
   
-  i = strcmp(a->path, a->path);
+  i = strcmp(a->path, b->path);
   if (!i) /* same file */
     i = a->offset - b->offset;
   if (!i) /* same offset?! */
@@ -58,14 +58,16 @@
   close (fd);
 }
 
-void
+int
 preload_readahead (preload_map_t **files, int file_count)
 {
   int i;
 
-  /* Sorting by path should offer least directory block seeking. */
+  /* Sorting by path and offset. */
   qsort(files, file_count, sizeof(*files), (GCompareFunc)map_path_compare);
 
   for (i=0; i<file_count; i++)
     process_file(files[i]);
+
+  return file_count;
 }

preload.readahead.h.patch:

--- NEW FILE preload.readahead.h.patch ---
--- preload-0.4/src/readahead.h	2005-09-01 09:31:38.000000000 +0800
+++ preload.cvs/src/readahead.h	2007-11-10 05:16:37.000000000 +0900
@@ -3,6 +3,6 @@
 
 #include <state.h>
 
-void preload_readahead (preload_map_t **files, int file_count);
+int preload_readahead (preload_map_t **files, int file_count);
 
 #endif


--- NEW FILE preload.spec ---
Name:           preload
Version:        0.4
Release:        5%{?dist}
Summary:        Preload is an adaptive readahead daemon

Group:          Applications/System
License:        GPLv2+
URL:            http://preload.sf.net/
Source0:        http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Patch0:         preload.init.in.patch
Patch1:         preload.logrotate.in.patch
Patch2:         preload.cmdline.c.patch
Patch3:         preload.conf.in.patch
Patch4:         preload.proc.c.patch
Patch5:         preload.prophet.c.patch
Patch6:         preload.readahead.c.patch
Patch7:         preload.readahead.h.patch
Patch8:         preload.state.c.patch

BuildRequires:  basesystem, glib2-devel, help2man
Requires:       basesystem, logrotate
Requires(post): /sbin/chkconfig
Requires(post): /sbin/service
Requires(preun): /sbin/chkconfig
Requires(preun): /sbin/service
Requires(postun): /sbin/service

%description
preload runs as a daemon and gathers information about processes running on
the system and shared-objects that they use.  This information is saved in a
file to keep across runs of preload

%prep
%setup -q
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1

%build
%configure
make


%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT


%clean
rm -rf $RPM_BUILD_ROOT

%post
# This adds the proper /etc/rc*.d links for the script
/sbin/chkconfig --add preload

%preun
if [ $1 = 0 ]; then
        /sbin/service preload stop >/dev/null 2>&1
        /sbin/chkconfig --del preload
fi

%postun
if [ "$1" -ge "1" ]; then
        /sbin/service preload condrestart >/dev/null 2>&1 || :
fi


%files
%defattr(-,root,root, -)
%doc README AUTHORS COPYING ChangeLog TODO THANKS NEWS
%{_sbindir}/preload
%{_datadir}/man/man8/preload.8.gz
%{_sysconfdir}/rc.d/init.d/preload
%config(noreplace) %{_sysconfdir}/preload.conf
%config(noreplace) %{_sysconfdir}/sysconfig/preload
%config(noreplace) %{_sysconfdir}/logrotate.d/preload
%attr(0644,root,root) %ghost %config(missingok,noreplace) %{_localstatedir}/log/preload.log
%attr(0644,root,root) %ghost %config(missingok,noreplace) %{_localstatedir}/lib/preload/preload.state
%attr(0755,root,root) %dir %{_localstatedir}/lib/preload


%changelog
* Wed Jan 16 2008 Marc Wiriadisastra <marc at mwiriadi.id.au> - 0.4-5
- Removed auto start from init
- Added all the CVS patches prior to next release

* Sun Jan 6 2008 Marc Wiriadisastra <marc at mwiriadi.id.au> - 0.4-4
- Removed debian patch and added patches from upstream instead
- Patches fix 64 bit, ionice, sysconfig and loading.

* Fri Nov 9 2007 Marc Wiriadisastra <marc at mwiriadi.id.au> - 0.4-3
- Used Debian Patch it consists of:
- Close the file descriptor when writing state to a file in src/state.c,
- Parse the dev field in /proc/%%d/maps as hexadecimal, not as unsigned
  integer.  Thanks to Johan Kiviniemi for the patch.
- Sort the readahead file list by device, block and inode and not file
  path to reduce seeking.  Adapted by Johan from a patch for readahead
  by Scott James Remnant.
- Added my patch to verbosity to 1 due to 30 second log writing
 
* Thu Nov 8 2007 Marc Wiriadisastra <marc at mwiriadi.id.au> - 0.4-2
- Fixed config lines
- Fixed source lines
- Added Requires: Logrotate
- Default preload sequence is stopped
- %{?_smp_mflags} does not work

* Sat Oct 16 2007 Marc Wiriadisastra <marc at mwiriadi.id.au> - 0.4-1
- Creation from start

preload.state.c.patch:

--- NEW FILE preload.state.c.patch ---
--- preload-0.4/src/state.c	2005-09-14 00:40:55.000000000 +0800
+++ preload.cvs/src/state.c	2007-05-12 02:16:03.000000000 +0800
@@ -1072,6 +1072,7 @@
 	  }
 	}
       }
+      close (fd);
 
       g_free (tmpfile);
 


Index: .cvsignore
===================================================================
RCS file: /cvs/pkgs/rpms/preload/devel/.cvsignore,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- .cvsignore	17 Jan 2008 17:09:14 -0000	1.1
+++ .cvsignore	17 Jan 2008 21:22:39 -0000	1.2
@@ -0,0 +1 @@
+preload-0.4.tar.gz


Index: sources
===================================================================
RCS file: /cvs/pkgs/rpms/preload/devel/sources,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- sources	17 Jan 2008 17:09:14 -0000	1.1
+++ sources	17 Jan 2008 21:22:39 -0000	1.2
@@ -0,0 +1 @@
+9c98bc97ec261925c9a40e5084c9c149  preload-0.4.tar.gz




More information about the fedora-extras-commits mailing list