mirror of
https://github.com/servo/servo.git
synced 2025-08-11 08:25:32 +01:00
format components/profile - #21373
This commit is contained in:
parent
9c1c58a498
commit
72748de721
4 changed files with 276 additions and 189 deletions
|
@ -38,7 +38,8 @@ impl TraceDump {
|
|||
/// Create a new TraceDump and write the prologue of the HTML file out to
|
||||
/// disk.
|
||||
pub fn new<P>(trace_file_path: P) -> io::Result<TraceDump>
|
||||
where P: AsRef<path::Path>
|
||||
where
|
||||
P: AsRef<path::Path>,
|
||||
{
|
||||
let mut file = fs::File::create(trace_file_path)?;
|
||||
write_prologue(&mut file)?;
|
||||
|
@ -46,10 +47,12 @@ impl TraceDump {
|
|||
}
|
||||
|
||||
/// Write one trace to the trace dump file.
|
||||
pub fn write_one(&mut self,
|
||||
category: &(ProfilerCategory, Option<TimerMetadata>),
|
||||
time: (u64, u64),
|
||||
energy: (u64, u64)) {
|
||||
pub fn write_one(
|
||||
&mut self,
|
||||
category: &(ProfilerCategory, Option<TimerMetadata>),
|
||||
time: (u64, u64),
|
||||
energy: (u64, u64),
|
||||
) {
|
||||
let entry = TraceEntry {
|
||||
category: category.0,
|
||||
metadata: category.1.clone(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue