[launchd-changes] [23157] trunk/launchd/src/launchd_core_logic.c

source_changes at macosforge.org source_changes at macosforge.org
Mon Mar 19 18:28:19 PDT 2007


Revision: 23157
          http://trac.macosforge.org/projects/launchd/changeset/23157
Author:   zarzycki at apple.com
Date:     2007-03-19 18:28:18 -0700 (Mon, 19 Mar 2007)

Log Message:
-----------
We never did anything interesting with struct rusage accumulation. Let's disable the code for now and save some memory.

Modified Paths:
--------------
    trunk/launchd/src/launchd_core_logic.c

Modified: trunk/launchd/src/launchd_core_logic.c
===================================================================
--- trunk/launchd/src/launchd_core_logic.c	2007-03-19 20:52:05 UTC (rev 23156)
+++ trunk/launchd/src/launchd_core_logic.c	2007-03-20 01:28:18 UTC (rev 23157)
@@ -233,6 +233,8 @@
 /* static void jobmgr_log_error(jobmgr_t jm, int pri, const char *msg, ...) __attribute__((format(printf, 3, 4))); */
 static void jobmgr_log_bug(jobmgr_t jm, const char *rcs_rev, const char *path, unsigned int line, const char *test);
 
+#define DO_RUSAGE_SUMATION 0
+
 struct job_s {
 	kq_callback kqjob_callback;
 	SLIST_ENTRY(job_s) sle;
@@ -244,7 +246,9 @@
 	SLIST_HEAD(, limititem) limits;
 	SLIST_HEAD(, machservice) machservices;
 	SLIST_HEAD(, semaphoreitem) semaphores;
+#if DO_RUSAGE_SUMATION
 	struct rusage ru;
+#endif
 	binpref_t j_binpref;
 	size_t j_binpref_cnt;
 	mach_port_t j_port;
@@ -1713,6 +1717,7 @@
 		job_log(j, LOG_INFO, "Exited %f seconds after SIGTERM was sent", delta);
 	}
 
+#if DO_RUSAGE_SUMATION
 	timeradd(&ru.ru_utime, &j->ru.ru_utime, &j->ru.ru_utime);
 	timeradd(&ru.ru_stime, &j->ru.ru_stime, &j->ru.ru_stime);
 	j->ru.ru_maxrss += ru.ru_maxrss;
@@ -1729,6 +1734,7 @@
 	j->ru.ru_nsignals += ru.ru_nsignals;
 	j->ru.ru_nvcsw += ru.ru_nvcsw;
 	j->ru.ru_nivcsw += ru.ru_nivcsw;
+#endif
 
 	if (WIFEXITED(status) && WEXITSTATUS(status) != 0) {
 		job_log(j, LOG_WARNING, "exited with exit code: %d", WEXITSTATUS(status));

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/launchd-changes/attachments/20070319/29f6f00d/attachment.html


More information about the launchd-changes mailing list