Ejemplo n.º 1
0
 def stop(self):
     self.wait_for_idle()
     logging.msg('stopping server for mysql\n')
     time.sleep(2)
     subprocess.call([self.mysqladmin(), '--user=root', 'shutdown'])
     self.server.wait()
     self.server = None
Ejemplo n.º 2
0
 def after_each_test(self):
     iteration = len(self.test_history)
     used_time = self.test_history[-1].used_time()
     logging.msg('=== native iteration %d done === (%f) (%s)\n' % (iteration, used_time, os.getcwd()))
     f = open('timing', 'a')
     f.write('%f\n' % used_time)
     f.close()
Ejemplo n.º 3
0
 def stop(self):
     self.wait_for_idle()
     logging.msg('stopping server for mysql\n')
     time.sleep(2)
     subprocess.call([self.mysqladmin(), '--user=root', 'shutdown'])
     self.server.wait()
     self.server = None
Ejemplo n.º 4
0
 def after_each_test(self):
     iteration = len(self.test_history)
     used_time = self.test_history[-1].used_time()
     logging.msg('=== native iteration %d done === (%f) (%s)\n' %
                 (iteration, used_time, os.getcwd()))
     f = open('timing', 'a')
     f.write('%f\n' % used_time)
     f.close()
 def stop(self):
     p = psutil.Process(self.server.pid)
     while p.get_cpu_percent() > 5.0:
         time.sleep(1)
     logging.msg('stopping server for memcached_bug_127_training\n')
     os.kill(self.server.pid, signal.SIGINT)
     self.server.wait()
     self.server = None
Ejemplo n.º 6
0
 def start(self):
     args, sio = self.input()
     cmd = []
     if self.prefix != None:
         cmd.extend(self.prefix)
     cmd.extend(args)
     logging.msg('starting aget bug2\n')
     self.proc = subprocess.Popen(cmd)
Ejemplo n.º 7
0
 def start(self):
     args, sio = self.input()
     cmd = []
     if self.prefix != None:
         cmd.extend(self.prefix)
     cmd.extend(args)
     logging.msg('starting aget bug2\n')
     self.proc = subprocess.Popen(cmd)
Ejemplo n.º 8
0
def main(argv):
    if len(argv) < 1:
        logging.err(command_usage())
    command = argv[0]
    logging.msg('performing command: %s ...\n' % command, 2) 
    if valid_command(command):
        eval('__command_%s(argv[1:])' % command)
    else:
        logging.err(command_usage())
Ejemplo n.º 9
0
def verify(profiler, testcase):
    sinfo = static_info.StaticInfo()
    sinfo.load(profiler.knobs['sinfo_out'])
    iroot_db = iroot.iRootDB(sinfo)
    iroot_db.load(profiler.knobs['iroot_out'])
    if len(iroot_db.iroot_map) >= 40:
        logging.msg('iroot_db size mismatch\n')
        return False
    return True
Ejemplo n.º 10
0
def main(argv):
    if len(argv) < 1:
        logging.err(command_usage())
    command = argv[0]
    logging.msg('performing command: %s ...\n' % command, 2)
    if valid_command(command):
        eval('__command_%s(argv[1:])' % command)
    else:
        logging.err(command_usage())
Ejemplo n.º 11
0
def verify(profiler, testcase):
    sinfo = static_info.StaticInfo()
    sinfo.load(profiler.knobs['sinfo_out'])
    iroot_db = iroot.iRootDB(sinfo)
    iroot_db.load(profiler.knobs['iroot_out'])
    if len(iroot_db.iroot_map) > 19 or len(iroot_db.iroot_map) < 18:
        logging.msg('iroot_db size mismatch\n')
        return False
    return True
Ejemplo n.º 12
0
def main(argv):
    if len(argv) < 1:
        logging.err(command_usage())
    suite = argv[0]
    logging.msg('performing regression: %s ...\n' % suite, 2) 
    if valid_suite(suite):
        regression(suite, argv[1:])
    else:
        logging.err(command_usage())
Ejemplo n.º 13
0
 def issue(self):
     clients = []
     ipt = self.input()
     for idx in range(len(ipt)):
         clients.append(Client(ipt[idx], self))
     logging.msg('issuing requests for mysql\n')
     for i in range(len(clients)):
         clients[i].start()
     for i in range(len(clients)):
         clients[i].join()
Ejemplo n.º 14
0
 def issue(self):
     clients = []
     ipt, buf = self.input()
     for idx in range(len(ipt)):
         clients.append(Client(ipt[idx]))
     logging.msg('issuing requests for apache_bug_25520\n')
     for i in range(len(clients)):
         clients[i].start()
     for i in range(len(clients)):
         clients[i].join()
Ejemplo n.º 15
0
def verify(profiler, testcase):
    sinfo = static_info.StaticInfo()
    sinfo.load(profiler.knobs['sinfo_out'])
    iroot_db = iroot.iRootDB(sinfo)
    iroot_db.load(profiler.knobs['iroot_out'])
    for r in iroot_db.iroot_map.itervalues():
        if r.idiom() == 4:
            logging.msg('idiom4 iroot should not be predicted\n')
            return False
    return True
 def issue(self):
     clients = []
     num_threads, client_indexes = self.input()
     for i in range(len(client_indexes)):
         clients.append(Client(client_indexes[i]))
     logging.msg('issueing requests for memcached_bug_127_training\n')
     for i in range(len(clients)):
         clients[i].start()
     for i in range(len(clients)):
         clients[i].join()
Ejemplo n.º 17
0
 def issue(self):
     clients = []
     ipt = self.input()
     for idx in range(len(ipt)):
         clients.append(Client(ipt[idx], self))
     logging.msg('issuing requests for mysql\n')
     for i in range(len(clients)):
         clients[i].start()
     for i in range(len(clients)):
         clients[i].join()
Ejemplo n.º 18
0
 def issue(self):
     time.sleep(1)
     logging.msg('issuing requests for cnc_bug\n')
     del os.environ['CNC_SOCKET_HOST']
     del os.environ['CNC_SCHEDULER']
     os.environ['CNC_SOCKET_CLIENT'] = self.contact_string
     self.client = subprocess.Popen([self.ponger()])
     self.client.wait()
     del os.environ['CNC_SOCKET_CLIENT']
     self.retcode = self.server.wait()
     self.server = None
     self.client = None
Ejemplo n.º 19
0
 def issue(self):
     clients = []
     num_threads, client_indexes = self.input()
     for i in range(len(client_indexes)):
         clients.append(Client(client_indexes[i]))
     logging.msg('issuing requests for memcached_bug_127\n')
     self.mc = memcache.Client(['127.0.0.1:12345'], debug=0)
     self.mc.set('test', '0')
     for i in range(len(clients)):
         clients[i].start()
     for i in range(len(clients)):
         clients[i].join()
Ejemplo n.º 20
0
 def issue(self):
     clients = []
     num_threads, client_indexes = self.input()
     for i in range(len(client_indexes)):
         clients.append(Client(client_indexes[i]))
     logging.msg('issuing requests for memcached_bug_127\n')
     self.mc = memcache.Client(['127.0.0.1:12345'], debug=0)
     self.mc.set('test', '0')
     for i in range(len(clients)):
         clients[i].start()
     for i in range(len(clients)):
         clients[i].join()
Ejemplo n.º 21
0
def __modify_memo_refine_candidate(options):
    if not os.path.exists(options.memo_in):
        return
    sinfo = static_info.StaticInfo()
    sinfo.load(options.sinfo_in)
    iroot_db = iroot.iRootDB(sinfo)
    iroot_db.load(options.iroot_in)
    memo_db = memo.Memo(sinfo, iroot_db)
    memo_db.load(options.memo_in)
    memo_db.refine_candidate()
    memo_db.save(options.memo_out)
    logging.msg('memo refine candidate done!\n')
Ejemplo n.º 22
0
def __modify_memo_mark_unexposed_failed(options):
    if not os.path.exists(options.memo_in):
        return
    sinfo = static_info.StaticInfo()
    sinfo.load(options.sinfo_in)
    iroot_db = iroot.iRootDB(sinfo)
    iroot_db.load(options.iroot_in)
    memo_db = memo.Memo(sinfo, iroot_db)
    memo_db.load(options.memo_in)
    memo_db.mark_unexposed_failed()
    memo_db.save(options.memo_out)
    logging.msg('memo mark unexposed failed done!\n')
