import changes from `dev' branch of rmottola/Arctic-Fox:

- Bug 1144842 (part 1) - Don't use MOZ_PROFILING before all the places it can be set. r=glandium. (3c12a2e29a)
- Bug 1144842 (part 2) - Make --enable-dmd imply --enable-profiling. r=glandium. (85c9ff5c32)
- Bug 1144842 (part 3) - Remove --enable-dmd code from js/src/configure.in. r=glandium. (52cf663bc7)
- Bug 1221846 - Get Task Tracer building on desktop r=cyu. (5d1a0fabe9)
- Bug 1216681 - Add a fileid utility to extract the breakpad GUID from object files for identification in fix_stack_using_bpsyms. r=ted (e53eb5acc6)
- Bug 1237156 - Only build the fileid utility when MOZ_CRASHREPORTER is set. r=ted.mielczarek (328a80ae18)
- Bug 1239866 - Remove signaling standalone tests. r=bwc (b05b091059)
This commit is contained in:
2023-09-27 11:35:20 +08:00
parent 10b8016dd0
commit d961fd91d0
17 changed files with 88 additions and 171 deletions
+33 -32
View File
@@ -1696,15 +1696,6 @@ if test -n "$MOZ_USE_SYSTRACE"; then
AC_DEFINE(MOZ_USE_SYSTRACE)
fi
# For profiling builds keep the symbol information
if test "$MOZ_PROFILING" -a -z "$STRIP_FLAGS"; then
case "$OS_TARGET" in
Linux|DragonFly|FreeBSD|NetBSD|OpenBSD)
STRIP_FLAGS="--strip-debug"
;;
esac
fi
dnl ========================================================
dnl = Use Valgrind
dnl ========================================================
@@ -1768,6 +1759,38 @@ if test -n "$MOZ_VTUNE"; then
AC_DEFINE(MOZ_VTUNE)
fi
# For profiling builds keep the symbol information
if test "$MOZ_PROFILING" -a -z "$STRIP_FLAGS"; then
case "$OS_TARGET" in
Linux|DragonFly|FreeBSD|NetBSD|OpenBSD)
STRIP_FLAGS="--strip-debug"
;;
esac
fi
dnl ========================================================
dnl = Enable DMD
dnl ========================================================
MOZ_ARG_ENABLE_BOOL(dmd,
[ --enable-dmd Enable DMD; also enables jemalloc, replace-malloc and profiling],
MOZ_DMD=1,
MOZ_DMD= )
if test "$MOZ_DMD"; then
AC_DEFINE(MOZ_DMD)
if test "${CPU_ARCH}" = "arm"; then
CFLAGS="$CFLAGS -funwind-tables"
CXXFLAGS="$CXXFLAGS -funwind-tables"
fi
MOZ_MEMORY=1 # DMD enables jemalloc
MOZ_REPLACE_MALLOC=1 # DMD enables replace-malloc
MOZ_PROFILING=1 # DMD enables profiling
fi
AC_SUBST(MOZ_DMD)
dnl ========================================================
dnl Profiling
dnl ========================================================
@@ -6900,28 +6923,6 @@ if test -n "$MOZ_DEBUG"; then
AC_DEFINE(MOZ_DUMP_PAINTING)
fi
dnl ========================================================
dnl = Enable DMD
dnl ========================================================
MOZ_ARG_ENABLE_BOOL(dmd,
[ --enable-dmd Enable DMD; also enables jemalloc and replace-malloc],
MOZ_DMD=1,
MOZ_DMD= )
if test "$MOZ_DMD"; then
AC_DEFINE(MOZ_DMD)
if test "${CPU_ARCH}" = "arm"; then
CFLAGS="$CFLAGS -funwind-tables"
CXXFLAGS="$CXXFLAGS -funwind-tables"
fi
MOZ_MEMORY=1 # DMD enables jemalloc
MOZ_REPLACE_MALLOC=1 # DMD enables replace-malloc
fi
AC_SUBST(MOZ_DMD)
dnl ========================================================
dnl = Enable jemalloc
dnl ========================================================
@@ -7267,7 +7268,7 @@ MOZ_ARG_ENABLE_BOOL(tasktracer,
[ --enable-tasktracer Set compile flags necessary for using TaskTracer],
MOZ_TASK_TRACER=1,
MOZ_TASK_TRACER= )
if test "$MOZ_WIDGET_TOOLKIT" = "gonk" -a -n "$MOZ_TASK_TRACER"; then
if test -n "$MOZ_TASK_TRACER"; then
AC_DEFINE(MOZ_TASK_TRACER)
AC_SUBST(MOZ_TASK_TRACER)
fi
-18
View File
@@ -2972,24 +2972,6 @@ elif test "$GNU_CC"; then
fi
fi
dnl ========================================================
dnl = Enable DMD
dnl ========================================================
MOZ_ARG_ENABLE_BOOL(dmd,
[ --enable-dmd Enable DMD; also enables jemalloc and replace-malloc],
MOZ_DMD=1,
MOZ_DMD= )
if test "$MOZ_DMD"; then
AC_DEFINE(MOZ_DMD)
if test "${CPU_ARCH}" = "arm"; then
CFLAGS="$CFLAGS -funwind-tables"
CXXFLAGS="$CXXFLAGS -funwind-tables"
fi
fi
dnl ========================================================
dnl = Enable jemalloc
dnl ========================================================
-9
View File
@@ -114,15 +114,6 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] != 'gonk':
)
GYP_DIRS['signalingtest'].non_unified_sources += signaling_non_unified_sources
GYP_DIRS += ['signalingstandalone']
GYP_DIRS['signalingstandalone'].input = 'signaling/signaling.gyp'
GYP_DIRS['signalingstandalone'].variables = gyp_vars.copy()
GYP_DIRS['signalingstandalone'].variables.update(
build_for_test=0,
build_for_standalone=1
)
GYP_DIRS['signalingstandalone'].non_unified_sources += signaling_non_unified_sources
if CONFIG['MOZ_X11']:
CXXFLAGS += CONFIG['TK_CFLAGS']
@@ -1,7 +0,0 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "../jsep_session_unittest.cpp"
@@ -1,5 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "../mediaconduit_unittests.cpp"
@@ -1,7 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
// Original author: ekr@rtfm.com
#include "../mediapipeline_unittest.cpp"
@@ -1,63 +0,0 @@
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# Standalone WebRTC does not link on Android.
# See Bug 1127510 - Standalone WebRTC unit tests fail to link on Android
if CONFIG['OS_TARGET'] != 'WINNT' and CONFIG['MOZ_WIDGET_TOOLKIT'] != 'gonk' and CONFIG['OS_TARGET'] != 'Android':
CppUnitTests([
'jsep_session_unittest_standalone',
# mediaconduit_unittests disabled for standalone build until GMP support added.
# See Bug 1121677 - Enable GMP for WebRTC standalone.
# 'mediaconduit_unittests_standalone',
'mediapipeline_unittest_standalone',
'sdp_unittests_standalone',
'signaling_unittests_standalone',
])
include('/ipc/chromium/chromium-config.mozbuild')
include('../common.build')
for var in ('MOZILLA_INTERNAL_API', 'MOZILLA_XPCOMRT_API'):
DEFINES[var] = True
if CONFIG['OS_TARGET'] == 'Linux':
USE_LIBS += [
'nspr',
]
OS_LIBS += [
'-lrt',
]
LOCAL_INCLUDES += [
'..',
'/xpcom/libxpcomrt',
]
USE_LIBS += [
'/media/webrtc/signalingstandalone/signaling_ecc/ecc',
'fallible',
'js', # Turns out, binding implementations use JS, who knew.
'media_standalone',
'mfbt',
'mozglue',
'mtransport_standalone',
'necko_standalone',
'nspr',
'nss',
'unicharutil_standalone',
'xpcomrt',
]
if CONFIG['OS_TARGET'] == 'Android':
USE_LIBS += [
'freetype',
]
if CONFIG['OS_TARGET'] == 'OpenBSD':
OS_LIBS += ['sndio']
USE_LIBS += ['mozglue']
@@ -1,7 +0,0 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "../sdp_unittests.cpp"
@@ -1,6 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
#define SIGNALING_UNITTEST_STANDALONE 1
#include "../signaling_unittests.cpp"
+4 -3
View File
@@ -12,10 +12,11 @@
#include <stdlib.h>
#include <string.h>
#ifdef XP_WIN
#if defined(MOZ_OPTIMIZE) && !defined(MOZ_PROFILING)
#error "Optimized, DMD-enabled builds on Windows must be built with --enable-profiling"
#if !defined(MOZ_PROFILING)
#error "DMD requires MOZ_PROFILING"
#endif
#ifdef XP_WIN
#include <windows.h>
#include <process.h>
#else
+1
View File
@@ -20,6 +20,7 @@ libs::
TEST_HARNESS_BINS := \
xpcshell$(BIN_SUFFIX) \
ssltunnel$(BIN_SUFFIX) \
fileid$(BIN_SUFFIX) \
certutil$(BIN_SUFFIX) \
pk12util$(BIN_SUFFIX) \
BadCertServer$(BIN_SUFFIX) \
+5 -2
View File
@@ -184,9 +184,12 @@ if CONFIG['ENABLE_TESTS']:
'/testing/web-platform',
]
if CONFIG['MOZ_WEBRTC'] and CONFIG['MOZ_WIDGET_TOOLKIT'] != 'gonk':
# The file id utility requires breakpad libraries.
if CONFIG['MOZ_CRASHREPORTER']:
DIRS += ['/testing/tools/fileid']
if CONFIG['MOZ_WEBRTC'] and CONFIG['MOZ_WIDGET_TOOLKIT'] != 'gonk' and not CONFIG['MOZ_TASK_TRACER']:
DIRS += [
'/media/webrtc/signaling/test',
'/media/webrtc/signaling/test/standalone',
'/media/mtransport/test',
]
+17 -5
View File
@@ -19,13 +19,25 @@
#include <stdarg.h>
// We need a definition of gettid(), but glibc doesn't provide a
// wrapper for it.
#if defined(__GLIBC__)
// glibc doesn't implement gettid(2).
#include <unistd.h>
#include <sys/syscall.h>
static pid_t gettid()
static inline pid_t gettid()
{
return (pid_t) syscall(SYS_gettid);
}
#elif defined(XP_MACOSX)
#include <unistd.h>
#include <sys/syscall.h>
static inline pid_t gettid()
{
return (pid_t) syscall(SYS_thread_selfid);
}
#elif defined(LINUX)
#include <sys/types.h>
pid_t gettid();
#endif
// NS_ENSURE_TRUE_VOID() without the warning on the debug build.
@@ -114,12 +126,12 @@ CreateSourceEvent(SourceEventType aType)
info->mCurTraceSourceType = aType;
info->mCurTaskId = newId;
int* namePtr;
uintptr_t* namePtr;
#define SOURCE_EVENT_NAME(type) \
case SourceEventType::type: \
{ \
static int CreateSourceEvent##type; \
namePtr = &CreateSourceEvent##type; \
namePtr = (uintptr_t*)&CreateSourceEvent##type; \
break; \
}
@@ -367,7 +379,7 @@ LogEnd(uint64_t aTaskId, uint64_t aSourceEventId)
}
void
LogVirtualTablePtr(uint64_t aTaskId, uint64_t aSourceEventId, int* aVptr)
LogVirtualTablePtr(uint64_t aTaskId, uint64_t aSourceEventId, uintptr_t* aVptr)
{
TraceInfo* info = GetOrCreateTraceInfo();
ENSURE_TRUE_VOID(info);
@@ -94,7 +94,7 @@ void LogBegin(uint64_t aTaskId, uint64_t aSourceEventId);
void LogEnd(uint64_t aTaskId, uint64_t aSourceEventId);
void LogVirtualTablePtr(uint64_t aTaskId, uint64_t aSourceEventId, int* aVptr);
void LogVirtualTablePtr(uint64_t aTaskId, uint64_t aSourceEventId, uintptr_t* aVptr);
} // namespace mozilla
} // namespace tasktracer
@@ -95,7 +95,7 @@ TracedRunnable::TracedRunnable(already_AddRefed<nsIRunnable>&& aOriginalObj)
, mOriginalObj(Move(aOriginalObj))
{
Init();
LogVirtualTablePtr(mTaskId, mSourceEventId, *(int**)(aOriginalObj));
LogVirtualTablePtr(mTaskId, mSourceEventId, reinterpret_cast<uintptr_t*>(mOriginalObj.get()));
}
TracedRunnable::~TracedRunnable()
@@ -122,7 +122,7 @@ TracedTask::TracedTask(Task* aOriginalObj)
, mOriginalObj(aOriginalObj)
{
Init();
LogVirtualTablePtr(mTaskId, mSourceEventId, *(int**)(aOriginalObj));
LogVirtualTablePtr(mTaskId, mSourceEventId, reinterpret_cast<uintptr_t*>(aOriginalObj));
}
TracedTask::~TracedTask()
+21 -4
View File
@@ -13,8 +13,11 @@ from __future__ import with_statement
import sys
import os
import re
import subprocess
import bisect
here = os.path.dirname(__file__)
def prettyFileName(name):
if name.startswith("../") or name.startswith("..\\"):
# dom_quickstubs.cpp and many .h files show up with relative paths that are useless
@@ -77,9 +80,21 @@ class SymbolFile:
else:
return ""
def guessSymbolFile(fn, symbolsDir):
def findIdForPath(path):
"""Finds the breakpad id for the object file at the given path."""
# We should always be packaged with a "fileid" executable.
fileid_exe = os.path.join(here, 'fileid')
if not os.path.isfile(fileid_exe):
raise Exception("Could not find fileid executable in %s" % here)
try:
return subprocess.check_output([fileid_exe, path]).rstrip()
except subprocess.CalledProcessError as e:
raise Exception("Error getting fileid for %s: %s" %
(path, e.output))
def guessSymbolFile(full_path, symbolsDir):
"""Guess a symbol file based on an object file's basename, ignoring the path and UUID."""
fn = os.path.basename(fn)
fn = os.path.basename(full_path)
d1 = os.path.join(symbolsDir, fn)
if not os.path.exists(d1):
fn = fn + ".pdb"
@@ -90,10 +105,12 @@ def guessSymbolFile(fn, symbolsDir):
if len(uuids) == 0:
raise Exception("Missing symbol file for " + fn)
if len(uuids) > 1:
raise Exception("Ambiguous symbol file for " + fn)
uuid = findIdForPath(full_path)
else:
uuid = uuids[0]
if fn.endswith(".pdb"):
fn = fn[:-4]
return os.path.join(d1, uuids[0], fn + ".sym")
return os.path.join(d1, uuid, fn + ".sym")
parsedSymbolFiles = {}
def getSymbolFile(file, symbolsDir):
+4
View File
@@ -21,6 +21,10 @@
#include <math.h>
using namespace mozilla;
#ifdef MOZ_TASK_TRACER
#include "GeckoTaskTracerImpl.h"
using namespace mozilla::tasktracer;
#endif
NS_IMPL_ISUPPORTS(TimerThread, nsIRunnable, nsIObserver)