Skip to content

Commit a568e7e

Browse files
committed
Add #[inline] annotations
1 parent 5bb96ed commit a568e7e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/librustc/util/profiling.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,20 +169,23 @@ impl SelfProfiler {
169169
profiler
170170
}
171171

172+
#[inline]
172173
pub fn start_activity(&mut self, category: ProfileCategory) {
173174
self.record(ProfilerEvent::GenericActivityStart {
174175
category,
175176
time: Instant::now(),
176177
})
177178
}
178179

180+
#[inline]
179181
pub fn end_activity(&mut self, category: ProfileCategory) {
180182
self.record(ProfilerEvent::GenericActivityEnd {
181183
category,
182184
time: Instant::now(),
183185
})
184186
}
185187

188+
#[inline]
186189
pub fn record_computed_queries(
187190
&mut self,
188191
query_name: &'static str,
@@ -196,13 +199,15 @@ impl SelfProfiler {
196199
})
197200
}
198201

202+
#[inline]
199203
pub fn record_query_hit(&mut self, query_name: &'static str, category: ProfileCategory) {
200204
self.record(ProfilerEvent::QueryCacheHit {
201205
query_name,
202206
category,
203207
})
204208
}
205209

210+
#[inline]
206211
pub fn start_query(&mut self, query_name: &'static str, category: ProfileCategory) {
207212
self.record(ProfilerEvent::QueryStart {
208213
query_name,
@@ -211,6 +216,7 @@ impl SelfProfiler {
211216
});
212217
}
213218

219+
#[inline]
214220
pub fn end_query(&mut self, query_name: &'static str, category: ProfileCategory) {
215221
self.record(ProfilerEvent::QueryEnd {
216222
query_name,
@@ -219,6 +225,7 @@ impl SelfProfiler {
219225
})
220226
}
221227

228+
#[inline]
222229
fn record(&mut self, event: ProfilerEvent) {
223230
let thread_id = std::thread::current().id();
224231
let events = self.events.entry(thread_id).or_default();

0 commit comments

Comments
 (0)