Ejemplo n.º 23
0
def __modify_memo_mark_unexposed_failed(options):
    if not os.path.exists(options.memo_in):
        return
    sinfo = static_info.StaticInfo()
    sinfo.load(options.sinfo_in)
    iroot_db = iroot.iRootDB(sinfo)
    iroot_db.load(options.iroot_in)
    memo_db = memo.Memo(sinfo, iroot_db)
    memo_db.load(options.memo_in)
    memo_db.mark_unexposed_failed()
    memo_db.save(options.memo_out)
    logging.msg('memo mark unexposed failed done!\n')
Ejemplo n.º 24
0
 def stop(self):
     p = psutil.Process(self.server.pid)
     while p.get_cpu_percent() > 5.0:
         time.sleep(1)
     time.sleep(1)
     stop_cmd = []
     stop_cmd.append(self.bin())
     stop_cmd.extend(['-k', 'stop'])
     logging.msg('stopping server for apache_bug_25520\n')
     subprocess.call(stop_cmd)
     self.server.wait()
     self.server = None
Ejemplo n.º 25
0
 def start(self):
     uri_idx, num_calls = self.input_entry
     httperf_args = []
     httperf_args.append(config.benchmark_home('httperf') + '/bin/httperf')
     httperf_args.append('--server=localhost')
     httperf_args.append('--port=8080')
     httperf_args.append('--uri=/test/%d.txt' % uri_idx)
     httperf_args.append('--num-calls=%d' % num_calls)
     httperf_args.append('--num-conns=1')
     logging.msg('client: uri_idx=%d, num_calls=%d\n' % (uri_idx, num_calls))
     self.fnull = open(os.devnull, 'w')
     self.proc = subprocess.Popen(httperf_args, stdout=self.fnull, stderr=self.fnull)
Ejemplo n.º 26
0
def __modify_memo_refine_candidate(options):
    if not os.path.exists(options.memo_in):
        return
    sinfo = static_info.StaticInfo()
    sinfo.load(options.sinfo_in)
    iroot_db = iroot.iRootDB(sinfo)
    iroot_db.load(options.iroot_in)
    memo_db = memo.Memo(sinfo, iroot_db)
    memo_db.load(options.memo_in)
    memo_db.refine_candidate()
    memo_db.save(options.memo_out)
    logging.msg('memo refine candidate done!\n')
Ejemplo n.º 27
0
def __modify_memo_input_change(options):
    if not os.path.exists(options.memo_in):
        return
    sinfo = static_info.StaticInfo()
    sinfo.load(options.sinfo_in)
    iroot_db = iroot.iRootDB(sinfo)
    iroot_db.load(options.iroot_in)
    memo_db = memo.Memo(sinfo, iroot_db)
    memo_db.load(options.memo_in)
    memo_db.clear_predicted_set()
    memo_db.clear_candidate_map()
    memo_db.save(options.memo_out)
    logging.msg('memo input change done!\n')
Ejemplo n.º 28
0
def verify(profiler, testcase):
    sinfo = static_info.StaticInfo()
    sinfo.load(profiler.knobs['sinfo_out'])
    iroot_db = iroot.iRootDB(sinfo)
    iroot_db.load(profiler.knobs['iroot_out'])
    if len(iroot_db.iroot_map) != 2:
        logging.msg('iroot_db size mismatch\n')
        return False
    for r in iroot_db.iroot_map.itervalues():
        if not iroot_is_expected(r):
            logging.msg('iroot mismatch\n')
            return False
    return True
Ejemplo n.º 29
0
def verify(profiler, testcase):
    sinfo = static_info.StaticInfo()
    sinfo.load(profiler.knobs['sinfo_out'])
    iroot_db = iroot.iRootDB(sinfo)
    iroot_db.load(profiler.knobs['iroot_out'])
    if len(iroot_db.iroot_map) != 5:
        logging.msg('iroot_db size mismatch\n')
        return False
    for r in iroot_db.iroot_map.itervalues():
        if not iroot_is_expected(r):
            logging.msg('iroot mismatch\n')
            return False
    return True
Ejemplo n.º 30
0
 def start(self):
     logging.msg('starting server for cnc_bug\n')
     ipt = self.input()
     cmd = []
     if self.prefix != None:
         cmd.extend(self.prefix)
     cmd.append(self.pinger())
     cmd.extend(ipt)
     os.environ['CNC_SOCKET_HOST'] = '1'
     os.environ['CNC_SCHEDULER'] = 'TBB_QUEUE'
     self.server = subprocess.Popen(cmd, stdout=subprocess.PIPE)
     self.contact_string = self.wait_for_contact_string()
     logging.msg('contact string = %s\n' % self.contact_string)
Ejemplo n.º 31
0
def __modify_memo_input_change(options):
    if not os.path.exists(options.memo_in):
        return
    sinfo = static_info.StaticInfo()
    sinfo.load(options.sinfo_in)
    iroot_db = iroot.iRootDB(sinfo)
    iroot_db.load(options.iroot_in)
    memo_db = memo.Memo(sinfo, iroot_db)
    memo_db.load(options.memo_in)
    memo_db.clear_predicted_set()
    memo_db.clear_candidate_map()
    memo_db.save(options.memo_out)
    logging.msg('memo input change done!\n')
Ejemplo n.º 32
0
 def load(self, db_name):
     try:
         f = open(db_name, 'rb')
         self.proto.ParseFromString(f.read())
         f.close()
         for image_proto in self.proto.image:
             image = Image(image_proto, self)
             self.image_map[image.id()] = image
         for inst_proto in self.proto.inst:
             inst = Inst(inst_proto, self)
             self.inst_map[inst.id()] = inst
             self.image_map[inst.image().id()].add_inst(inst)
     except IOError:
         logging.msg('static info not found\n')
Ejemplo n.º 33
0
 def start(self):
     start_cmd = []
     if self.prefix != None:
         start_cmd.extend(self.prefix)
     start_cmd.append(self.bin())
     start_cmd.extend(['-k', 'start', '-D', 'ONE_PROCESS'])
     logging.msg('starting server for apache\n')
     self.server = subprocess.Popen(start_cmd)
     while not os.path.exists(self.pid_file()):
         time.sleep(1)
     p = psutil.Process(self.server.pid)
     while p.get_num_threads() != 4:
         time.sleep(1)
     time.sleep(1)
Ejemplo n.º 34
0
 def load(self, db_name):
     try:
         f = open(db_name, 'rb')
         self.proto.ParseFromString(f.read())
         f.close()
         for image_proto in self.proto.image:
             image = Image(image_proto, self)
             self.image_map[image.id()] = image
         for inst_proto in self.proto.inst:
             inst = Inst(inst_proto, self)
             self.inst_map[inst.id()] = inst
             self.image_map[inst.image().id()].add_inst(inst)
     except IOError:
         logging.msg('static info not found\n')
 def start(self):
     num_threads, client_indexes = self.input()
     start_cmd = []
     if self.prefix != None:
         start_cmd.extend(self.prefix)
     start_cmd.append(self.bin())
     start_cmd.extend(['-p', '12345'])
     start_cmd.extend(['-t', str(num_threads)])
     if os.getuid() == 0:
         start_cmd.extend(['-u', 'root'])
     logging.msg('starting server for memcached_bug_127_training\n')
     self.server = subprocess.Popen(start_cmd)
     p = psutil.Process(self.server.pid)
     while p.get_num_threads() < (num_threads + 2):
         time.sleep(1)
Ejemplo n.º 36
0
 def start(self):
     start_cmd = []
     if self.prefix != None:
         start_cmd.extend(self.prefix)
     start_cmd.append(self.bin())
     start_cmd.extend(['-k', 'start', '-D', 'ONE_PROCESS'])
     ipt, buf = self.input()
     if buf == True:
         start_cmd.extend(['-f', self.conf_file()])
     logging.msg('starting server for apache_bug_25520_training\n')
     self.server = subprocess.Popen(start_cmd)
     while not os.path.exists(self.pid_file()):
         time.sleep(1)
     p = psutil.Process(self.server.pid)
     while p.get_num_threads() != 4:
         time.sleep(1)
     time.sleep(1)
Ejemplo n.º 37
0
def verify(profiler, testcase):
    sinfo = static_info.StaticInfo()
    sinfo.load(profiler.knobs['sinfo_out'])
    iroot_db = iroot.iRootDB(sinfo)
    iroot_db.load(profiler.knobs['iroot_out'])
    num_idiom4_iroots = 0
    for r in iroot_db.iroot_map.itervalues():
        if r.idiom() == 4:
            num_idiom4_iroots += 1
    if num_idiom4_iroots != 7:
        logging.msg('num idiom4 iroots mismatch\n')
        return False
    for r in iroot_db.iroot_map.itervalues():
        if not iroot_is_expected(r):
            logging.msg('iroot mismatch\n')
            return False
    return True
Ejemplo n.º 38
0
 def start(self):
     start_cmd = []
     if self.prefix != None:
         start_cmd.extend(self.prefix)
     start_cmd.append(self.bin())
     start_cmd.extend(['-k', 'start', '-D', 'ONE_PROCESS'])
     ipt, buf = self.input()
     if buf == True:
         start_cmd.extend(['-f', self.conf_file()])
     logging.msg('starting server for apache_bug_25520_training\n')
     self.server = subprocess.Popen(start_cmd)
     while not os.path.exists(self.pid_file()):
         time.sleep(1)
     p = psutil.Process(self.server.pid)
     while p.get_num_threads() != 4:
         time.sleep(1)
     time.sleep(1)
Ejemplo n.º 39
0
def verify(profiler, testcase):
    sinfo = static_info.StaticInfo()
    sinfo.load(profiler.knobs['sinfo_out'])
    iroot_db = iroot.iRootDB(sinfo)
    iroot_db.load(profiler.knobs['iroot_out'])
    num_idiom4_iroots = 0
    for r in iroot_db.iroot_map.itervalues():
        if r.idiom() == 4:
            num_idiom4_iroots += 1
    if num_idiom4_iroots != 7:
        logging.msg('num idiom4 iroots mismatch\n')
        return False
    for r in iroot_db.iroot_map.itervalues():
        if not iroot_is_expected(r):
            logging.msg('iroot mismatch\n')
            return False
    return True
Ejemplo n.º 40
0
 def body(self):
     self.race_testcase.run()
     if self.race_testcase.is_fatal():
         logging.msg('\n')
         logging.msg('---------------------------\n')
         self.race_testcase.log_stat()
     else:
         self.chess_testcase.run()
         logging.msg('\n')
         logging.msg('---------------------------\n')
         self.race_testcase.log_stat()
         self.chess_testcase.log_stat()
Ejemplo n.º 41
0
 def body(self):
     self.profile_testcase.run()
     if self.profile_testcase.is_fatal():
         logging.msg('\n')
         logging.msg('---------------------------\n')
         self.profile_testcase.log_stat()
     else:
         self.active_testcase.run()
         logging.msg('\n')
         logging.msg('---------------------------\n')
         self.profile_testcase.log_stat()
         self.active_testcase.log_stat()
Ejemplo n.º 42
0
 def body(self):
     self.profile_testcase.run()
     if self.profile_testcase.is_fatal():
         logging.msg('\n')
         logging.msg('---------------------------\n')
         self.profile_testcase.log_stat()
     else:
         self.active_testcase.run()
         logging.msg('\n')
         logging.msg('---------------------------\n')
         self.profile_testcase.log_stat()
         self.active_testcase.log_stat()
Ejemplo n.º 43
0
 def join(self):
     self.proc.wait()
     self.fnull.close()
     self.proc = None
     self.fnull = None
     logging.msg('client done\n')
Ejemplo n.º 44
0
def echo(suite, message):
    logging.msg('regression %s - %s\n' % (suite, message))
Ejemplo n.º 45
0
 def log_stat(self):
     runs = len(self.test_history)
     used_time = self.used_time()
     logging.msg('%-15s %d\n' % ('race_runs', runs))
     logging.msg('%-15s %f\n' % ('race_time', used_time))
Ejemplo n.º 46
0
 def after_all_tests(self):
     if self.is_fatal():
         logging.msg('race fatal error detected\n')
     else:
         logging.msg('race threshold reached\n')
Ejemplo n.º 47
0
 def after_each_test(self):
     iteration = len(self.test_history)
     used_time = self.test_history[-1].used_time()
     logging.msg('=== race iteration %d done === (%f)\n' % (iteration, used_time))
Ejemplo n.º 48
0
 def start(self):
     logging.msg('starting server for mysql\n')
     self.server = subprocess.Popen([self.mysqld_safe(), '--user=root'])
     self.wait_for_idle()