From 448097c6eca321519f2de88619afa804ad6d4ef9 Mon Sep 17 00:00:00 2001 From: Rusty Wagner Date: Thu, 27 Apr 2017 00:40:07 -0400 Subject: Adding an API for performance debugging --- python/function.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'python/function.py') diff --git a/python/function.py b/python/function.py index d54cf25a..2a0176c9 100644 --- a/python/function.py +++ b/python/function.py @@ -426,6 +426,16 @@ class Function(object): else: return Function._associated_data[handle.value] + @property + def analysis_performance_info(self): + count = ctypes.c_ulonglong() + info = core.BNGetFunctionAnalysisPerformanceInfo(self.handle, count) + result = {} + for i in xrange(0, count.value): + result[info[i].name] = info[i].seconds + core.BNFreeAnalysisPerformanceInfo(info, count.value) + return result + def __iter__(self): count = ctypes.c_ulonglong() blocks = core.BNGetFunctionBasicBlockList(self.handle, count) -- cgit v1.3.1