Forwarding & invoking a block of code

I’m writing a wrapper function for a macro, that can be invoked, for instance as @snoopl "/tmp/a.txt" "/tmp/b.txt" println("Helloworld"). Now when trying to wrap it, it fails with the error ERROR: UndefVarError: code_block not defined, which I imagine it means it is interpreting the argument code_block literally, as a symbol (see below). What’s the correct way to define it, and then to invoke it with an arbitrary code block?

function compile_time(code_block)
    a = "/tmp/a.txt"
    b = "/tmp/b.txt"
    @snoopl a b code_block
end

Source code: https://github.com/timholy/SnoopCompile.jl/blob/master/SnoopCompileCore/src/snoopl.jl

I think I’ve managed to move forward by:

macro compile_times(code_block)
quote
    root = Base.Filesystem.tempname()
    path_func_names = "$(root)_functions.txt"
    path_llvm_timings = "$(root)_llvm.txt"
    println("Function names: $(path_func_names), llvm timings: $(path_llvm_timings)")
    @snoopl path_func_names path_llvm_timings $code_block
    times, _ = SnoopCompile.read_snoopl(path_func_names, path_llvm_timings)
    return times
end
end

here the macro @macroexpand has been fundamental to debug the code. I still don’t really understand the differences between quote, esc and QuoteNode though?