From owner-freebsd-gecko@FreeBSD.ORG Sat Sep 8 14:32:34 2012 Return-Path: Delivered-To: freebsd-gecko@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 17DBD106564A for ; Sat, 8 Sep 2012 14:32:34 +0000 (UTC) (envelope-from svn-freebsd-gecko@chruetertee.ch) Received: from trillian.chruetertee.ch (trillian.chruetertee.ch [217.150.245.56]) by mx1.freebsd.org (Postfix) with ESMTP id 78EE28FC1C for ; Sat, 8 Sep 2012 14:32:30 +0000 (UTC) Received: from trillian.chruetertee.ch (trillian [217.150.245.56]) by trillian.chruetertee.ch (8.14.4/8.14.3) with ESMTP id q88EWOra096988 for ; Sat, 8 Sep 2012 14:32:24 GMT (envelope-from svn-freebsd-gecko@chruetertee.ch) Received: (from www@localhost) by trillian.chruetertee.ch (8.14.4/8.14.3/Submit) id q88EWIaB095439 for freebsd-gecko@freebsd.org; Sat, 8 Sep 2012 14:32:18 GMT (envelope-from svn-freebsd-gecko@chruetertee.ch) Date: Sat, 8 Sep 2012 14:32:18 GMT Message-Id: <201209081432.q88EWIaB095439@trillian.chruetertee.ch> X-Authentication-Warning: trillian.chruetertee.ch: www set sender to svn-freebsd-gecko@chruetertee.ch using -f From: svn-freebsd-gecko@chruetertee.ch To: freebsd-gecko@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [SVN-Commit] r1007 - in trunk: . mail/thunderbird-esr/files mail/thunderbird/files www/firefox-esr/files www/firefox-nightly/files www/firefox/files www/libxul/files www/seamonkey/files X-BeenThere: freebsd-gecko@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: freebsd-gecko@freebsd.org List-Id: Gecko Rendering Engine issues List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Sep 2012 14:32:34 -0000 Author: jbeich Date: Sat Sep 8 14:32:18 2012 New Revision: 1007 Log: record process creation for telemetry Added: trunk/mail/thunderbird-esr/files/patch-bug789693 trunk/mail/thunderbird/files/patch-bug789693 trunk/www/firefox-esr/files/patch-bug789693 trunk/www/firefox-nightly/files/patch-bug789693 trunk/www/firefox/files/patch-bug789693 trunk/www/libxul/files/patch-bug789693 trunk/www/seamonkey/files/patch-bug789693 Modified: trunk/Gecko_TODO Modified: trunk/Gecko_TODO ============================================================================== --- trunk/Gecko_TODO Sat Sep 8 09:33:53 2012 (r1006) +++ trunk/Gecko_TODO Sat Sep 8 14:32:18 2012 (r1007) @@ -2,7 +2,6 @@ - port libxul-1.9 consumers to libxul-10, lest they be removed - implement either OSS or GStreamer backend for libcubeb - fix pause latency issue with OSS backend in libsydneyaudio (deprecated) -- port startup measurement (see bug 633193 and process_util_bsd.cc) - port WebRTC - port Gecko Profiler - port Crash Reporter Added: trunk/mail/thunderbird-esr/files/patch-bug789693 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ trunk/mail/thunderbird-esr/files/patch-bug789693 Sat Sep 8 14:32:18 2012 (r1007) @@ -0,0 +1,97 @@ +--- mozilla/toolkit/components/startup/nsAppStartup.cpp ++++ mozilla/toolkit/components/startup/nsAppStartup.cpp +@@ -50,13 +50,14 @@ + #include + #endif + +-#ifdef XP_MACOSX ++#if defined(XP_MACOSX) || defined(__DragonFly__) || defined(__FreeBSD__) \ ++ || defined(__NetBSD__) || defined(__OpenBSD__) ++#include + #include + #endif + +-#ifdef __OpenBSD__ +-#include +-#include ++#if defined(__DragonFly__) || defined(__FreeBSD__) ++#include + #endif + + #include "mozilla/Telemetry.h" +@@ -836,41 +837,56 @@ CalculateProcessCreationTimestamp() + #endif + return timestamp; + } +-#elif defined(XP_MACOSX) ++#elif defined(XP_MACOSX) || defined(__DragonFly__) || defined(__FreeBSD__) \ ++ || defined(__NetBSD__) || defined(__OpenBSD__) + static PRTime + CalculateProcessCreationTimestamp() + { ++#if defined(__NetBSD__) ++ int mib[6] = { CTL_KERN, KERN_PROC2, KERN_PROC_PID, getpid(), sizeof(struct kinfo_proc2), 1 }; ++#elif defined(__OpenBSD__) ++ int mib[6] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, getpid(), sizeof(struct kinfo_proc), 1 }; ++#else + int mib[4] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, getpid() }; ++#endif + size_t buffer_size; ++ ++#if defined(__NetBSD__) || defined(__OpenBSD__) ++ if (sysctl(mib, 6, NULL, &buffer_size, NULL, 0)) ++#else + if (sysctl(mib, 4, NULL, &buffer_size, NULL, 0)) ++#endif + return 0; + +- struct kinfo_proc *proc = (kinfo_proc*) malloc(buffer_size); ++#if defined(__NetBSD__) ++ struct kinfo_proc2 *proc = (struct kinfo_proc2 *) malloc(buffer_size); ++#else ++ struct kinfo_proc *proc = (struct kinfo_proc *) malloc(buffer_size); ++#endif ++ ++#if defined(__NetBSD__) || defined(__OpenBSD__) ++ if (sysctl(mib, 6, proc, &buffer_size, NULL, 0)) { ++#else + if (sysctl(mib, 4, proc, &buffer_size, NULL, 0)) { ++#endif + free(proc); + return 0; + } ++ ++#if defined(XP_MACOSX) + PRTime starttime = static_cast(proc->kp_proc.p_un.__p_starttime.tv_sec) * PR_USEC_PER_SEC; + starttime += proc->kp_proc.p_un.__p_starttime.tv_usec; +- free(proc); +- return starttime; +-} +-#elif defined(__OpenBSD__) +-static PRTime +-CalculateProcessCreationTimestamp() +-{ +- int mib[6] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, getpid(), sizeof(struct kinfo_proc), 1 }; +- size_t buffer_size; +- if (sysctl(mib, 6, NULL, &buffer_size, NULL, 0)) +- return 0; +- +- struct kinfo_proc *proc = (struct kinfo_proc*) malloc(buffer_size); +- if (sysctl(mib, 6, proc, &buffer_size, NULL, 0)) { +- free(proc); +- return 0; +- } ++#elif defined(__DragonFly__) ++ PRTime starttime = static_cast(proc->kp_start.tv_sec) * PR_USEC_PER_SEC; ++ starttime += proc->kp_start.tv_usec; ++#elif defined(__FreeBSD__) ++ PRTime starttime = static_cast(proc->ki_start.tv_sec) * PR_USEC_PER_SEC; ++ starttime += proc->ki_start.tv_usec; ++#else + PRTime starttime = static_cast(proc->p_ustart_sec) * PR_USEC_PER_SEC; + starttime += proc->p_ustart_usec; ++#endif ++ + free(proc); + return starttime; + } Added: trunk/mail/thunderbird/files/patch-bug789693 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ trunk/mail/thunderbird/files/patch-bug789693 Sat Sep 8 14:32:18 2012 (r1007) @@ -0,0 +1,97 @@ +--- mozilla/toolkit/components/startup/nsAppStartup.cpp ++++ mozilla/toolkit/components/startup/nsAppStartup.cpp +@@ -50,13 +50,14 @@ + #include + #endif + +-#ifdef XP_MACOSX ++#if defined(XP_MACOSX) || defined(__DragonFly__) || defined(__FreeBSD__) \ ++ || defined(__NetBSD__) || defined(__OpenBSD__) ++#include + #include + #endif + +-#ifdef __OpenBSD__ +-#include +-#include ++#if defined(__DragonFly__) || defined(__FreeBSD__) ++#include + #endif + + #include "mozilla/Telemetry.h" +@@ -836,41 +837,56 @@ CalculateProcessCreationTimestamp() + #endif + return timestamp; + } +-#elif defined(XP_MACOSX) ++#elif defined(XP_MACOSX) || defined(__DragonFly__) || defined(__FreeBSD__) \ ++ || defined(__NetBSD__) || defined(__OpenBSD__) + static PRTime + CalculateProcessCreationTimestamp() + { ++#if defined(__NetBSD__) ++ int mib[6] = { CTL_KERN, KERN_PROC2, KERN_PROC_PID, getpid(), sizeof(struct kinfo_proc2), 1 }; ++#elif defined(__OpenBSD__) ++ int mib[6] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, getpid(), sizeof(struct kinfo_proc), 1 }; ++#else + int mib[4] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, getpid() }; ++#endif + size_t buffer_size; ++ ++#if defined(__NetBSD__) || defined(__OpenBSD__) ++ if (sysctl(mib, 6, NULL, &buffer_size, NULL, 0)) ++#else + if (sysctl(mib, 4, NULL, &buffer_size, NULL, 0)) ++#endif + return 0; + +- struct kinfo_proc *proc = (kinfo_proc*) malloc(buffer_size); ++#if defined(__NetBSD__) ++ struct kinfo_proc2 *proc = (struct kinfo_proc2 *) malloc(buffer_size); ++#else ++ struct kinfo_proc *proc = (struct kinfo_proc *) malloc(buffer_size); ++#endif ++ ++#if defined(__NetBSD__) || defined(__OpenBSD__) ++ if (sysctl(mib, 6, proc, &buffer_size, NULL, 0)) { ++#else + if (sysctl(mib, 4, proc, &buffer_size, NULL, 0)) { ++#endif + free(proc); + return 0; + } ++ ++#if defined(XP_MACOSX) + PRTime starttime = static_cast(proc->kp_proc.p_un.__p_starttime.tv_sec) * PR_USEC_PER_SEC; + starttime += proc->kp_proc.p_un.__p_starttime.tv_usec; +- free(proc); +- return starttime; +-} +-#elif defined(__OpenBSD__) +-static PRTime +-CalculateProcessCreationTimestamp() +-{ +- int mib[6] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, getpid(), sizeof(struct kinfo_proc), 1 }; +- size_t buffer_size; +- if (sysctl(mib, 6, NULL, &buffer_size, NULL, 0)) +- return 0; +- +- struct kinfo_proc *proc = (struct kinfo_proc*) malloc(buffer_size); +- if (sysctl(mib, 6, proc, &buffer_size, NULL, 0)) { +- free(proc); +- return 0; +- } ++#elif defined(__DragonFly__) ++ PRTime starttime = static_cast(proc->kp_start.tv_sec) * PR_USEC_PER_SEC; ++ starttime += proc->kp_start.tv_usec; ++#elif defined(__FreeBSD__) ++ PRTime starttime = static_cast(proc->ki_start.tv_sec) * PR_USEC_PER_SEC; ++ starttime += proc->ki_start.tv_usec; ++#else + PRTime starttime = static_cast(proc->p_ustart_sec) * PR_USEC_PER_SEC; + starttime += proc->p_ustart_usec; ++#endif ++ + free(proc); + return starttime; + } Added: trunk/www/firefox-esr/files/patch-bug789693 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ trunk/www/firefox-esr/files/patch-bug789693 Sat Sep 8 14:32:18 2012 (r1007) @@ -0,0 +1,97 @@ +--- toolkit/components/startup/nsAppStartup.cpp ++++ toolkit/components/startup/nsAppStartup.cpp +@@ -50,13 +50,14 @@ + #include + #endif + +-#ifdef XP_MACOSX ++#if defined(XP_MACOSX) || defined(__DragonFly__) || defined(__FreeBSD__) \ ++ || defined(__NetBSD__) || defined(__OpenBSD__) ++#include + #include + #endif + +-#ifdef __OpenBSD__ +-#include +-#include ++#if defined(__DragonFly__) || defined(__FreeBSD__) ++#include + #endif + + #include "mozilla/Telemetry.h" +@@ -836,41 +837,56 @@ CalculateProcessCreationTimestamp() + #endif + return timestamp; + } +-#elif defined(XP_MACOSX) ++#elif defined(XP_MACOSX) || defined(__DragonFly__) || defined(__FreeBSD__) \ ++ || defined(__NetBSD__) || defined(__OpenBSD__) + static PRTime + CalculateProcessCreationTimestamp() + { ++#if defined(__NetBSD__) ++ int mib[6] = { CTL_KERN, KERN_PROC2, KERN_PROC_PID, getpid(), sizeof(struct kinfo_proc2), 1 }; ++#elif defined(__OpenBSD__) ++ int mib[6] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, getpid(), sizeof(struct kinfo_proc), 1 }; ++#else + int mib[4] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, getpid() }; ++#endif + size_t buffer_size; ++ ++#if defined(__NetBSD__) || defined(__OpenBSD__) ++ if (sysctl(mib, 6, NULL, &buffer_size, NULL, 0)) ++#else + if (sysctl(mib, 4, NULL, &buffer_size, NULL, 0)) ++#endif + return 0; + +- struct kinfo_proc *proc = (kinfo_proc*) malloc(buffer_size); ++#if defined(__NetBSD__) ++ struct kinfo_proc2 *proc = (struct kinfo_proc2 *) malloc(buffer_size); ++#else ++ struct kinfo_proc *proc = (struct kinfo_proc *) malloc(buffer_size); ++#endif ++ ++#if defined(__NetBSD__) || defined(__OpenBSD__) ++ if (sysctl(mib, 6, proc, &buffer_size, NULL, 0)) { ++#else + if (sysctl(mib, 4, proc, &buffer_size, NULL, 0)) { ++#endif + free(proc); + return 0; + } ++ ++#if defined(XP_MACOSX) + PRTime starttime = static_cast(proc->kp_proc.p_un.__p_starttime.tv_sec) * PR_USEC_PER_SEC; + starttime += proc->kp_proc.p_un.__p_starttime.tv_usec; +- free(proc); +- return starttime; +-} +-#elif defined(__OpenBSD__) +-static PRTime +-CalculateProcessCreationTimestamp() +-{ +- int mib[6] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, getpid(), sizeof(struct kinfo_proc), 1 }; +- size_t buffer_size; +- if (sysctl(mib, 6, NULL, &buffer_size, NULL, 0)) +- return 0; +- +- struct kinfo_proc *proc = (struct kinfo_proc*) malloc(buffer_size); +- if (sysctl(mib, 6, proc, &buffer_size, NULL, 0)) { +- free(proc); +- return 0; +- } ++#elif defined(__DragonFly__) ++ PRTime starttime = static_cast(proc->kp_start.tv_sec) * PR_USEC_PER_SEC; ++ starttime += proc->kp_start.tv_usec; ++#elif defined(__FreeBSD__) ++ PRTime starttime = static_cast(proc->ki_start.tv_sec) * PR_USEC_PER_SEC; ++ starttime += proc->ki_start.tv_usec; ++#else + PRTime starttime = static_cast(proc->p_ustart_sec) * PR_USEC_PER_SEC; + starttime += proc->p_ustart_usec; ++#endif ++ + free(proc); + return starttime; + } Added: trunk/www/firefox-nightly/files/patch-bug789693 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ trunk/www/firefox-nightly/files/patch-bug789693 Sat Sep 8 14:32:18 2012 (r1007) @@ -0,0 +1,97 @@ +--- toolkit/components/startup/nsAppStartup.cpp ++++ toolkit/components/startup/nsAppStartup.cpp +@@ -50,13 +50,14 @@ + #include + #endif + +-#ifdef XP_MACOSX ++#if defined(XP_MACOSX) || defined(__DragonFly__) || defined(__FreeBSD__) \ ++ || defined(__NetBSD__) || defined(__OpenBSD__) ++#include + #include + #endif + +-#ifdef __OpenBSD__ +-#include +-#include ++#if defined(__DragonFly__) || defined(__FreeBSD__) ++#include + #endif + + #include "mozilla/Telemetry.h" +@@ -836,41 +837,56 @@ CalculateProcessCreationTimestamp() + #endif + return timestamp; + } +-#elif defined(XP_MACOSX) ++#elif defined(XP_MACOSX) || defined(__DragonFly__) || defined(__FreeBSD__) \ ++ || defined(__NetBSD__) || defined(__OpenBSD__) + static PRTime + CalculateProcessCreationTimestamp() + { ++#if defined(__NetBSD__) ++ int mib[6] = { CTL_KERN, KERN_PROC2, KERN_PROC_PID, getpid(), sizeof(struct kinfo_proc2), 1 }; ++#elif defined(__OpenBSD__) ++ int mib[6] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, getpid(), sizeof(struct kinfo_proc), 1 }; ++#else + int mib[4] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, getpid() }; ++#endif + size_t buffer_size; ++ ++#if defined(__NetBSD__) || defined(__OpenBSD__) ++ if (sysctl(mib, 6, NULL, &buffer_size, NULL, 0)) ++#else + if (sysctl(mib, 4, NULL, &buffer_size, NULL, 0)) ++#endif + return 0; + +- struct kinfo_proc *proc = (kinfo_proc*) malloc(buffer_size); ++#if defined(__NetBSD__) ++ struct kinfo_proc2 *proc = (struct kinfo_proc2 *) malloc(buffer_size); ++#else ++ struct kinfo_proc *proc = (struct kinfo_proc *) malloc(buffer_size); ++#endif ++ ++#if defined(__NetBSD__) || defined(__OpenBSD__) ++ if (sysctl(mib, 6, proc, &buffer_size, NULL, 0)) { ++#else + if (sysctl(mib, 4, proc, &buffer_size, NULL, 0)) { ++#endif + free(proc); + return 0; + } ++ ++#if defined(XP_MACOSX) + PRTime starttime = static_cast(proc->kp_proc.p_un.__p_starttime.tv_sec) * PR_USEC_PER_SEC; + starttime += proc->kp_proc.p_un.__p_starttime.tv_usec; +- free(proc); +- return starttime; +-} +-#elif defined(__OpenBSD__) +-static PRTime +-CalculateProcessCreationTimestamp() +-{ +- int mib[6] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, getpid(), sizeof(struct kinfo_proc), 1 }; +- size_t buffer_size; +- if (sysctl(mib, 6, NULL, &buffer_size, NULL, 0)) +- return 0; +- +- struct kinfo_proc *proc = (struct kinfo_proc*) malloc(buffer_size); +- if (sysctl(mib, 6, proc, &buffer_size, NULL, 0)) { +- free(proc); +- return 0; +- } ++#elif defined(__DragonFly__) ++ PRTime starttime = static_cast(proc->kp_start.tv_sec) * PR_USEC_PER_SEC; ++ starttime += proc->kp_start.tv_usec; ++#elif defined(__FreeBSD__) ++ PRTime starttime = static_cast(proc->ki_start.tv_sec) * PR_USEC_PER_SEC; ++ starttime += proc->ki_start.tv_usec; ++#else + PRTime starttime = static_cast(proc->p_ustart_sec) * PR_USEC_PER_SEC; + starttime += proc->p_ustart_usec; ++#endif ++ + free(proc); + return starttime; + } Added: trunk/www/firefox/files/patch-bug789693 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ trunk/www/firefox/files/patch-bug789693 Sat Sep 8 14:32:18 2012 (r1007) @@ -0,0 +1,97 @@ +--- toolkit/components/startup/nsAppStartup.cpp ++++ toolkit/components/startup/nsAppStartup.cpp +@@ -50,13 +50,14 @@ + #include + #endif + +-#ifdef XP_MACOSX ++#if defined(XP_MACOSX) || defined(__DragonFly__) || defined(__FreeBSD__) \ ++ || defined(__NetBSD__) || defined(__OpenBSD__) ++#include + #include + #endif + +-#ifdef __OpenBSD__ +-#include +-#include ++#if defined(__DragonFly__) || defined(__FreeBSD__) ++#include + #endif + + #include "mozilla/Telemetry.h" +@@ -836,41 +837,56 @@ CalculateProcessCreationTimestamp() + #endif + return timestamp; + } +-#elif defined(XP_MACOSX) ++#elif defined(XP_MACOSX) || defined(__DragonFly__) || defined(__FreeBSD__) \ ++ || defined(__NetBSD__) || defined(__OpenBSD__) + static PRTime + CalculateProcessCreationTimestamp() + { ++#if defined(__NetBSD__) ++ int mib[6] = { CTL_KERN, KERN_PROC2, KERN_PROC_PID, getpid(), sizeof(struct kinfo_proc2), 1 }; ++#elif defined(__OpenBSD__) ++ int mib[6] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, getpid(), sizeof(struct kinfo_proc), 1 }; ++#else + int mib[4] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, getpid() }; ++#endif + size_t buffer_size; ++ ++#if defined(__NetBSD__) || defined(__OpenBSD__) ++ if (sysctl(mib, 6, NULL, &buffer_size, NULL, 0)) ++#else + if (sysctl(mib, 4, NULL, &buffer_size, NULL, 0)) ++#endif + return 0; + +- struct kinfo_proc *proc = (kinfo_proc*) malloc(buffer_size); ++#if defined(__NetBSD__) ++ struct kinfo_proc2 *proc = (struct kinfo_proc2 *) malloc(buffer_size); ++#else ++ struct kinfo_proc *proc = (struct kinfo_proc *) malloc(buffer_size); ++#endif ++ ++#if defined(__NetBSD__) || defined(__OpenBSD__) ++ if (sysctl(mib, 6, proc, &buffer_size, NULL, 0)) { ++#else + if (sysctl(mib, 4, proc, &buffer_size, NULL, 0)) { ++#endif + free(proc); + return 0; + } ++ ++#if defined(XP_MACOSX) + PRTime starttime = static_cast(proc->kp_proc.p_un.__p_starttime.tv_sec) * PR_USEC_PER_SEC; + starttime += proc->kp_proc.p_un.__p_starttime.tv_usec; +- free(proc); +- return starttime; +-} +-#elif defined(__OpenBSD__) +-static PRTime +-CalculateProcessCreationTimestamp() +-{ +- int mib[6] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, getpid(), sizeof(struct kinfo_proc), 1 }; +- size_t buffer_size; +- if (sysctl(mib, 6, NULL, &buffer_size, NULL, 0)) +- return 0; +- +- struct kinfo_proc *proc = (struct kinfo_proc*) malloc(buffer_size); +- if (sysctl(mib, 6, proc, &buffer_size, NULL, 0)) { +- free(proc); +- return 0; +- } ++#elif defined(__DragonFly__) ++ PRTime starttime = static_cast(proc->kp_start.tv_sec) * PR_USEC_PER_SEC; ++ starttime += proc->kp_start.tv_usec; ++#elif defined(__FreeBSD__) ++ PRTime starttime = static_cast(proc->ki_start.tv_sec) * PR_USEC_PER_SEC; ++ starttime += proc->ki_start.tv_usec; ++#else + PRTime starttime = static_cast(proc->p_ustart_sec) * PR_USEC_PER_SEC; + starttime += proc->p_ustart_usec; ++#endif ++ + free(proc); + return starttime; + } Added: trunk/www/libxul/files/patch-bug789693 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ trunk/www/libxul/files/patch-bug789693 Sat Sep 8 14:32:18 2012 (r1007) @@ -0,0 +1,97 @@ +--- toolkit/components/startup/nsAppStartup.cpp ++++ toolkit/components/startup/nsAppStartup.cpp +@@ -50,13 +50,14 @@ + #include + #endif + +-#ifdef XP_MACOSX ++#if defined(XP_MACOSX) || defined(__DragonFly__) || defined(__FreeBSD__) \ ++ || defined(__NetBSD__) || defined(__OpenBSD__) ++#include + #include + #endif + +-#ifdef __OpenBSD__ +-#include +-#include ++#if defined(__DragonFly__) || defined(__FreeBSD__) ++#include + #endif + + #include "mozilla/Telemetry.h" +@@ -836,41 +837,56 @@ CalculateProcessCreationTimestamp() + #endif + return timestamp; + } +-#elif defined(XP_MACOSX) ++#elif defined(XP_MACOSX) || defined(__DragonFly__) || defined(__FreeBSD__) \ ++ || defined(__NetBSD__) || defined(__OpenBSD__) + static PRTime + CalculateProcessCreationTimestamp() + { ++#if defined(__NetBSD__) ++ int mib[6] = { CTL_KERN, KERN_PROC2, KERN_PROC_PID, getpid(), sizeof(struct kinfo_proc2), 1 }; ++#elif defined(__OpenBSD__) ++ int mib[6] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, getpid(), sizeof(struct kinfo_proc), 1 }; ++#else + int mib[4] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, getpid() }; ++#endif + size_t buffer_size; ++ ++#if defined(__NetBSD__) || defined(__OpenBSD__) ++ if (sysctl(mib, 6, NULL, &buffer_size, NULL, 0)) ++#else + if (sysctl(mib, 4, NULL, &buffer_size, NULL, 0)) ++#endif + return 0; + +- struct kinfo_proc *proc = (kinfo_proc*) malloc(buffer_size); ++#if defined(__NetBSD__) ++ struct kinfo_proc2 *proc = (struct kinfo_proc2 *) malloc(buffer_size); ++#else ++ struct kinfo_proc *proc = (struct kinfo_proc *) malloc(buffer_size); ++#endif ++ ++#if defined(__NetBSD__) || defined(__OpenBSD__) ++ if (sysctl(mib, 6, proc, &buffer_size, NULL, 0)) { ++#else + if (sysctl(mib, 4, proc, &buffer_size, NULL, 0)) { ++#endif + free(proc); + return 0; + } ++ ++#if defined(XP_MACOSX) + PRTime starttime = static_cast(proc->kp_proc.p_un.__p_starttime.tv_sec) * PR_USEC_PER_SEC; + starttime += proc->kp_proc.p_un.__p_starttime.tv_usec; +- free(proc); +- return starttime; +-} +-#elif defined(__OpenBSD__) +-static PRTime +-CalculateProcessCreationTimestamp() +-{ +- int mib[6] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, getpid(), sizeof(struct kinfo_proc), 1 }; +- size_t buffer_size; +- if (sysctl(mib, 6, NULL, &buffer_size, NULL, 0)) +- return 0; +- +- struct kinfo_proc *proc = (struct kinfo_proc*) malloc(buffer_size); +- if (sysctl(mib, 6, proc, &buffer_size, NULL, 0)) { +- free(proc); +- return 0; +- } ++#elif defined(__DragonFly__) ++ PRTime starttime = static_cast(proc->kp_start.tv_sec) * PR_USEC_PER_SEC; ++ starttime += proc->kp_start.tv_usec; ++#elif defined(__FreeBSD__) ++ PRTime starttime = static_cast(proc->ki_start.tv_sec) * PR_USEC_PER_SEC; ++ starttime += proc->ki_start.tv_usec; ++#else + PRTime starttime = static_cast(proc->p_ustart_sec) * PR_USEC_PER_SEC; + starttime += proc->p_ustart_usec; ++#endif ++ + free(proc); + return starttime; + } Added: trunk/www/seamonkey/files/patch-bug789693 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ trunk/www/seamonkey/files/patch-bug789693 Sat Sep 8 14:32:18 2012 (r1007) @@ -0,0 +1,97 @@ +--- mozilla/toolkit/components/startup/nsAppStartup.cpp ++++ mozilla/toolkit/components/startup/nsAppStartup.cpp +@@ -50,13 +50,14 @@ + #include + #endif + +-#ifdef XP_MACOSX ++#if defined(XP_MACOSX) || defined(__DragonFly__) || defined(__FreeBSD__) \ ++ || defined(__NetBSD__) || defined(__OpenBSD__) ++#include + #include + #endif + +-#ifdef __OpenBSD__ +-#include +-#include ++#if defined(__DragonFly__) || defined(__FreeBSD__) ++#include + #endif + + #include "mozilla/Telemetry.h" +@@ -836,41 +837,56 @@ CalculateProcessCreationTimestamp() + #endif + return timestamp; + } +-#elif defined(XP_MACOSX) ++#elif defined(XP_MACOSX) || defined(__DragonFly__) || defined(__FreeBSD__) \ ++ || defined(__NetBSD__) || defined(__OpenBSD__) + static PRTime + CalculateProcessCreationTimestamp() + { ++#if defined(__NetBSD__) ++ int mib[6] = { CTL_KERN, KERN_PROC2, KERN_PROC_PID, getpid(), sizeof(struct kinfo_proc2), 1 }; ++#elif defined(__OpenBSD__) ++ int mib[6] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, getpid(), sizeof(struct kinfo_proc), 1 }; ++#else + int mib[4] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, getpid() }; ++#endif + size_t buffer_size; ++ ++#if defined(__NetBSD__) || defined(__OpenBSD__) ++ if (sysctl(mib, 6, NULL, &buffer_size, NULL, 0)) ++#else + if (sysctl(mib, 4, NULL, &buffer_size, NULL, 0)) ++#endif + return 0; + +- struct kinfo_proc *proc = (kinfo_proc*) malloc(buffer_size); ++#if defined(__NetBSD__) ++ struct kinfo_proc2 *proc = (struct kinfo_proc2 *) malloc(buffer_size); ++#else ++ struct kinfo_proc *proc = (struct kinfo_proc *) malloc(buffer_size); ++#endif ++ ++#if defined(__NetBSD__) || defined(__OpenBSD__) ++ if (sysctl(mib, 6, proc, &buffer_size, NULL, 0)) { ++#else + if (sysctl(mib, 4, proc, &buffer_size, NULL, 0)) { ++#endif + free(proc); + return 0; + } ++ ++#if defined(XP_MACOSX) + PRTime starttime = static_cast(proc->kp_proc.p_un.__p_starttime.tv_sec) * PR_USEC_PER_SEC; + starttime += proc->kp_proc.p_un.__p_starttime.tv_usec; +- free(proc); +- return starttime; +-} +-#elif defined(__OpenBSD__) +-static PRTime +-CalculateProcessCreationTimestamp() +-{ +- int mib[6] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, getpid(), sizeof(struct kinfo_proc), 1 }; +- size_t buffer_size; +- if (sysctl(mib, 6, NULL, &buffer_size, NULL, 0)) +- return 0; +- +- struct kinfo_proc *proc = (struct kinfo_proc*) malloc(buffer_size); +- if (sysctl(mib, 6, proc, &buffer_size, NULL, 0)) { +- free(proc); +- return 0; +- } ++#elif defined(__DragonFly__) ++ PRTime starttime = static_cast(proc->kp_start.tv_sec) * PR_USEC_PER_SEC; ++ starttime += proc->kp_start.tv_usec; ++#elif defined(__FreeBSD__) ++ PRTime starttime = static_cast(proc->ki_start.tv_sec) * PR_USEC_PER_SEC; ++ starttime += proc->ki_start.tv_usec; ++#else + PRTime starttime = static_cast(proc->p_ustart_sec) * PR_USEC_PER_SEC; + starttime += proc->p_ustart_usec; ++#endif ++ + free(proc); + return starttime; + }