Bug 1277414 - Remove the memprof actor; r=ejpbruel
authorNick Fitzgerald <fitzgen@gmail.com>
Thu, 02 Jun 2016 10:04:27 -0700
changeset 341113 91879ebba4d61fde72af13223708faa01109a4d9
parent 341112 c2f28446c94a222c145c436d6d9e78ec68b7e17a
child 341114 2fe563989bc6f23109d602fc3887cec710709f64
push id1183
push userraliiev@mozilla.com
push dateMon, 05 Sep 2016 20:01:49 +0000
treeherdermozilla-release@3148731bed45 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersejpbruel
bugs1277414
milestone49.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1277414 - Remove the memprof actor; r=ejpbruel
devtools/server/actors/memprof.js
devtools/server/actors/moz.build
devtools/server/main.js
devtools/server/tests/mochitest/chrome.ini
devtools/server/tests/mochitest/memprof-helpers.js
devtools/server/tests/mochitest/test_memprof.html
deleted file mode 100644
--- a/devtools/server/actors/memprof.js
+++ /dev/null
@@ -1,66 +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/. */
-
-"use strict";
-
-const { Cc, Ci, Cu } = require("chrome");
-var protocol = require("devtools/shared/protocol");
-var { method, RetVal, Arg, types } = protocol;
-const { reportException } = require("devtools/shared/DevToolsUtils");
-loader.lazyRequireGetter(this, "events", "sdk/event/core");
-
-var MemprofActor = protocol.ActorClass({
-  typeName: "memprof",
-
-  initialize: function (conn) {
-    protocol.Actor.prototype.initialize.call(this, conn);
-    this._profiler = Cc["@mozilla.org/tools/memory-profiler;1"]
-      .getService(Ci.nsIMemoryProfiler);
-  },
-
-  destroy: function () {
-    this._profiler = null;
-    protocol.Actor.prototype.destroy.call(this);
-  },
-
-  startProfiler: method(function () {
-    this._profiler.startProfiler();
-  }, {
-    request: {},
-    response: {}
-  }),
-
-  stopProfiler: method(function () {
-    this._profiler.stopProfiler();
-  }, {
-    request: {},
-    response: {}
-  }),
-
-  resetProfiler: method(function () {
-    this._profiler.resetProfiler();
-  }, {
-    request: {},
-    response: {}
-  }),
-
-  getResults: method(function () {
-    return this._profiler.getResults();
-  }, {
-    request: {},
-    response: {
-      ret: RetVal("json")
-    }
-  })
-});
-
-exports.MemprofActor = MemprofActor;
-
-exports.MemprofFront = protocol.FrontClass(MemprofActor, {
-  initialize: function (client, form) {
-    protocol.Front.prototype.initialize.call(this, client, form);
-    this.actorID = form.memprofActor;
-    this.manage(this);
-  }
-});
--- a/devtools/server/actors/moz.build
+++ b/devtools/server/actors/moz.build
@@ -33,17 +33,16 @@ DevToolsModules(
     'framerate.js',
     'gcli.js',
     'heap-snapshot-file.js',
     'highlighters.css',
     'highlighters.js',
     'inspector.js',
     'layout.js',
     'memory.js',
-    'memprof.js',
     'monitor.js',
     'object.js',
     'performance-entries.js',
     'performance-recording.js',
     'performance.js',
     'preference.js',
     'pretty-print-worker.js',
     'process.js',
--- a/devtools/server/main.js
+++ b/devtools/server/main.js
@@ -500,21 +500,16 @@ var DebuggerServer = {
       constructor: "GcliActor",
       type: { tab: true }
     });
     this.registerModule("devtools/server/actors/memory", {
       prefix: "memory",
       constructor: "MemoryActor",
       type: { tab: true }
     });
