mirror of
https://github.com/servo/servo.git
synced 2025-09-30 08:39:16 +01:00
Add a sampling profiler and a script to generate profiles for use with Gecko tooling.
This commit is contained in:
parent
db7bb2a510
commit
90f67c11e5
13 changed files with 379 additions and 28 deletions
|
@ -124,7 +124,7 @@ use keyboard_types::webdriver::Event as WebDriverInputEvent;
|
|||
use keyboard_types::KeyboardEvent;
|
||||
use layout_traits::LayoutThreadFactory;
|
||||
use log::{Level, LevelFilter, Log, Metadata, Record};
|
||||
use msg::constellation_msg::{BackgroundHangMonitorRegister, HangAlert};
|
||||
use msg::constellation_msg::{BackgroundHangMonitorRegister, HangMonitorAlert};
|
||||
use msg::constellation_msg::{
|
||||
BrowsingContextId, HistoryStateId, PipelineId, TopLevelBrowsingContextId,
|
||||
};
|
||||
|
@ -210,11 +210,11 @@ pub struct Constellation<Message, LTF, STF> {
|
|||
|
||||
/// A channel for the background hang monitor to send messages
|
||||
/// to the constellation.
|
||||
background_hang_monitor_sender: IpcSender<HangAlert>,
|
||||
background_hang_monitor_sender: IpcSender<HangMonitorAlert>,
|
||||
|
||||
/// A channel for the constellation to receiver messages
|
||||
/// from the background hang monitor.
|
||||
background_hang_monitor_receiver: Receiver<Result<HangAlert, IpcError>>,
|
||||
background_hang_monitor_receiver: Receiver<Result<HangMonitorAlert, IpcError>>,
|
||||
|
||||
/// An IPC channel for layout threads to send messages to the constellation.
|
||||
/// This is the layout threads' view of `layout_receiver`.
|
||||
|
@ -942,7 +942,7 @@ where
|
|||
#[derive(Debug)]
|
||||
enum Request {
|
||||
Script((PipelineId, FromScriptMsg)),
|
||||
BackgroundHangMonitor(HangAlert),
|
||||
BackgroundHangMonitor(HangMonitorAlert),
|
||||
Compositor(FromCompositorMsg),
|
||||
Layout(FromLayoutMsg),
|
||||
NetworkListener((PipelineId, FetchResponseMsg)),
|
||||
|
@ -1008,10 +1008,17 @@ where
|
|||
}
|
||||
}
|
||||
|
||||
fn handle_request_from_background_hang_monitor(&self, message: HangAlert) {
|
||||
// TODO: In case of a permanent hang being reported, add a "kill script" workflow,
|
||||
// via the embedder?
|
||||
warn!("Component hang alert: {:?}", message);
|
||||
fn handle_request_from_background_hang_monitor(&self, message: HangMonitorAlert) {
|
||||
match message {
|
||||
HangMonitorAlert::Profile(bytes) => self
|
||||
.embedder_proxy
|
||||
.send((None, EmbedderMsg::ReportProfile(bytes))),
|
||||
HangMonitorAlert::Hang(hang) => {
|
||||
// TODO: In case of a permanent hang being reported, add a "kill script" workflow,
|
||||
// via the embedder?
|
||||
warn!("Component hang alert: {:?}", hang);
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
fn handle_request_from_network_listener(&mut self, message: (PipelineId, FetchResponseMsg)) {
|
||||
|
|
|
@ -18,7 +18,7 @@ use ipc_channel::Error;
|
|||
use layout_traits::LayoutThreadFactory;
|
||||
use metrics::PaintTimeMetrics;
|
||||
use msg::constellation_msg::TopLevelBrowsingContextId;
|
||||
use msg::constellation_msg::{BackgroundHangMonitorRegister, HangAlert};
|
||||
use msg::constellation_msg::{BackgroundHangMonitorRegister, HangMonitorAlert};
|
||||
use msg::constellation_msg::{BrowsingContextId, HistoryStateId, PipelineId, PipelineNamespaceId};
|
||||
use net::image_cache::ImageCacheImpl;
|
||||
use net_traits::image_cache::ImageCache;
|
||||
|
@ -122,7 +122,7 @@ pub struct InitialPipelineState {
|
|||
pub background_monitor_register: Option<Box<BackgroundHangMonitorRegister>>,
|
||||
|
||||
/// A channel for the background hang monitor to send messages to the constellation.
|
||||
pub background_hang_monitor_to_constellation_chan: IpcSender<HangAlert>,
|
||||
pub background_hang_monitor_to_constellation_chan: IpcSender<HangMonitorAlert>,
|
||||
|
||||
/// A channel for the layout thread to send messages to the constellation.
|
||||
pub layout_to_constellation_chan: IpcSender<LayoutMsg>,
|
||||
|
@ -467,7 +467,7 @@ pub struct UnprivilegedPipelineContent {
|
|||
parent_pipeline_id: Option<PipelineId>,
|
||||
opener: Option<BrowsingContextId>,
|
||||
script_to_constellation_chan: ScriptToConstellationChan,
|
||||
background_hang_monitor_to_constellation_chan: IpcSender<HangAlert>,
|
||||
background_hang_monitor_to_constellation_chan: IpcSender<HangMonitorAlert>,
|
||||
layout_to_constellation_chan: IpcSender<LayoutMsg>,
|
||||
scheduler_chan: IpcSender<TimerSchedulerMsg>,
|
||||
devtools_chan: Option<IpcSender<ScriptToDevtoolsControlMsg>>,
|
||||
|
@ -669,7 +669,7 @@ impl UnprivilegedPipelineContent {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn background_hang_monitor_to_constellation_chan(&self) -> &IpcSender<HangAlert> {
|
||||
pub fn background_hang_monitor_to_constellation_chan(&self) -> &IpcSender<HangMonitorAlert> {
|
||||
&self.background_hang_monitor_to_constellation_chan
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue