Commit 8800fbef authored by Cristina Horotan's avatar Cristina Horotan Committed by chorotan@mozilla.com
Browse files

Revert "Bug 1964451 - Add use counters for OOM handling r=sfink,mccr8" on request

This reverts commit 7ae56a02.
parent 39dc4fb7
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -85,10 +85,6 @@ custom JS_errorstack_setter_no_errordata called error.stack setter on object wit
custom JS_dateparse called Date.parse
custom JS_dateparse_impl_def call to Date.parse used implementation defined behaviour
custom JS_regexp_symbol_protocol_on_primitive passed a primitive with a custom implementation of the regexp protocol symbols to one of the String methods that accept a regexp
custom JS_large_oom_reported reported a large oom
custom JS_small_oom_reported reported a small oom
custom JS_large_oom_recovered recovered a large oom
custom JS_small_oom_recovered recovered a small oom

// Console API
method console.assert
+3 −139
Original line number Diff line number Diff line
@@ -107,8 +107,8 @@ use.counter:
    send_in_pings:
      - use-counters
# Total of 2405 use counter metrics (excludes denominators).
# Total of 362 'page' use counters.
# Total of 2397 use counter metrics (excludes denominators).
# Total of 358 'page' use counters.
use.counter.page:
  svgsvgelement_getelementbyid:
    type: counter
@@ -824,74 +824,6 @@ use.counter.page:
    send_in_pings:
      - use-counters
  js_large_oom_reported:
    type: counter
    description: >
      Whether a page reported a large oom.
      Compare against `use.counter.top_level_content_documents_destroyed`
      to calculate the rate.
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1852098
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1852098
    notification_emails:
      - dom-core@mozilla.com
      - emilio@mozilla.com
    expires: never
    send_in_pings:
      - use-counters
  js_small_oom_reported:
    type: counter
    description: >
      Whether a page reported a small oom.
      Compare against `use.counter.top_level_content_documents_destroyed`
      to calculate the rate.
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1852098
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1852098
    notification_emails:
      - dom-core@mozilla.com
      - emilio@mozilla.com
    expires: never
    send_in_pings:
      - use-counters
  js_large_oom_recovered:
    type: counter
    description: >
      Whether a page recovered a large oom.
      Compare against `use.counter.top_level_content_documents_destroyed`
      to calculate the rate.
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1852098
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1852098
    notification_emails:
      - dom-core@mozilla.com
      - emilio@mozilla.com
    expires: never
    send_in_pings:
      - use-counters
  js_small_oom_recovered:
    type: counter
    description: >
      Whether a page recovered a small oom.
      Compare against `use.counter.top_level_content_documents_destroyed`
      to calculate the rate.
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1852098
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1852098
    notification_emails:
      - dom-core@mozilla.com
      - emilio@mozilla.com
    expires: never
    send_in_pings:
      - use-counters
  console_assert:
    type: counter
    description: >
@@ -6264,7 +6196,7 @@ use.counter.page:
    send_in_pings:
      - use-counters
# Total of 362 'document' use counters.
# Total of 358 'document' use counters.
use.counter.doc:
  svgsvgelement_getelementbyid:
    type: counter
@@ -6980,74 +6912,6 @@ use.counter.doc:
    send_in_pings:
      - use-counters
  js_large_oom_reported:
    type: counter
    description: >
      Whether a document reported a large oom.
      Compare against `use.counter.content_documents_destroyed`
      to calculate the rate.
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1852098
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1852098
    notification_emails:
      - dom-core@mozilla.com
      - emilio@mozilla.com
    expires: never
    send_in_pings:
      - use-counters
  js_small_oom_reported:
    type: counter
    description: >
      Whether a document reported a small oom.
      Compare against `use.counter.content_documents_destroyed`
      to calculate the rate.
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1852098
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1852098
    notification_emails:
      - dom-core@mozilla.com
      - emilio@mozilla.com
    expires: never
    send_in_pings:
      - use-counters
  js_large_oom_recovered:
    type: counter
    description: >
      Whether a document recovered a large oom.
      Compare against `use.counter.content_documents_destroyed`
      to calculate the rate.
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1852098
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1852098
    notification_emails:
      - dom-core@mozilla.com
      - emilio@mozilla.com
    expires: never
    send_in_pings:
      - use-counters
  js_small_oom_recovered:
    type: counter
    description: >
      Whether a document recovered a small oom.
      Compare against `use.counter.content_documents_destroyed`
      to calculate the rate.
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1852098
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1852098
    notification_emails:
      - dom-core@mozilla.com
      - emilio@mozilla.com
    expires: never
    send_in_pings:
      - use-counters
  console_assert:
    type: counter
    description: >
+0 −30
Original line number Diff line number Diff line
@@ -1992,14 +1992,7 @@ bool CycleCollectedJSRuntime::OOMReported() {

void CycleCollectedJSRuntime::AnnotateAndSetOutOfMemory(OOMState* aStatePtr,
                                                        OOMState aNewState) {
  enum class Size { Large, Small };

  Size size = aStatePtr == &mOutOfMemoryState ? Size::Small : Size::Large;
  MOZ_ASSERT_IF(size == Size::Large,
                aStatePtr == &mLargeAllocationFailureState);

  *aStatePtr = aNewState;

  CrashReporter::Annotation annotation =
      (aStatePtr == &mOutOfMemoryState)
          ? CrashReporter::Annotation::JSOutOfMemory
@@ -2007,29 +2000,6 @@ void CycleCollectedJSRuntime::AnnotateAndSetOutOfMemory(OOMState* aStatePtr,

  CrashReporter::RecordAnnotationCString(annotation,
                                         OOMStateToString(aNewState));

  // Attempt to report telemetry.
  if (JSObject* global = JS::CurrentGlobalOrNull(GetContext()->Context())) {
    if (aNewState == OOMState::Recovered) {
      switch (size) {
        case Size::Large:
          SetUseCounter(global, eUseCounter_custom_JS_large_oom_recovered);
          break;
        case Size::Small:
          SetUseCounter(global, eUseCounter_custom_JS_small_oom_recovered);
          break;
      }
    } else {
      switch (size) {
        case Size::Large:
          SetUseCounter(global, eUseCounter_custom_JS_large_oom_reported);
          break;
        case Size::Small:
          SetUseCounter(global, eUseCounter_custom_JS_small_oom_reported);
          break;
      }
    }
  }
}

void CycleCollectedJSRuntime::OnGC(JSContext* aContext, JSGCStatus aStatus,