Backed out changeset 78e8b1f01c25 (bug 1361661) for flake8 linting failures in gen-process-{data,enum}.py and build bustage in TelemetryProcessData.h on OS X, at least. r=backout on a CLOSED TREE
authorSebastian Hengst <archaeopteryx@coole-files.de>
Mon, 22 May 2017 16:20:56 +0200
changeset 359946 c36497319158aaaf1ba7e28754e9b59b9cf3c441
parent 359945 69c42b4e88777789280c95502980f3748ce327d5
child 359948 0582b98fa67d2269b2eaf320b98998f6d7a85e99
push id90544
push userarchaeopteryx@coole-files.de
push dateMon, 22 May 2017 14:21:35 +0000
treeherdermozilla-inbound@c36497319158 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbackout
bugs1361661
milestone55.0a1
backs out78e8b1f01c25b51564815772c4fa869cb38755b0
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
Backed out changeset 78e8b1f01c25 (bug 1361661) for flake8 linting failures in gen-process-{data,enum}.py and build bustage in TelemetryProcessData.h on OS X, at least. r=backout on a CLOSED TREE
CLOBBER
toolkit/components/telemetry/Processes.yaml
toolkit/components/telemetry/gen-process-data.py
toolkit/components/telemetry/gen-process-enum.py
toolkit/components/telemetry/moz.build
toolkit/components/telemetry/shared_telemetry_utils.py
--- a/CLOBBER
+++ b/CLOBBER
@@ -17,10 +17,9 @@
 #
 # Modifying this file will now automatically clobber the buildbot machines \o/
 #
 
 # Are you updating CLOBBER because you think it's needed for your WebIDL
 # changes to stick? As of bug 928195, this shouldn't be necessary! Please
 # don't change CLOBBER for WebIDL changes any more.
 
-Bug 1361661 - Update Telemetry build and headers.
-
+Bug 1340627 - clobber for Skia update
--- a/toolkit/components/telemetry/Processes.yaml
+++ b/toolkit/components/telemetry/Processes.yaml
@@ -1,21 +1,17 @@
 # This lists the known child processes we collect Telemetry for.
 # The entries are keyed with the names used in Telemetry internally, the same name that is used
 # in the main pings payload, i.e. "payload/processes/<process name>". See:
 # https://gecko.readthedocs.io/en/latest/toolkit/components/telemetry/telemetry/data/main-ping.html#processes
 #
 # For now this is only used to inform the data pipeline about new processes, but will be used to
 # generate headers with C++ data later (enums, strings, ...).
 parent:
-  gecko_enum: GeckoProcessType_Default
   description: This is the main process. It is also known as the parent or chrome process.
 content:
-  gecko_enum: GeckoProcessType_Content
   description: This is for processes web content is rendered in.
 extension:
-  gecko_enum: GeckoProcessType_Content
   description: >
     This is the WebExtension process. It is a re-used content process, with the data submitted
     separately to avoid skewing other content process Telemetry.
 gpu:
-  gecko_enum: GeckoProcessType_GPU
   description: This is the compositor or GPU process.
deleted file mode 100644
--- a/toolkit/components/telemetry/gen-process-data.py
+++ /dev/null
@@ -1,72 +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/.
-
-# Write out processes data for C++. The processes are defined
-# in a file provided as a command-line argument.
-
-from __future__ import print_function
-from shared_telemetry_utils import ParserError, load_processes
-
-import sys
-import collections
-
-# The banner/text at the top of the generated file.
-banner = """/* This file is auto-generated from Telemetry build scripts,
-   see gen-processes-data.py. */
-"""
-
-file_header = """\
-#ifndef mozilla_TelemetryProcessData_h
-#define mozilla_TelemetryProcessData_h
-
-#include "mozilla/TelemetryProcessEnums.h"
-
-namespace mozilla {
-namespace Telemetry {
-"""
-
-file_footer = """
-} // namespace Telemetry
-} // namespace mozilla
-#endif // mozilla_TelemetryProcessData_h"""
-
-
-def to_enum_label(name):
-    return name.title().replace('_', '')
-
-
-def write_processes_data(processes, output):
-    def p(line):
-        print(line, file=output)
-    processes = collections.OrderedDict(processes)
-
-    p("static GeckoProcessType ProcessIDToGeckoProcessType[%d] = {" % len(processes))
-    for i, (name, value) in enumerate(processes.iteritems()):
-        p("  /* %d: ProcessID::%s = */ %s," % (i, to_enum_label(name), value['gecko_enum']))
-    p("};")
-    p("")
-    p("static const char* const ProcessIDToString[%d] = {" % len(processes))
-    for i, (name, value) in enumerate(processes.iteritems()):
-        p("  /* %d: ProcessID::%s = */ \"%s\"," % (i, to_enum_label(name), name))
-    p("};")
-
-
-def main(output, *filenames):
-    if len(filenames) > 1:
-        raise Exception('We don\'t support loading from more than one file.')
-
-    try:
-        processes = load_yaml_file(filenames[0])
-
-        # Write the process data file.
-        print(banner, file=output)
-        print(file_header, file=output)
-        write_processes_data(processes, output)
-        print(file_footer, file=output)
-    except ParserError as ex:
-        print("\nError generating processes data:\n" + str(ex) + "\n")
-        sys.exit(1)
-
-if __name__ == '__main__':
-    main(sys.stdout, *sys.argv[1:])
deleted file mode 100644
--- a/toolkit/components/telemetry/gen-process-enum.py
+++ /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/.
-
-# Write out processes data for C++. The processes are defined
-# in a file provided as a command-line argument.
-
-from __future__ import print_function
-from shared_telemetry_utils import ParserError, load_processes
-
-import sys
-import collections
-
-# The banner/text at the top of the generated file.
-banner = """/* This file is auto-generated from Telemetry build scripts,
-   see gen-processes-enum.py. */
-"""
-
-file_header = """\
-#ifndef mozilla_TelemetryProcessEnums_h
-#define mozilla_TelemetryProcessEnums_h
-
-namespace mozilla {
-namespace Telemetry {
-"""
-
-file_footer = """
-} // namespace Telemetry
-} // namespace mozilla
-#endif // mozilla_TelemetryProcessEnums_h"""
-
-
-def to_enum_label(name):
-    return name.title().replace('_', '')
-
-
-def write_processes_enum(processes, output):
-    def p(line):
-        print(line, file=output)
-    processes = collections.OrderedDict(processes)
-
-    p("enum class ProcessID : uint32_t {")
-    for i, (name, _) in enumerate(processes.iteritems()):
-        p("  %s = %d," % (to_enum_label(name), i))
-    p("  Count = %d" % len(processes))
-    p("};")
-
-
-def main(output, *filenames):
-    if len(filenames) > 1:
-        raise Exception('We don\'t support loading from more than one file.')
-
-    try:
-        processes = load_yaml_file(filenames[0])
-
-        # Write the process data file.
-        print(banner, file=output)
-        print(file_header, file=output)
-        write_processes_enum(processes, output)
-        print(file_footer, file=output)
-    except ParserError as ex:
-        print("\nError generating processes enums:\n" + str(ex) + "\n")
-        sys.exit(1)
-
-if __name__ == '__main__':
-    main(sys.stdout, *sys.argv[1:])
--- a/toolkit/components/telemetry/moz.build
+++ b/toolkit/components/telemetry/moz.build
@@ -38,17 +38,16 @@ XPIDL_SOURCES += [
     'nsITelemetry.idl',
 ]
 
 XPIDL_MODULE = 'telemetry'
 
 EXPORTS.mozilla += [
     '!TelemetryEventEnums.h',
     '!TelemetryHistogramEnums.h',
-    '!TelemetryProcessEnums.h',
     '!TelemetryScalarEnums.h',
     'ipc/TelemetryComms.h',
     'ipc/TelemetryIPC.h',
     'ProcessedStack.h',
     'Telemetry.h',
     'ThreadHangStats.h',
 ]
 
@@ -90,18 +89,16 @@ TESTING_JS_MODULES += [
   'tests/unit/TelemetryArchiveTesting.jsm',
 ]
 
 GENERATED_FILES = [
     'TelemetryEventData.h',
     'TelemetryEventEnums.h',
     'TelemetryHistogramData.inc',
     'TelemetryHistogramEnums.h',
-    'TelemetryProcessData.h',
-    'TelemetryProcessEnums.h',
     'TelemetryScalarData.h',
     'TelemetryScalarEnums.h',
 ]
 
 # Generate histogram files.
 histogram_files = [
     'Histograms.json',
     '/dom/base/UseCounters.conf',
@@ -137,23 +134,10 @@ event_files = [
 event_data = GENERATED_FILES['TelemetryEventData.h']
 event_data.script = 'gen-event-data.py'
 event_data.inputs = event_files
 
 event_enums = GENERATED_FILES['TelemetryEventEnums.h']
 event_enums.script = 'gen-event-enum.py'
 event_enums.inputs = event_files
 
-# Generate data from Processes.yaml
-processes_files = [
-    'Processes.yaml',
-]
-
-processes_enum = GENERATED_FILES['TelemetryProcessEnums.h']
-processes_enum.script = 'gen-process-enum.py'
-processes_enum.inputs = processes_files
-
-processes_data = GENERATED_FILES['TelemetryProcessData.h']
-processes_data.script = 'gen-process-data.py'
-processes_data.inputs = processes_files
-
 with Files('**'):
     BUG_COMPONENT = ('Toolkit', 'Telemetry')
--- a/toolkit/components/telemetry/shared_telemetry_utils.py
+++ b/toolkit/components/telemetry/shared_telemetry_utils.py
@@ -3,17 +3,16 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 # This file contains utility functions shared by the scalars and the histogram generation
 # scripts.
 
 from __future__ import print_function
 
 import re
-import yaml
 
 # This is a list of flags that determine which process a measurement is allowed
 # to record from.
 KNOWN_PROCESS_FLAGS = {
     'all': 'All',
     'all_childs': 'AllChilds',
     'main': 'Main',
     'content': 'Content',
@@ -126,20 +125,8 @@ def add_expiration_postfix(expiration):
     """
     if re.match(r'^[1-9][0-9]*$', expiration):
         return expiration + ".0a1"
 
     if re.match(r'^[1-9][0-9]*\.0$', expiration):
         return expiration + "a1"
 
     return expiration
-
-
-def load_yaml_file(filename):
-    """ Load a YAML file from disk, throw a ParserError on failure."""
-    try:
-        with open(filename, 'r') as f:
-            return yaml.safe_load(f)
-    except IOError, e:
-        raise ParserError('Error opening ' + filename + ': ' + e.message)
-    except ValueError, e:
-        raise ParserError('Error parsing processes in {}: {}'
-                          .format(filename, e.message))