MCPcopy Create free account
hub / github.com/ActiveState/code / parse_event

Method parse_event

recipes/Python/578138_gprof2dotpy/recipe-578138.py:1429–1454  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1427 return profile
1428
1429 def parse_event(self):
1430 if self.eof():
1431 return
1432
1433 line = self.consume()
1434 assert line
1435
1436 callchain = self.parse_callchain()
1437 if not callchain:
1438 return
1439
1440 callee = callchain[0]
1441 callee[SAMPLES] += 1
1442 self.profile[SAMPLES] += 1
1443
1444 for caller in callchain[1:]:
1445 try:
1446 call = caller.calls[callee.id]
1447 except KeyError:
1448 call = Call(callee.id)
1449 call[SAMPLES2] = 1
1450 caller.add_call(call)
1451 else:
1452 call[SAMPLES2] += 1
1453
1454 callee = caller
1455
1456 def parse_callchain(self):
1457 callchain = []

Callers 1

parseMethod · 0.95

Calls 5

parse_callchainMethod · 0.95
CallClass · 0.85
add_callMethod · 0.80
eofMethod · 0.45
consumeMethod · 0.45

Tested by

no test coverage detected