Backout 746513dca667 (Bug 765357) due to xpcshell orange (linux, mac).

This commit is contained in:
Benoit Girard 2012-06-24 21:00:21 -04:00
parent 1f32c8faaa
commit 5173e4e0a5
11 changed files with 8 additions and 152 deletions

View File

@ -124,5 +124,3 @@ run-if.config = ipc
[include:modules/libmar/tests/unit/xpcshell.ini]
skip-if = os == "android"
[include:tools/profiler/tests/xpcshell.ini]

View File

@ -8,9 +8,6 @@ DEPTH = ../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = $(srcdir)
relativesrcdir = tools/profiler
XPCSHELL_TESTS = tests
include $(DEPTH)/config/autoconf.mk

View File

@ -239,9 +239,10 @@ public:
JSObject *sample = NULL;
JSObject *frames = NULL;
int readPos = mReadPos;
while (readPos != mLastFlushPos) {
ProfileEntry entry = mEntries[readPos];
int oldReadPos = mReadPos;
while (mReadPos != mLastFlushPos) {
ProfileEntry entry = mEntries[mReadPos];
mReadPos = (mReadPos + 1) % mEntrySize;
switch (entry.mTagName) {
case 's':
sample = b.CreateObject();
@ -266,8 +267,8 @@ public:
}
}
}
readPos = (readPos + 1) % mEntrySize;
}
mReadPos = oldReadPos;
return profile;
}
@ -765,9 +766,6 @@ const char** mozilla_sampler_get_features()
void mozilla_sampler_start(int aProfileEntries, int aInterval,
const char** aFeatures, uint32_t aFeatureCount)
{
if (!stack_key_initialized)
mozilla_sampler_init();
ProfileStack *stack = tlsStack.get();
if (!stack) {
ASSERT(false);
@ -784,9 +782,6 @@ void mozilla_sampler_start(int aProfileEntries, int aInterval,
void mozilla_sampler_stop()
{
if (!stack_key_initialized)
mozilla_sampler_init();
TableTicker *t = tlsTicker.get();
if (!t) {
return;
@ -799,9 +794,6 @@ void mozilla_sampler_stop()
bool mozilla_sampler_is_active()
{
if (!stack_key_initialized)
mozilla_sampler_init();
TableTicker *t = tlsTicker.get();
if (!t) {
return false;

View File

@ -8,7 +8,7 @@
[scriptable, uuid(e388fded-1321-41af-a988-861a2bc5cfc3)]
interface nsIProfiler : nsISupports
{
void StartProfiler(in PRUint32 aEntries, in PRUint32 aInterval,
void StartProfiler(in PRUint32 aInterval, in PRUint32 aEntries,
[array, size_is(aFeatureCount)] in string aFeatures,
in PRUint32 aFeatureCount);
void StopProfiler();

View File

@ -26,10 +26,10 @@ nsProfiler::nsProfiler()
NS_IMETHODIMP
nsProfiler::StartProfiler(PRUint32 aEntries, PRUint32 aInterval,
nsProfiler::StartProfiler(PRUint32 aInterval, PRUint32 aEntries,
const char** aFeatures, PRUint32 aFeatureCount)
{
SAMPLER_START(aEntries, aInterval, aFeatures, aFeatureCount);
SAMPLER_START(aInterval, aEntries, aFeatures, aFeatureCount);
#ifdef MOZ_INSTRUMENT_EVENT_LOOP
mozilla::InitEventTracing();
#endif

View File

@ -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/. */
const Cc = Components.classes;
const Ci = Components.interfaces;

View File

@ -1,18 +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/. */
function run_test() {
// If we can't get the profiler component then assume gecko was
// built without it and pass all the tests
var profilerCc = Cc["@mozilla.org/tools/profiler;1"];
if (!profilerCc)
return;
var profiler = Cc["@mozilla.org/tools/profiler;1"].getService(Ci.nsIProfiler);
if (!profiler)
return;
var profilerFeatures = profiler.GetFeatures([]);
do_check_true(profilerFeatures != null);
}

View File

@ -1,48 +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/. */
function run_test() {
// If we can't get the profiler component then assume gecko was
// built without it and pass all the tests
var profilerCc = Cc["@mozilla.org/tools/profiler;1"];
if (!profilerCc)
return;
var profiler = Cc["@mozilla.org/tools/profiler;1"].getService(Ci.nsIProfiler);
if (!profiler)
return;
do_check_true(!profiler.IsActive());
profiler.StartProfiler(1000, 10, [], 0);
do_check_true(profiler.IsActive());
do_test_pending();
do_timeout(1000, function wait() {
// Check responsiveness
var resp = profiler.GetResponsivenessTimes({});
do_check_true(resp.length > 10);
// Check text profile format
var profileStr = profiler.GetProfile();
do_check_true(profileStr.length > 10);
// check json profile format
var profileObj = profiler.getProfileData();
do_check_neq(profileObj, null);
do_check_neq(profileObj.threads, null);
do_check_true(profileObj.threads.length >= 1);
do_check_neq(profileObj.threads[0].samples, null);
// NOTE: The number of samples will be empty since we
// don't have any labels in the xpcshell code
profiler.StopProfiler();
do_check_true(!profiler.IsActive());
do_test_finished();
});
}

View File

@ -1,25 +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/. */
function run_test() {
// If we can't get the profiler component then assume gecko was
// built without it and pass all the tests
var profilerCc = Cc["@mozilla.org/tools/profiler;1"];
if (!profilerCc)
return;
var profiler = Cc["@mozilla.org/tools/profiler;1"].getService(Ci.nsIProfiler);
if (!profiler)
return;
var sharedStr = profiler.getSharedLibraryInformation();
sharedStr = sharedStr.toLowerCase();
// Let's not hardcode anything too specific
// just some sanity checks.
do_check_neq(sharedStr.indexOf("name"), -1);
do_check_neq(sharedStr.indexOf("start"), -1);
do_check_neq(sharedStr.indexOf("end"), -1);
do_check_neq(sharedStr.indexOf("offset"), -1);
}

View File

@ -1,25 +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/. */
function run_test() {
// If we can't get the profiler component then assume gecko was
// built without it and pass all the tests
var profilerCc = Cc["@mozilla.org/tools/profiler;1"];
if (!profilerCc)
return;
var profiler = Cc["@mozilla.org/tools/profiler;1"].getService(Ci.nsIProfiler);
if (!profiler)
return;
do_check_true(!profiler.IsActive());
profiler.StartProfiler(10, 100, [], 0);
do_check_true(profiler.IsActive());
profiler.StopProfiler();
do_check_true(!profiler.IsActive());
}

View File

@ -1,8 +0,0 @@
[DEFAULT]
head = head_profiler.js
tail =
[test_start.js]
[test_get_features.js]
[test_shared_library.js]
[test_run.js]