ck.check(funcs) ck.report() def check_all_func(log_d): funcs = [] for f in os.listdir(log_d): if fnmatch.fnmatch(f, "pathbin*.p"): funcs.append(f[8:-2]) ck = ExternAPIChecker(check_all=True) ck.load_pathbin(log_d) ck.check(funcs) ck.report() if __name__ == '__main__': utils.install_pdb() # option parsing parser = optparse.OptionParser() parser.add_option("--pickle", help="pickle directory", default=PICKLE_DIR) parser.add_option("--fs", help="List of fs", default=None) parser.add_option("--test", help="run test", action="store_true", dest="test", default=False) parser.add_option("--all", help="apply to all functions", action="store_true", dest="check_all", default=False) parser.add_option("--debug", help="debug", action="store_true", dest="debug", default=False) (opts, args) = parser.parse_args() if opts.test: run_test(opts.check_all) sys.exit(0) fs = "*"
print count_fs("%s @ %s" % (fs, func), [func]) else: print "%s is missing" % fs return def test_rename(): funcs = [ "ext2_rename", "ext3_rename", "ext4_rename2", "btrfs_rename2", ] log_d = os.path.join(ROOT, "data", "sample-fss-output") ct = Counter("test-rename") ct.load_pathbin(log_d) for func in funcs: ct.update(func) print ct.report() return if __name__ == '__main__': utils.install_pdb() # test_rename() # main() count_path_by_funcs(["lookup"], "inode", "dir") count_path_by_funcs(["create"], "inode", "dir") count_path_by_funcs(["rename", "rename2"], "inode", "dir")