Skip to content

Remove verbose_generic_activity_with_arg #115736

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Sep 13, 2023
Merged
Changes from 1 commit
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
Prev Previous commit
Bring back verbose_generic_activity_with_arg
  • Loading branch information
Zoxc committed Sep 13, 2023
commit c64e15e817abbe4a2be0143a10c7c4334fa3bdd8
19 changes: 19 additions & 0 deletions compiler/rustc_data_structures/src/profiling.rs
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,25 @@ impl SelfProfilerRef {
VerboseTimingGuard::start(message_and_format, self.generic_activity(event_label))
}

/// Like `verbose_generic_activity`, but with an extra arg.
pub fn verbose_generic_activity_with_arg<A>(
&self,
event_label: &'static str,
event_arg: A,
) -> VerboseTimingGuard<'_>
where
A: Borrow<str> + Into<String>,
{
let message_and_format = self
.print_verbose_generic_activities
.map(|format| (format!("{}({})", event_label, event_arg.borrow()), format));

VerboseTimingGuard::start(
message_and_format,
self.generic_activity_with_arg(event_label, event_arg),
)
}

/// Start profiling a generic activity. Profiling continues until the
/// TimingGuard returned from this call is dropped.
#[inline(always)]
Expand Down