Exemplo n.º 1
0
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)
Exemplo n.º 2
0
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
Exemplo n.º 3
0
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)
Exemplo n.º 4
0
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)
Exemplo n.º 5
0
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)
Exemplo n.º 6
0
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())