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

@ -12,6 +12,7 @@ dependencies = [
"msg 0.0.1",
"net 0.0.1",
"png 0.1.0 (git+https://github.com/servo/rust-png)",
"profile 0.0.1",
"script 0.0.1",
"time 0.1.19 (registry+https://github.com/rust-lang/crates.io-index)",
"url 0.2.23 (registry+https://github.com/rust-lang/crates.io-index)",
@ -93,6 +94,7 @@ dependencies = [
"msg 0.0.1",
"net 0.0.1",
"png 0.1.0 (git+https://github.com/servo/rust-png)",
"profile 0.0.1",
"script_traits 0.0.1",
"time 0.1.19 (registry+https://github.com/rust-lang/crates.io-index)",
"url 0.2.23 (registry+https://github.com/rust-lang/crates.io-index)",
@ -308,6 +310,7 @@ dependencies = [
"net 0.0.1",
"plugins 0.0.1",
"png 0.1.0 (git+https://github.com/servo/rust-png)",
"profile 0.0.1",
"rustc-serialize 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
"script_traits 0.0.1",
"skia 0.0.20130412 (git+https://github.com/servo/skia?branch=upstream-2014-06-16)",
@ -510,6 +513,7 @@ dependencies = [
"net 0.0.1",
"plugins 0.0.1",
"png 0.1.0 (git+https://github.com/servo/rust-png)",
"profile 0.0.1",
"rustc-serialize 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
"script 0.0.1",
"script_traits 0.0.1",
@ -528,6 +532,7 @@ dependencies = [
"gfx 0.0.1",
"msg 0.0.1",
"net 0.0.1",
"profile 0.0.1",
"script_traits 0.0.1",
"url 0.2.23 (registry+https://github.com/rust-lang/crates.io-index)",
"util 0.0.1",
@ -609,6 +614,7 @@ dependencies = [
"hyper 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"openssl 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
"png 0.1.0 (git+https://github.com/servo/rust-png)",
"profile 0.0.1",
"regex 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)",
"regex_macros 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
@ -697,6 +703,18 @@ name = "png-sys"
version = "1.6.16"
source = "git+https://github.com/servo/rust-png#1d9c59c97598014860077f372443ae98b35ff4d9"
[[package]]
name = "profile"
version = "0.0.1"
dependencies = [
"libc 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"regex 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)",
"task_info 0.0.1",
"time 0.1.19 (registry+https://github.com/rust-lang/crates.io-index)",
"url 0.2.23 (registry+https://github.com/rust-lang/crates.io-index)",
"util 0.0.1",
]
[[package]]
name = "rand"
version = "0.1.4"
@ -742,6 +760,7 @@ dependencies = [
"msg 0.0.1",
"net 0.0.1",
"plugins 0.0.1",
"profile 0.0.1",
"rustc-serialize 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
"script_traits 0.0.1",
"selectors 0.1.0 (git+https://github.com/servo/rust-selectors)",
@ -887,15 +906,12 @@ dependencies = [
"libc 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"plugins 0.0.1",
"rand 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"regex 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
"selectors 0.1.0 (git+https://github.com/servo/rust-selectors)",
"string_cache 0.0.0 (git+https://github.com/servo/string-cache)",
"string_cache_plugin 0.0.0 (git+https://github.com/servo/string-cache)",
"task_info 0.0.1",
"text_writer 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)",
"time 0.1.19 (registry+https://github.com/rust-lang/crates.io-index)",
"url 0.2.23 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]

View file

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

View file

@ -11,6 +11,7 @@ extern crate compositing;
extern crate devtools;
extern crate net;
extern crate msg;
extern crate profile;
#[macro_use]
extern crate util;
extern crate script;
@ -40,9 +41,9 @@ use net::storage_task::{StorageTaskFactory, StorageTask};
#[cfg(not(test))]
use gfx::font_cache_task::FontCacheTask;
#[cfg(not(test))]
use util::time::TimeProfiler;
use profile::mem::MemoryProfiler;
#[cfg(not(test))]
use util::memory::MemoryProfiler;
use profile::time::TimeProfiler;
#[cfg(not(test))]
use util::opts;
#[cfg(not(test))]