Bug 1313326 - Part 2 - Restrict event recording to specified processes. r=dexter

This commit is contained in:
Georg Fritzsche
2017-03-06 16:12:49 +01:00
parent 3b75819ee9
commit d8b6b7d1e8
12 changed files with 201 additions and 59 deletions

View File

@@ -9,6 +9,24 @@ from __future__ import print_function
import re
# 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',
'gpu': 'Gpu',
}
PROCESS_ENUM_PREFIX = "mozilla::Telemetry::Common::RecordedProcessType::"
def is_valid_process_name(name):
return (name in KNOWN_PROCESS_FLAGS)
def process_name_to_enum(name):
return PROCESS_ENUM_PREFIX + KNOWN_PROCESS_FLAGS.get(name)
class StringTable:
"""Manages a string table and allows C style serialization to a file."""