Exemplo n.º 1
0
 def __init__(self,ucr_xml,lcfg_xml,use_threshold,threshold):
     ClassIRHandler.__init__(self, ucr_xml)
     UCFRHandler.__init__(self, lcfg_xml)
     self._use_threshold = use_threshold
     self._threshold = threshold
     if(use_threshold):
         self._call_map = {t:{} for t in numpy.arange(threshold,1,0.05)}
     self.get_call_map()
     all_frames = set([f.get("cfg_id") for f in self.get_frames()])
     if use_threshold:
         for t in sorted(self._call_map.keys()):
             all_called = set(self._call_map[t].keys())
             not_called = all_frames-all_called
             print t,"Reachable ratio",len(all_called)*1.0/len(all_frames)
         print "Processed",lcfg_xml
     else:
         all_called = set(self._call_map.keys())
         not_called = all_frames-all_called
         not_called_frames = set([f for f in self.get_frames() if f.get("cfg_id") in not_called])
         for f in not_called_frames:
             print "Not found calls for",f.tag, f.get("name"),"[cfg_id="+f.get("cfg_id")+"]", "from",f.get("label")
         print "Processed",lcfg_xml
         print "Reachable ",len(all_called)," from ", len(all_frames)
         print "Reachable ratio",len(all_called)*1.0/len(all_frames)
         print len(all_frames)
         print len(all_called)
         print len(not_called)
         print all_called-all_frames
Exemplo n.º 2
0
 def __init__(self,ucr_xml,cfg_xml,out_xml):
     ClassIRHandler.__init__(self, ucr_xml)
     UCFRHandler.__init__(self, cfg_xml)
     self._input_ucr = ucr_xml
     self._input_ucfr = cfg_xml
     self._out_xml = out_xml
     self.run()
Exemplo n.º 3
0
 def __init__(self, ucr_xml, cfg_xml, cfg_id, creation_count):
     UCFRHandler.__init__(self, cfg_xml)
     ClassIRHandler.__init__(self, ucr_xml)
     self.__method_id = cfg_id
     self.__count = {}
     self.__creation_count = int(creation_count)
     self.run()
Exemplo n.º 4
0
    def __init__(self, ucr_xml, cfg_xml):
        UCFRHandler.__init__(self, cfg_xml)
        ClassIRHandler.__init__(self, ucr_xml)
	t = current_time()
	for i in xrange(0, 10000):
            self.run()
	    print "*** {0} out of 10 000 ***".format(i)
	t = current_time() - t
	print "Time in millis:", t
Exemplo n.º 5
0
 def __init__(self, in_file,out_file):
     ConfigurationMixIn.__init__(self, usage=__doc__)
     ClassIRHandler.__init__(self, in_file)
     self._out_file = out_file
     self.run()
Exemplo n.º 6
0
 def __init__(self, ucr_xml, cfg_xml):
     UCFRHandler.__init__(self, cfg_xml)
     ClassIRHandler.__init__(self, ucr_xml)
     self.run()
Exemplo n.º 7
0
 def __init__(self, ucr_xml, cfg_xml, call_count):
     UCFRHandler.__init__(self, cfg_xml)
     ClassIRHandler.__init__(self, ucr_xml)
     self.__call_count = int(call_count)
     self.run()