@@ -237,6 +237,7 @@ def metrics_to_string(
237237 self ,
238238 shownocallees : bool = False ,
239239 space : str = " " ,
240+ hide : List [str ] = [],
240241 tags : List [str ] = [],
241242 taglen : int = 0 ) -> str :
242243 callcount = ''
@@ -251,13 +252,25 @@ def metrics_to_string(
251252 if self .unresolved_call_count > 0 :
252253 unrc = str (self .unresolved_call_count )
253254 if len (tags ) > 0 :
254- ftags = (" [" + "," .join (tags ) + "]" ).ljust (taglen )
255-
256- return (str (self .faddr ).ljust (10 ) + space
257- + '{:6.1f}' .format (self .espp ) + space
258- + '{:6.1f}' .format (self .readsp ) + space
259- + '{:6.1f}' .format (self .writesp ) + space
260- + unrc .rjust (6 ) + space
261- + str (self .block_count ).rjust (6 ) + space
262- + str (self .instruction_count ).rjust (6 ) + space
263- + '{:8.3f}' .format (self .time ) + ftags + name + callcount )
255+ ftags = space + ("[" + "," .join (tags ) + "]" ).ljust (taglen )
256+ espp = "" if "esp" in hide else space + '{:6.1f}' .format (self .espp )
257+ readsp = "" if "reads" in hide else space + '{:6.1f}' .format (self .readsp )
258+ writesp = ("" if "writes" in hide
259+ else space + '{:6.1f}' .format (self .writesp ))
260+ unrcp = ("" if "unrc" in hide else space + unrc .rjust (6 ))
261+ blocksp = ("" if "blocks" in hide
262+ else space + str (self .block_count ).rjust (6 ))
263+ instrsp = ("" if "instrs" in hide
264+ else space + str (self .instruction_count ).rjust (6 ))
265+ timep = "" if "time" in hide else space + '{:8.3f}' .format (self .time )
266+ return (str (self .faddr ).ljust (10 )
267+ + espp
268+ + readsp
269+ + writesp
270+ + unrcp
271+ + blocksp
272+ + instrsp
273+ + timep
274+ + ftags
275+ + name
276+ + callcount )
0 commit comments