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