about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/librustc/util/common.rs7
-rw-r--r--src/librustc_driver/profile/trace.rs30
2 files changed, 24 insertions, 13 deletions
diff --git a/src/librustc/util/common.rs b/src/librustc/util/common.rs
index bce2a66a308..b8972a61568 100644
--- a/src/librustc/util/common.rs
+++ b/src/librustc/util/common.rs
@@ -75,7 +75,12 @@ pub fn profq_msg(msg: ProfileQueriesMsg) {
         if let Some(s) = sender.borrow().as_ref() {
             s.send(msg).unwrap()
         } else {
-            panic!("no channel on which to send profq_msg: {:?}", msg)
+            // Do nothing.
+            //
+            // FIXME(matthewhammer): Multi-threaded translation phase triggers the panic below.
+            // From backtrace: rustc_trans::back::write::spawn_work::{{closure}}.
+            //
+            // panic!("no channel on which to send profq_msg: {:?}", msg)
         }
     })
 }
diff --git a/src/librustc_driver/profile/trace.rs b/src/librustc_driver/profile/trace.rs
index 8db3a3e2dfa..e75e40b22b4 100644
--- a/src/librustc_driver/profile/trace.rs
+++ b/src/librustc_driver/profile/trace.rs
@@ -137,9 +137,15 @@ fn write_traces_rec(file: &mut File, traces: &Vec<Rec>, total: Duration, depth:
 fn compute_counts_rec(counts: &mut HashMap<String,QueryMetric>, traces: &Vec<Rec>) {
     for t in traces.iter() {
         match t.effect {
-            Effect::TimeBegin(ref _msg) => {
-                // dont count time-begin effects
-            }
+            Effect::TimeBegin(ref msg) => {
+                let qm = match counts.get(msg) {
+                    Some(_qm) => { panic!("TimeBegin with non-unique, repeat message") }
+                    None => QueryMetric{
+                        count: 1,
+                        duration: t.duration
+                    }};
+                counts.insert(msg.clone(), qm);
+            },
             Effect::QueryBegin(ref qmsg, ref _cc) => {
                 let qcons = cons_of_query_msg(qmsg);
                 let qm = match counts.get(&qcons) {
@@ -239,29 +245,29 @@ body {
   display: none
 }
 .frac-50 {
-  padding: 4px;
+  padding: 10px;
   border-width: 10px;
-  font-size: 16px;
+  font-size: 32px;
 }
 .frac-40 {
-  padding: 4px;
+  padding: 8px;
   border-width: 8px;
-  font-size: 16px;
+  font-size: 24px;
 }
 .frac-30 {
-  padding: 3px;
+  padding: 6px;
   border-width: 6px;
-  font-size: 16px;
+  font-size: 18px;
 }
 .frac-20 {
-  padding: 3px;
+  padding: 4px;
   border-width: 6px;
   font-size: 16px;
 }
 .frac-10 {
-  padding: 3px;
+  padding: 2px;
   border-width: 6px;
-  font-size: 16px;
+  font-size: 14px;
 }
 ").unwrap();
 }