mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Remove support for energy profiling
This commit is contained in:
parent
d4f1f4641d
commit
0abe90647f
15 changed files with 8 additions and 215 deletions
|
@ -2,7 +2,6 @@
|
|||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use crate::energy::read_energy_uj;
|
||||
use ipc_channel::ipc::IpcSender;
|
||||
use servo_config::opts;
|
||||
use time::precise_time_ns;
|
||||
|
@ -34,11 +33,7 @@ pub enum ProfilerData {
|
|||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||
pub enum ProfilerMsg {
|
||||
/// Normal message used for reporting time
|
||||
Time(
|
||||
(ProfilerCategory, Option<TimerMetadata>),
|
||||
(u64, u64),
|
||||
(u64, u64),
|
||||
),
|
||||
Time((ProfilerCategory, Option<TimerMetadata>), (u64, u64)),
|
||||
/// Message used to get time spend entries for a particular ProfilerBuckets (in nanoseconds)
|
||||
Get(
|
||||
(ProfilerCategory, Option<TimerMetadata>),
|
||||
|
@ -142,26 +137,16 @@ where
|
|||
if opts::get().signpost {
|
||||
signpost::start(category as u32, &[0, 0, 0, (category as usize) >> 4]);
|
||||
}
|
||||
let start_energy = read_energy_uj();
|
||||
let start_time = precise_time_ns();
|
||||
|
||||
let val = callback();
|
||||
|
||||
let end_time = precise_time_ns();
|
||||
let end_energy = read_energy_uj();
|
||||
if opts::get().signpost {
|
||||
signpost::end(category as u32, &[0, 0, 0, (category as usize) >> 4]);
|
||||
}
|
||||
|
||||
send_profile_data(
|
||||
category,
|
||||
meta,
|
||||
&profiler_chan,
|
||||
start_time,
|
||||
end_time,
|
||||
start_energy,
|
||||
end_energy,
|
||||
);
|
||||
send_profile_data(category, meta, &profiler_chan, start_time, end_time);
|
||||
val
|
||||
}
|
||||
|
||||
|
@ -171,12 +156,6 @@ pub fn send_profile_data(
|
|||
profiler_chan: &ProfilerChan,
|
||||
start_time: u64,
|
||||
end_time: u64,
|
||||
start_energy: u64,
|
||||
end_energy: u64,
|
||||
) {
|
||||
profiler_chan.send(ProfilerMsg::Time(
|
||||
(category, meta),
|
||||
(start_time, end_time),
|
||||
(start_energy, end_energy),
|
||||
));
|
||||
profiler_chan.send(ProfilerMsg::Time((category, meta), (start_time, end_time)));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue