@@ -19,6 +19,7 @@ use itertools::Itertools;
1919use rayon:: iter:: IntoParallelIterator ;
2020use rayon:: iter:: ParallelIterator ;
2121use std:: collections:: HashMap ;
22+ use std:: sync:: atomic:: { AtomicUsize , Ordering } ;
2223use std:: time:: Instant ;
2324use warp:: r#type:: class:: function:: { Location , RegisterLocation , StackLocation } ;
2425use warp:: signature:: function:: { Function , FunctionGUID } ;
@@ -134,6 +135,7 @@ pub fn run_matcher(view: &BinaryView) {
134135
135136 // TODO: Target gets cloned a lot.
136137 // TODO: Containers might both match on the same function. What should we do?
138+ let matched_count = AtomicUsize :: new ( 0 ) ;
137139 for_cached_containers ( |container| {
138140 if background_task. is_cancelled ( ) {
139141 return ;
@@ -180,6 +182,7 @@ pub fn run_matcher(view: &BinaryView) {
180182 if let Some ( matched_function) =
181183 matcher. match_function_from_constraints ( function, & matched_functions)
182184 {
185+ matched_count. fetch_add ( 1 , Ordering :: Relaxed ) ;
183186 // We were able to find a match, add it to the match cache and then mark the function
184187 // as requiring updates; this is so that we know about it in the applier activity.
185188 insert_cached_function_match ( function, Some ( matched_function. clone ( ) ) ) ;
@@ -193,7 +196,11 @@ pub fn run_matcher(view: &BinaryView) {
193196 log:: info!( "Matcher was cancelled by user, you may run it again by running the 'Run Matcher' command." ) ;
194197 }
195198
196- log:: info!( "Function matching took {:?}" , start. elapsed( ) ) ;
199+ log:: info!(
200+ "Function matching took {:.3} seconds and matched {} functions" ,
201+ start. elapsed( ) . as_secs_f64( ) ,
202+ matched_count. load( Ordering :: Relaxed )
203+ ) ;
197204 background_task. finish ( ) ;
198205
199206 // Now we want to trigger re-analysis.
0 commit comments