Ejemplo n.º 1
0
 def time_jvisualvm(self):
     commons.log('Time analysis (JVisualVM)' + ' -- ' + '"' + self.prefix +
                 '"')
     tag = ['time', 'convert', None, None]
     time_profile_file = '%s/%s/%s' % (
         self.options.folder, config.time_dir(), config.time_profile_file())
     time_statistics_file = '%s/%s/%s' % (
         self.options.folder, config.time_dir(), config.statistics_file())
     time_output_file = '%s/%s/%s' % (
         self.options.folder, config.time_dir(), config.time_output_file())
     time_total_file = '%s/%s/%s' % (self.options.folder, config.time_dir(),
                                     config.time_total_file())
     converter_params = [
         time_profile_file, time_statistics_file, time_total_file
     ]
     self._execute(
         tag,
         commons.scala_options() + self._get_time_converter_class() +
         converter_params)
     tag = ['time', 'filter', None, None]
     filter_params = [
         time_statistics_file, time_total_file, time_output_file
     ]
     self._execute(
         tag,
         commons.scala_options() + self._get_time_filter_class() +
         filter_params + self.time_options.as_list_plain)
     commons.log('Time analysis (JVisualVM)' + ' -- ' + '"' + self.prefix +
                 '"' + ' -- ' + 'DONE.')
Ejemplo n.º 2
0
 def time_jvisualvm(self):
    commons.log('Time analysis (JVisualVM)' + ' -- ' + '"' + self.prefix + '"')
    tag=['time', 'convert', None, None]
    time_profile_file = '%s/%s/%s' % (self.options.folder, config.time_dir(), config.time_profile_file()) 
    time_statistics_file = '%s/%s/%s' % (self.options.folder, config.time_dir(), config.statistics_file()) 
    time_output_file = '%s/%s/%s' % (self.options.folder, config.time_dir(), config.time_output_file())
    time_total_file = '%s/%s/%s' % (self.options.folder, config.time_dir(), config.time_total_file())
    converter_params = [time_profile_file, time_statistics_file, time_total_file]
    self._execute(tag, commons.scala_options() + self._get_time_converter_class() + converter_params)
    tag=['time', 'filter', None, None]
    filter_params = [time_statistics_file, time_total_file, time_output_file]
    self._execute(tag, commons.scala_options() + self._get_time_filter_class() + filter_params + self.time_options.as_list_plain)
    commons.log('Time analysis (JVisualVM)' + ' -- ' + '"' + self.prefix + '"' + ' -- ' + 'DONE.')
Ejemplo n.º 3
0
 def _ranking(self, cluster):
    #
    if cluster == True:
       options_cluster = ['0.01', '0.5', 'true']
    else:
       options_cluster = ['0.01', '0.5', 'false']
    #
    time_stats_file = '%s/%s/stats.txt' % (self.folder, config.time_dir())
    time_total_file = '%s/%s/%s' % (self.folder, config.time_dir(), config.time_total_file())
    time_profile_file = '%s/%s/%s' % (self.folder, config.time_dir(), config.time_profile_file())
    tuples_file = '%s/%s' % (self.folder, config.tuples_final_file())       
    #
    call_graph_file = '%s/%s/%s/call_graph.bin' % (commons.callgraphs_path(), self.program.path, self.program.prefix)
    #
    running = 'java -cp %s cpb.RankAndInspect %s %s %s %s %s %s' % (commons.scala_libs(), self.program.prefix, time_stats_file, time_total_file, tuples_file, call_graph_file, time_profile_file)
    subprocess.call(shlex.split(str(running)) + options_cluster)
Ejemplo n.º 4
0
 def _filter_with_black_list(self):
    self._copy_black_list()
    white_file = '%s/%s/%s' % (self.folder, config.time_dir(), config.time_output_file())
    black_file = '%s/%s' % (self.folder, config.black_list_file())
    white_methods = self._read_file(white_file)
    black_methods = self._read_file(black_file)
    white_method_package = [line for line in white_methods if line not in black_methods and line.startswith(self.program.options.package)]
    white_method_filtered = [line for line in white_method_package if not '<init>' in line]
    white_list_file = '%s/%s' % (self.folder, config.white_list_file())
    self._write_file(white_list_file, white_method_filtered)
Ejemplo n.º 5
0
 def _ranking(self, cluster):
     #
     if cluster == True:
         options_cluster = ['0.01', '0.5', 'true']
     else:
         options_cluster = ['0.01', '0.5', 'false']
     #
     time_stats_file = '%s/%s/stats.txt' % (self.folder, config.time_dir())
     time_total_file = '%s/%s/%s' % (self.folder, config.time_dir(),
                                     config.time_total_file())
     time_profile_file = '%s/%s/%s' % (self.folder, config.time_dir(),
                                       config.time_profile_file())
     tuples_file = '%s/%s' % (self.folder, config.tuples_final_file())
     #
     call_graph_file = '%s/%s/%s/call_graph.bin' % (
         commons.callgraphs_path(), self.program.path, self.program.prefix)
     #
     running = 'java -cp %s cpb.RankAndInspect %s %s %s %s %s %s' % (
         commons.scala_libs(), self.program.prefix, time_stats_file,
         time_total_file, tuples_file, call_graph_file, time_profile_file)
     subprocess.call(shlex.split(str(running)) + options_cluster)
Ejemplo n.º 6
0
 def _filter_with_black_list(self):
     self._copy_black_list()
     white_file = '%s/%s/%s' % (self.folder, config.time_dir(),
                                config.time_output_file())
     black_file = '%s/%s' % (self.folder, config.black_list_file())
     white_methods = self._read_file(white_file)
     black_methods = self._read_file(black_file)
     white_method_package = [
         line for line in white_methods if line not in black_methods
         and line.startswith(self.program.options.package)
     ]
     white_method_filtered = [
         line for line in white_method_package if not '<init>' in line
     ]
     white_list_file = '%s/%s' % (self.folder, config.white_list_file())
     self._write_file(white_list_file, white_method_filtered)
Ejemplo n.º 7
0
 def _copy_time_output_to_white_list(self):
     from_file = '%s/%s/%s' % (self.folder, config.time_dir(),
                               config.time_output_file())
     to_file = '%s/%s' % (self.folder, config.white_list_file())
     self._copy_file(from_file, to_file)
Ejemplo n.º 8
0
 def _copy_time_profile(self):
     os.makedirs('%s/%s' % (self.folder, config.time_dir()))
     to_file = '%s/%s/%s' % (self.folder, config.time_dir(),
                             config.time_profile_file())
     self._copy_file(self.program.profile, to_file)
Ejemplo n.º 9
0
 def _copy_time_output_to_white_list(self):
    from_file = '%s/%s/%s' % (self.folder, config.time_dir(), config.time_output_file())
    to_file = '%s/%s' % (self.folder, config.white_list_file())
    self._copy_file(from_file, to_file)
Ejemplo n.º 10
0
 def _copy_time_profile(self):
    os.makedirs('%s/%s' % (self.folder, config.time_dir()))
    to_file = '%s/%s/%s' % (self.folder, config.time_dir(), config.time_profile_file())
    self._copy_file(self.program.profile, to_file)