File tree Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ atomic-traits = "0.2.0"
33
33
atomic = " 0.4.6"
34
34
spin = " 0.5.2"
35
35
env_logger = " 0.8.2"
36
+ pfm = " 0.0.3"
36
37
37
38
[dev-dependencies ]
38
39
crossbeam = " 0.7.3"
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ use std::collections::HashMap;
6
6
use std:: sync:: atomic:: { AtomicBool , AtomicUsize , Ordering } ;
7
7
use std:: sync:: Arc ;
8
8
use std:: sync:: Mutex ;
9
+ use pfm:: Perfmon ;
9
10
10
11
pub const MAX_PHASES : usize = 1 << 12 ;
11
12
pub const MAX_COUNTERS : usize = 100 ;
@@ -37,6 +38,7 @@ impl SharedStats {
37
38
pub struct Stats {
38
39
gc_count : AtomicUsize ,
39
40
total_time : Arc < Mutex < Timer > > ,
41
+ perfmon : Perfmon ,
40
42
41
43
pub shared : Arc < SharedStats > ,
42
44
counters : Mutex < Vec < Arc < Mutex < dyn Counter + Send > > > > ,
@@ -55,9 +57,12 @@ impl Stats {
55
57
true ,
56
58
false ,
57
59
) ) ) ;
60
+ let mut perfmon: Perfmon = Default :: default ( ) ;
61
+ perfmon. initialize ( ) . expect ( "Perfmon failed to initialize" ) ;
58
62
Stats {
59
63
gc_count : AtomicUsize :: new ( 0 ) ,
60
64
total_time : t. clone ( ) ,
65
+ perfmon,
61
66
62
67
shared,
63
68
counters : Mutex :: new ( vec ! [ t] ) ,
You can’t perform that action at this time.
0 commit comments