mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Rename trace-whitelist to trace-allowlist (flutter/engine#19047)
This commit is contained in:
parent
933c8e435a
commit
e6d2948d07
@ -92,7 +92,7 @@ struct Settings {
|
||||
bool enable_checked_mode = false;
|
||||
bool start_paused = false;
|
||||
bool trace_skia = false;
|
||||
std::string trace_whitelist;
|
||||
std::string trace_allowlist;
|
||||
bool trace_startup = false;
|
||||
bool trace_systrace = false;
|
||||
bool dump_skp_on_shader_compilation = false;
|
||||
|
||||
@ -18,7 +18,7 @@ namespace tracing {
|
||||
#if FLUTTER_TIMELINE_ENABLED
|
||||
|
||||
namespace {
|
||||
AsciiTrie gWhitelist;
|
||||
AsciiTrie gAllowlist;
|
||||
|
||||
inline void FlutterTimelineEvent(const char* label,
|
||||
int64_t timestamp0,
|
||||
@ -27,15 +27,15 @@ inline void FlutterTimelineEvent(const char* label,
|
||||
intptr_t argument_count,
|
||||
const char** argument_names,
|
||||
const char** argument_values) {
|
||||
if (gWhitelist.Query(label)) {
|
||||
if (gAllowlist.Query(label)) {
|
||||
Dart_TimelineEvent(label, timestamp0, timestamp1_or_async_id, type,
|
||||
argument_count, argument_names, argument_values);
|
||||
}
|
||||
}
|
||||
} // namespace
|
||||
|
||||
void TraceSetWhitelist(const std::vector<std::string>& whitelist) {
|
||||
gWhitelist.Fill(whitelist);
|
||||
void TraceSetAllowlist(const std::vector<std::string>& allowlist) {
|
||||
gAllowlist.Fill(allowlist);
|
||||
}
|
||||
|
||||
size_t TraceNonce() {
|
||||
@ -286,7 +286,7 @@ void TraceEventFlowEnd0(TraceArg category_group, TraceArg name, TraceIDArg id) {
|
||||
|
||||
#else // FLUTTER_TIMELINE_ENABLED
|
||||
|
||||
void TraceSetWhitelist(const std::vector<std::string>& whitelist) {}
|
||||
void TraceSetAllowlist(const std::vector<std::string>& allowlist) {}
|
||||
|
||||
size_t TraceNonce() {
|
||||
return 0;
|
||||
|
||||
@ -130,7 +130,7 @@ namespace tracing {
|
||||
using TraceArg = const char*;
|
||||
using TraceIDArg = int64_t;
|
||||
|
||||
void TraceSetWhitelist(const std::vector<std::string>& whitelist);
|
||||
void TraceSetAllowlist(const std::vector<std::string>& allowlist);
|
||||
|
||||
void TraceTimelineEvent(TraceArg category_group,
|
||||
TraceArg name,
|
||||
|
||||
@ -212,10 +212,10 @@ static void PerformInitializationTasks(Settings& settings) {
|
||||
InitSkiaEventTracer(settings.trace_skia);
|
||||
}
|
||||
|
||||
if (!settings.trace_whitelist.empty()) {
|
||||
if (!settings.trace_allowlist.empty()) {
|
||||
std::vector<std::string> prefixes;
|
||||
Tokenize(settings.trace_whitelist, &prefixes, ',');
|
||||
fml::tracing::TraceSetWhitelist(prefixes);
|
||||
Tokenize(settings.trace_allowlist, &prefixes, ',');
|
||||
fml::tracing::TraceSetAllowlist(prefixes);
|
||||
}
|
||||
|
||||
if (!settings.skia_deterministic_rendering_on_cpu) {
|
||||
|
||||
@ -275,8 +275,17 @@ Settings SettingsFromCommandLine(const fml::CommandLine& command_line) {
|
||||
settings.trace_skia =
|
||||
command_line.HasOption(FlagForSwitch(Switch::TraceSkia));
|
||||
|
||||
command_line.GetOptionValue(FlagForSwitch(Switch::TraceWhitelist),
|
||||
&settings.trace_whitelist);
|
||||
command_line.GetOptionValue(FlagForSwitch(Switch::TraceAllowlist),
|
||||
&settings.trace_allowlist);
|
||||
|
||||
if (settings.trace_allowlist.empty()) {
|
||||
command_line.GetOptionValue(FlagForSwitch(Switch::TraceWhitelist),
|
||||
&settings.trace_allowlist);
|
||||
if (!settings.trace_allowlist.empty()) {
|
||||
FML_LOG(INFO)
|
||||
<< "--trace-whitelist is deprecated. Use --trace-allowlist instead.";
|
||||
}
|
||||
}
|
||||
|
||||
settings.trace_systrace =
|
||||
command_line.HasOption(FlagForSwitch(Switch::TraceSystrace));
|
||||
|
||||
@ -129,11 +129,14 @@ DEF_SWITCH(TraceSkia,
|
||||
"Trace Skia calls. This is useful when debugging the GPU threed."
|
||||
"By default, Skia tracing is not enabled to reduce the number of "
|
||||
"traced events")
|
||||
DEF_SWITCH(TraceWhitelist,
|
||||
"trace-whitelist",
|
||||
"(deprecated) Use --trace-allowlist instead.")
|
||||
DEF_SWITCH(
|
||||
TraceWhitelist,
|
||||
"trace-whitelist",
|
||||
TraceAllowlist,
|
||||
"trace-allowlist",
|
||||
"Filters out all trace events except those that are specified in this "
|
||||
"comma separated list of whitelisted prefixes.")
|
||||
"comma separated list of allowed prefixes.")
|
||||
DEF_SWITCH(DumpSkpOnShaderCompilation,
|
||||
"dump-skp-on-shader-compilation",
|
||||
"Automatically dump the skp that triggers new shader compilations. "
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user