def run(ctx, user, function, repeats=1): """ Execute a specific function """ args = [user, function] if repeats: args.append(str(repeats)) run_command("simple_runner", args)
def disassemble_function(user, func): args = [user, func] run_command("func_sym", args) # Print out the results syms_path = join(WASM_DIR, user, func, "function.symbols") if not exists(syms_path): print("Did not find symbols at {}".format(syms_path)) exit(1) return syms_path
def run(ctx, user, function, repeats=1, wamr=False, data=None): """ Execute a specific function """ args = [user, function, str(repeats)] if data: args.append(data) wasm_vm = "wamr" if wamr else "wavm" extra_env = {"WASM_VM": wasm_vm} run_command("simple_runner", args, extra_env=extra_env)
def run(ctx, user, function, data=None): """ Execute a specific function """ args = [user, function] if data: args.append(data) wasm_vm = getenv("WASM_VM", default="wavm") extra_env = {"WASM_VM": wasm_vm} run_command("func_runner", args, extra_env=extra_env)
def run(ctx, user, function, repeats=1, wamr=False): """ Execute a specific function """ args = [user, function] if repeats: args.append(str(repeats)) wasm_vm = "wamr" if wamr else "wavm" env = copy(environ) env.update({"WASM_VM": wasm_vm}) run_command("simple_runner", args)
def symbols(ctx, user, func): """ Print out the symbols for this function """ args = [user, func] run_command("func_sym", args) # Print out the results syms_path = join(WASM_DIR, user, func, "function.symbols") if not exists(syms_path): print("Did not find symbols at {}".format(syms_path)) exit(1) with open(syms_path) as fh: print(fh.read())