MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / strip_dirs

Method strip_dirs

tools/python-3.11.9-amd64/Lib/pstats.py:281–308  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

279 return self
280
281 def strip_dirs(self):
282 oldstats = self.stats
283 self.stats = newstats = {}
284 max_name_len = 0
285 for func, (cc, nc, tt, ct, callers) in oldstats.items():
286 newfunc = func_strip_path(func)
287 if len(func_std_string(newfunc)) > max_name_len:
288 max_name_len = len(func_std_string(newfunc))
289 newcallers = {}
290 for func2, caller in callers.items():
291 newcallers[func_strip_path(func2)] = caller
292
293 if newfunc in newstats:
294 newstats[newfunc] = add_func_stats(
295 newstats[newfunc],
296 (cc, nc, tt, ct, newcallers))
297 else:
298 newstats[newfunc] = (cc, nc, tt, ct, newcallers)
299 old_top = self.top_level
300 self.top_level = new_top = set()
301 for func in old_top:
302 new_top.add(func_strip_path(func))
303
304 self.max_name_len = max_name_len
305
306 self.fcn_list = None
307 self.all_callees = None
308 return self
309
310 def calc_callees(self):
311 if self.all_callees:

Callers 4

print_statsMethod · 0.80
do_stripMethod · 0.80
print_statsMethod · 0.80
ndiff.pyFile · 0.80

Calls 6

func_strip_pathFunction · 0.85
func_std_stringFunction · 0.85
add_func_statsFunction · 0.85
setFunction · 0.50
itemsMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected