Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 8 Sep 2012 14:32:18 GMT
From:      svn-freebsd-gecko@chruetertee.ch
To:        freebsd-gecko@freebsd.org
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
Message-ID:  <201209081432.q88EWIaB095439@trillian.chruetertee.ch>

next in thread | raw e-mail | index | archive | help
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 <sys/syscall.h>
+ #endif
+ 
+-#ifdef XP_MACOSX
++#if defined(XP_MACOSX) || defined(__DragonFly__) || defined(__FreeBSD__) \
++  || defined(__NetBSD__) || defined(__OpenBSD__)
++#include <sys/param.h>
+ #include <sys/sysctl.h>
+ #endif
+ 
+-#ifdef __OpenBSD__
+-#include <sys/param.h>
+-#include <sys/sysctl.h>
++#if defined(__DragonFly__) || defined(__FreeBSD__)
++#include <sys/user.h>
+ #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<PRTime>(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<PRTime>(proc->kp_start.tv_sec) * PR_USEC_PER_SEC;
++  starttime += proc->kp_start.tv_usec;
++#elif defined(__FreeBSD__)
++  PRTime starttime = static_cast<PRTime>(proc->ki_start.tv_sec) * PR_USEC_PER_SEC;
++  starttime += proc->ki_start.tv_usec;
++#else
+   PRTime starttime = static_cast<PRTime>(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 <sys/syscall.h>
+ #endif
+ 
+-#ifdef XP_MACOSX
++#if defined(XP_MACOSX) || defined(__DragonFly__) || defined(__FreeBSD__) \
++  || defined(__NetBSD__) || defined(__OpenBSD__)
++#include <sys/param.h>
+ #include <sys/sysctl.h>
+ #endif
+ 
+-#ifdef __OpenBSD__
+-#include <sys/param.h>
+-#include <sys/sysctl.h>
++#if defined(__DragonFly__) || defined(__FreeBSD__)
++#include <sys/user.h>
+ #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<PRTime>(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<PRTime>(proc->kp_start.tv_sec) * PR_USEC_PER_SEC;
++  starttime += proc->kp_start.tv_usec;
++#elif defined(__FreeBSD__)
++  PRTime starttime = static_cast<PRTime>(proc->ki_start.tv_sec) * PR_USEC_PER_SEC;
++  starttime += proc->ki_start.tv_usec;
++#else
+   PRTime starttime = static_cast<PRTime>(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 <sys/syscall.h>
+ #endif
+ 
+-#ifdef XP_MACOSX
++#if defined(XP_MACOSX) || defined(__DragonFly__) || defined(__FreeBSD__) \
++  || defined(__NetBSD__) || defined(__OpenBSD__)
++#include <sys/param.h>
+ #include <sys/sysctl.h>
+ #endif
+ 
+-#ifdef __OpenBSD__
+-#include <sys/param.h>
+-#include <sys/sysctl.h>
++#if defined(__DragonFly__) || defined(__FreeBSD__)
++#include <sys/user.h>
+ #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<PRTime>(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<PRTime>(proc->kp_start.tv_sec) * PR_USEC_PER_SEC;
++  starttime += proc->kp_start.tv_usec;
++#elif defined(__FreeBSD__)
++  PRTime starttime = static_cast<PRTime>(proc->ki_start.tv_sec) * PR_USEC_PER_SEC;
++  starttime += proc->ki_start.tv_usec;
++#else
+   PRTime starttime = static_cast<PRTime>(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 <sys/syscall.h>
+ #endif
+ 
+-#ifdef XP_MACOSX
++#if defined(XP_MACOSX) || defined(__DragonFly__) || defined(__FreeBSD__) \
++  || defined(__NetBSD__) || defined(__OpenBSD__)
++#include <sys/param.h>
+ #include <sys/sysctl.h>
+ #endif
+ 
+-#ifdef __OpenBSD__
+-#include <sys/param.h>
+-#include <sys/sysctl.h>
++#if defined(__DragonFly__) || defined(__FreeBSD__)
++#include <sys/user.h>
+ #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<PRTime>(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<PRTime>(proc->kp_start.tv_sec) * PR_USEC_PER_SEC;
++  starttime += proc->kp_start.tv_usec;
++#elif defined(__FreeBSD__)
++  PRTime starttime = static_cast<PRTime>(proc->ki_start.tv_sec) * PR_USEC_PER_SEC;
++  starttime += proc->ki_start.tv_usec;
++#else
+   PRTime starttime = static_cast<PRTime>(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 <sys/syscall.h>
+ #endif
+ 
+-#ifdef XP_MACOSX
++#if defined(XP_MACOSX) || defined(__DragonFly__) || defined(__FreeBSD__) \
++  || defined(__NetBSD__) || defined(__OpenBSD__)
++#include <sys/param.h>
+ #include <sys/sysctl.h>
+ #endif
+ 
+-#ifdef __OpenBSD__
+-#include <sys/param.h>
+-#include <sys/sysctl.h>
++#if defined(__DragonFly__) || defined(__FreeBSD__)
++#include <sys/user.h>
+ #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<PRTime>(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<PRTime>(proc->kp_start.tv_sec) * PR_USEC_PER_SEC;
++  starttime += proc->kp_start.tv_usec;
++#elif defined(__FreeBSD__)
++  PRTime starttime = static_cast<PRTime>(proc->ki_start.tv_sec) * PR_USEC_PER_SEC;
++  starttime += proc->ki_start.tv_usec;
++#else
+   PRTime starttime = static_cast<PRTime>(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 <sys/syscall.h>
+ #endif
+ 
+-#ifdef XP_MACOSX
++#if defined(XP_MACOSX) || defined(__DragonFly__) || defined(__FreeBSD__) \
++  || defined(__NetBSD__) || defined(__OpenBSD__)
++#include <sys/param.h>
+ #include <sys/sysctl.h>
+ #endif
+ 
+-#ifdef __OpenBSD__
+-#include <sys/param.h>
+-#include <sys/sysctl.h>
++#if defined(__DragonFly__) || defined(__FreeBSD__)
++#include <sys/user.h>
+ #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<PRTime>(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<PRTime>(proc->kp_start.tv_sec) * PR_USEC_PER_SEC;
++  starttime += proc->kp_start.tv_usec;
++#elif defined(__FreeBSD__)
++  PRTime starttime = static_cast<PRTime>(proc->ki_start.tv_sec) * PR_USEC_PER_SEC;
++  starttime += proc->ki_start.tv_usec;
++#else
+   PRTime starttime = static_cast<PRTime>(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 <sys/syscall.h>
+ #endif
+ 
+-#ifdef XP_MACOSX
++#if defined(XP_MACOSX) || defined(__DragonFly__) || defined(__FreeBSD__) \
++  || defined(__NetBSD__) || defined(__OpenBSD__)
++#include <sys/param.h>
+ #include <sys/sysctl.h>
+ #endif
+ 
+-#ifdef __OpenBSD__
+-#include <sys/param.h>
+-#include <sys/sysctl.h>
++#if defined(__DragonFly__) || defined(__FreeBSD__)
++#include <sys/user.h>
+ #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<PRTime>(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<PRTime>(proc->kp_start.tv_sec) * PR_USEC_PER_SEC;
++  starttime += proc->kp_start.tv_usec;
++#elif defined(__FreeBSD__)
++  PRTime starttime = static_cast<PRTime>(proc->ki_start.tv_sec) * PR_USEC_PER_SEC;
++  starttime += proc->ki_start.tv_usec;
++#else
+   PRTime starttime = static_cast<PRTime>(proc->p_ustart_sec) * PR_USEC_PER_SEC;
+   starttime += proc->p_ustart_usec;
++#endif
++
+   free(proc);
+   return starttime;
+ }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201209081432.q88EWIaB095439>