Move profiler code from util into a new crate profile.

- Most of util::memory has been moved into profile::mem, though the
  `SizeOf` trait and related things remain in util::memory. The
  `SystemMemoryReporter` code is now in a submodule
  profile::mem::system_reporter.

- util::time has been moved entirely into profile::time.
This commit is contained in:
Nicholas Nethercote 2015-03-23 16:48:54 -07:00
parent cad58b3bec
commit 52447ccd9b
36 changed files with 850 additions and 726 deletions

View file

@ -37,6 +37,9 @@ path = "../plugins"
[dependencies.net]
path = "../net"
[dependencies.profile]
path = "../profile"
[dependencies.util]
path = "../util"

View file

@ -43,6 +43,9 @@ use msg::constellation_msg::{ConstellationChan, Failure, PipelineExitType, Pipel
use net::image_cache_task::{ImageCacheTask, ImageResponseMsg};
use net::local_image_cache::{ImageResponder, LocalImageCache};
use net::resource_task::{ResourceTask, load_bytes_iter};
use profile::mem::{MemoryProfilerChan, MemoryProfilerMsg, MemoryReport, MemoryReportsChan};
use profile::time::{TimeProfilerCategory, ProfilerMetadata, TimeProfilerChan};
use profile::time::{TimerMetadataFrameType, TimerMetadataReflowType, profile};
use script::dom::bindings::js::LayoutJS;
use script::dom::element::ElementTypeId;
use script::dom::htmlelement::HTMLElementTypeId;
@ -70,14 +73,11 @@ use url::Url;
use util::cursor::Cursor;
use util::geometry::Au;
use util::logical_geometry::LogicalPoint;
use util::memory::{MemoryProfilerChan, MemoryProfilerMsg, MemoryReport, MemoryReportsChan};
use util::memory::{SizeOf};
use util::opts;
use util::smallvec::{SmallVec, SmallVec1, VecLike};
use util::task::spawn_named_with_send_on_failure;
use util::task_state;
use util::time::{TimeProfilerCategory, ProfilerMetadata, TimeProfilerChan};
use util::time::{TimerMetadataFrameType, TimerMetadataReflowType, profile};
use util::workqueue::WorkQueue;
/// Mutable data belonging to the LayoutTask.

View file

@ -43,6 +43,8 @@ extern crate style;
extern crate "plugins" as servo_plugins;
extern crate net;
extern crate msg;
#[macro_use]
extern crate profile;
extern crate selectors;
#[macro_use]
extern crate util;

View file

@ -20,12 +20,12 @@ use wrapper::{layout_node_to_unsafe_layout_node, layout_node_from_unsafe_layout_
use wrapper::{PostorderNodeMutTraversal, UnsafeLayoutNode};
use wrapper::{PreorderDomTraversal, PostorderDomTraversal};
use util::opts;
use util::time::{TimeProfilerCategory, ProfilerMetadata, TimeProfilerChan, profile};
use util::workqueue::{WorkQueue, WorkUnit, WorkerProxy};
use profile::time::{TimeProfilerCategory, ProfilerMetadata, TimeProfilerChan, profile};
use std::mem;
use std::ptr;
use std::sync::atomic::{AtomicIsize, Ordering};
use util::opts;
use util::workqueue::{WorkQueue, WorkUnit, WorkerProxy};
#[allow(dead_code)]
fn static_assertion(node: UnsafeLayoutNode) {