Bug 1776721 - Improve a few comments around the category generating script r=canaltinova

Differential Revision: https://phabricator.services.mozilla.com/D150613
This commit is contained in:
Julien Wajsberg 2022-07-06 16:52:17 +00:00
Родитель bd1610b4c3
Коммит af7ecd3fc8
2 изменённых файлов: 12 добавлений и 13 удалений

Просмотреть файл

@ -2,8 +2,8 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this # 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/. # file, You can obtain one at http://mozilla.org/MPL/2.0/.
# This script generates jit/MIROpsGenerated.h (list of MIR instructions) # This script generates ProfilingCategoryList.h and profiling_categories.rs
# from MIROps.yaml, as well as MIR op definitions. # files from profiling_categories.yaml.
import yaml import yaml
from collections import OrderedDict from collections import OrderedDict
@ -16,7 +16,8 @@ CPP_HEADER_TEMPLATE = """\
#ifndef {includeguard} #ifndef {includeguard}
#define {includeguard} #define {includeguard}
/* This file is generated by generate_profiling_categories.py. DO NOT EDIT! */ /* This file is generated by generate_profiling_categories.py from
profiling_categories.yaml. DO NOT EDIT! */
// Profiler sub-categories are applied to each sampled stack to describe the // Profiler sub-categories are applied to each sampled stack to describe the
// type of workload that the CPU is busy with. Only one sub-category can be // type of workload that the CPU is busy with. Only one sub-category can be
@ -54,7 +55,8 @@ RUST_TEMPLATE = """\
* License, v. 2.0. If a copy of the MPL was not distributed with this * 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/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/* This file is generated by generate_profiling_categories.py. DO NOT EDIT! */ /* This file is generated by generate_profiling_categories.py from
profiling_categories.yaml. DO NOT EDIT! */
{contents}\ {contents}\
""" """

Просмотреть файл

@ -27,9 +27,9 @@
# Label of the profiling category. This a more human readable string for the # Label of the profiling category. This a more human readable string for the
# category. Label will be displayed in the Firefox Profiler front-end. But also # category. Label will be displayed in the Firefox Profiler front-end. But also
# this will be used as a Rust enum field (with non-alphanumeric characters # this will be used as a Rust enum field (with non-alphanumeric characters
# removed) because it's more suitable for Rust enums since name field is a snake # removed) because it's more idiomatic for Rust enums than name fields (which
# cased field with all caps. This is not idiomatic to rust enum field. On the # are snake cased fields with all caps, which is not idiomatic to rust enum
# other hand, this field produces idiomatic fields. # field).
# #
# color [required] # color [required]
# ===== # =====
@ -56,10 +56,7 @@
# sub-category) or should start with parent category name + underscore # sub-category) or should start with parent category name + underscore
# (e.g. JS_Parsing). # (e.g. JS_Parsing).
# #
# label attribute is the same as parent category label attribute. Except that # label attribute has the same purpose as parent category label attribute.
# this field is only used by the default sub-category. This is because the name
# of the default sub-category is the same with parent category. label field
# ensures that they are different.
# #
# For example: # For example:
# - name: JS # - name: JS
@ -70,8 +67,8 @@
# label: Parsing # label: Parsing
# #
# Note that the first sub-category has the same name with the category. This is # Note that the first sub-category has the same name with the category. This is
# the default category. Also note the other categories starting with the category # the default sub-category. Also note the other sub-categories starting with the
# name + underscore. # category name + underscore.
# #
- name: IDLE - name: IDLE