Skip to content

Commit ed0e11a

Browse files
authored
Rollup merge of #68278 - wesleywiser:doc_query_key_recording, r=michaelwoerister
[self-profiler] Add example to `-Z help` to turn on query key recording Also add the `default` option so that it's easy to add query key recording to the default. r? @michaelwoerister
2 parents 8c016c3 + b1d0c11 commit ed0e11a

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/librustc_data_structures/profiling.rs

+2
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,11 @@ bitflags::bitflags! {
136136
}
137137
}
138138

139+
// keep this in sync with the `-Z self-profile-events` help message in librustc_session/options.rs
139140
const EVENT_FILTERS_BY_NAME: &[(&str, EventFilter)] = &[
140141
("none", EventFilter::NONE),
141142
("all", EventFilter::ALL),
143+
("default", EventFilter::DEFAULT),
142144
("generic-activity", EventFilter::GENERIC_ACTIVITIES),
143145
("query-provider", EventFilter::QUERY_PROVIDERS),
144146
("query-cache-hit", EventFilter::QUERY_CACHE_HITS),

src/librustc_session/options.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -923,8 +923,12 @@ options! {DebuggingOptions, DebuggingSetter, basic_debugging_options,
923923
self_profile: SwitchWithOptPath = (SwitchWithOptPath::Disabled,
924924
parse_switch_with_opt_path, [UNTRACKED],
925925
"run the self profiler and output the raw event data"),
926+
// keep this in sync with the event filter names in librustc_data_structures/profiling.rs
926927
self_profile_events: Option<Vec<String>> = (None, parse_opt_comma_list, [UNTRACKED],
927-
"specifies which kinds of events get recorded by the self profiler"),
928+
"specifies which kinds of events get recorded by the self profiler;
929+
for example: `-Z self-profile-events=default,query-keys`
930+
all options: none, all, default, generic-activity, query-provider, query-cache-hit
931+
query-blocked, incr-cache-load, query-keys"),
928932
emit_stack_sizes: bool = (false, parse_bool, [UNTRACKED],
929933
"emits a section containing stack size metadata"),
930934
plt: Option<bool> = (None, parse_opt_bool, [TRACKED],

0 commit comments

Comments
 (0)