NAME config as env var
RUN {{BPFTRACE}} -e 'config = { BPFTRACE_STACK_MODE=raw } uprobe:./testprogs/uprobe_test:uprobeFunction1 { printf("%s", ustack(1)); exit(); }'
EXPECT_REGEX ^\s+[0-9a-f]+$
AFTER ./testprogs/uprobe_test

NAME config short name
RUN {{BPFTRACE}} -e 'config = { stack_mode=raw } uprobe:./testprogs/uprobe_test:uprobeFunction1 { printf("%s", ustack(1)); exit(); }'
EXPECT_REGEX ^\s+[0-9a-f]+$
AFTER ./testprogs/uprobe_test

NAME env var takes precedence
RUN {{BPFTRACE}} -e 'config = { BPFTRACE_STACK_MODE=perf } uprobe:./testprogs/uprobe_test:uprobeFunction1 { printf("%s", ustack(1)); exit(); }'
ENV BPFTRACE_STACK_MODE=raw
EXPECT_REGEX ^\s+[0-9a-f]+$
AFTER ./testprogs/uprobe_test

NAME bad config
RUN {{BPFTRACE}} -e 'config = { bad_config=raw } begin {}'
EXPECT stdin:1:12-26: ERROR: bad_config: not a known configuration option
WILL_FAIL

NAME env only config
RUN {{BPFTRACE}} -e 'config = { debug_output=1 } begin {}'
EXPECT stdin:1:12-26: ERROR: debug_output: can only be set as an environment variable
WILL_FAIL

NAME maps are printed by default
PROG begin { @["test"] = count();  }
EXPECT @[test]: 1

NAME maps can be disabled
PROG config = { print_maps_on_exit=0 } begin { @["test"] = count();  }
EXPECT_NONE @[test]: 1

NAME scalar maps are printed by default
PROG begin { @test = 1;  }
EXPECT @test: 1

NAME scalar maps can be disabled
PROG config = { print_maps_on_exit=0 } begin { @test = 1;  }
EXPECT_NONE @test: 1
