Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion common/settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
10 changes: 5 additions & 5 deletions fml/trace_event.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ namespace tracing {
#if FLUTTER_TIMELINE_ENABLED

namespace {
AsciiTrie gWhitelist;
AsciiTrie gAllowlist;

inline void FlutterTimelineEvent(const char* label,
int64_t timestamp0,
Expand All @@ -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() {
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion fml/trace_event.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
6 changes: 3 additions & 3 deletions shell/common/shell.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
13 changes: 11 additions & 2 deletions shell/common/switches.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
9 changes: 6 additions & 3 deletions shell/common/switches.h
Original file line number Diff line number Diff line change
Expand Up @@ -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. "
Expand Down