-    this.registerModule("devtools/server/actors/memprof", {
-      prefix: "memprof",
-      constructor: "MemprofActor",
-      type: { global: true, tab: true }
-    });
     this.registerModule("devtools/server/actors/framerate", {
       prefix: "framerate",
       constructor: "FramerateActor",
       type: { tab: true }
     });
     this.registerModule("devtools/server/actors/eventlooplag", {
       prefix: "eventLoopLag",
       constructor: "EventLoopLagActor",
--- a/devtools/server/tests/mochitest/chrome.ini
+++ b/devtools/server/tests/mochitest/chrome.ini
@@ -13,17 +13,16 @@ support-files =
   inspector-delay-image-response.sjs
   inspector-helpers.js
   inspector-search-data.html
   inspector-styles-data.css
   inspector-styles-data.html
   inspector-traversal-data.html
   large-image.jpg
   memory-helpers.js
-  memprof-helpers.js
   nonchrome_unsafeDereference.html
   small-image.gif
   setup-in-child.js
   setup-in-parent.js
 
 [test_animation_actor-lifetime.html]
 [test_connection-manager.html]
 skip-if = buildapp == 'mulet'
@@ -97,17 +96,16 @@ skip-if = buildapp == 'mulet'
 [test_memory_allocations_05.html]
 [test_memory_allocations_06.html]
 [test_memory_allocations_07.html]
 [test_memory_attach_01.html]
 [test_memory_attach_02.html]
 [test_memory_census.html]
 [test_memory_gc_01.html]
 [test_memory_gc_events.html]
-[test_memprof.html]
 [test_preference.html]
 [test_settings.html]
 [test_setupInParentChild.html]
 [test_styles-applied.html]
 [test_styles-computed.html]
 [test_styles-layout.html]
 [test_styles-matched.html]
 [test_styles-modify.html]
deleted file mode 100644
--- a/devtools/server/tests/mochitest/memprof-helpers.js
+++ /dev/null
@@ -1,40 +0,0 @@
-var Cu = Components.utils;
-var Cc = Components.classes;
-var Ci = Components.interfaces;
-
-var { require } =
-  Cu.import("resource://devtools/shared/Loader.jsm", {});
-
-var Services = require("Services");
-var { DebuggerClient } = require("devtools/shared/client/main");
-var { DebuggerServer } = require("devtools/server/main");
-var { MemprofFront } = require("devtools/server/actors/memprof");
-var { Task } = require("devtools/shared/task");
-
-// Always log packets when running tests.
-Services.prefs.setBoolPref("devtools.debugger.log", true);
-SimpleTest.registerCleanupFunction(function () {
-  Services.prefs.clearUserPref("devtools.debugger.log");
-});
-
-function startServerAndGetSelectedTabMemprof() {
-  DebuggerServer.init();
-  DebuggerServer.addBrowserActors();
-  var client = new DebuggerClient(DebuggerServer.connectPipe());
-
-  return client.connect()
-    .then(() => client.listTabs())
-    .then(response => {
-      var form = response.tabs[response.selected];
-      var memprof = MemprofFront(client, form);
-
-      return { memprof, client };
-    });
-}
-
-function destroyServerAndFinish(client) {
-  client.close(() => {
-    DebuggerServer.destroy();
-    SimpleTest.finish();
-  });
-}
deleted file mode 100644
--- a/devtools/server/tests/mochitest/test_memprof.html
+++ /dev/null
@@ -1,71 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<!--
-Bug 1123237 - Test profiling memory allocations.
--->
-<head>
-  <meta charset="utf-8">
-  <title>Memory profiler actor test</title>
-  <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
-  <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css">
-</head>
-<body>
-<pre id="test">
-<script src="memprof-helpers.js" type="application/javascript;version=1.8"></script>
-<script>
-window.onload = function() {
-  SimpleTest.waitForExplicitFinish();
-
-  Task.spawn(function* () {
-    var { memprof, client } = yield startServerAndGetSelectedTabMemprof();
-    yield memprof.startProfiler();
-    ok(true, "Can start profiling allocations");
-
-    // Allocate some objects.
-
-    var alloc;
-    (function memprof_test_outer() {
-      (function memprof_test_middle() {
-        (function memprof_test_inner() {
-          for (i = 0; i < 65535; ++i) {
-            alloc = {};
-          }
-        }());
-      }());
-    }());
-
-    yield memprof.stopProfiler();
-    ok(true, "Can stop profiling allocations");
-
-    var results = yield memprof.getResults();
-    ok(true, "Can get results");
-
-    function isTestAllocation(name) {
-      return /memprof_test_inner/.test(name)
-        || /memprof_test_middle/.test(name)
-        || /memprof_test_outer/.test(name)
-    }
-
-    var testAllocations = results.names.filter(isTestAllocation);
-    ok(testAllocations.length >= 3, "Should find our 3 test allocations");
-
-    // Ensure the allocation traces has the correct index
-    var inner = results.traces.find(
-      trace => /memprof_test_inner/.test(results.names[trace.nameIdx]));
-    ok(inner, "Find the inner most frame");
-    var middle = results.traces[inner.parentIdx];
-    ok(/memprof_test_middle/.test(results.names[middle.nameIdx]),
-       "Find the middle frame");
-    var outer = results.traces[middle.parentIdx];
-    ok(/memprof_test_outer/.test(results.names[outer.nameIdx]),
-       "Find the outer frame");
-
-    yield memprof.resetProfiler();
-
-    destroyServerAndFinish(client);
-  });
-};
-</script>
-</pre>
-</body>
-</html>