File tree 2 files changed +19
-1
lines changed
2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -268,8 +268,15 @@ impl Frame {
268
268
}
269
269
}
270
270
271
- #[ cfg_attr( feature = "flame-it" , flame( "Frame" ) ) ]
271
+ // #[cfg_attr(feature = "flame-it", flame("Frame"))]
272
272
pub fn run ( & self , vm : & VirtualMachine ) -> Result < ExecutionResult , PyObjectRef > {
273
+ flame_guard ! ( format!( "Frame::run({})" , self . code. obj_name) ) ;
274
+ // flame doesn't include notes in the html graph :(
275
+ flame_note ! (
276
+ flame:: StrCow :: from( "CodeObj name" ) ,
277
+ self . code. obj_name. clone( ) . into( )
278
+ ) ;
279
+
273
280
let filename = & self . code . source_path . to_string ( ) ;
274
281
275
282
// This is the name of the object being run:
Original file line number Diff line number Diff line change @@ -273,3 +273,14 @@ macro_rules! flame_guard {
273
273
let _guard = :: flame:: start_guard( $name) ;
274
274
} ;
275
275
}
276
+
277
+ macro_rules! flame_note {
278
+ ( $name: expr, $desc: expr$( , ) ?) => {
279
+ #[ cfg( feature = "flame-it" ) ]
280
+ :: flame:: note( $name, :: std:: option:: Option :: Some ( $desc) ) ;
281
+ } ;
282
+ ( $name: expr$( , ) ?) => {
283
+ #[ cfg( feature = "flame-it" ) ]
284
+ :: flame:: note( $name, :: std:: option:: Option :: None ) ;
285
+ } ;
286
+ }
You can’t perform that action at this time.
0 commit comments