read available_events debugfs file to get tracepoint event name

Now just read /sys/kernel/debug/tracing/available_events,
avoid read each event directory one by one.

Signed-off-by: Jovi Zhangwei <jovi.zhangwei@gmail.com>
Rework ffi testcases by new prove test scaffold

Now all ffi testcases moved to test/ffi_test.t,
directory test/ffi_test/ contains cparser_test and
dummy kernel module used for test/ffi_test.t.

Compilation of ffi dummy kernel module and cparser_test.c
is triggered by test/ffi_test.t.

If no ffi compiled in, then test/ffi_test.t will be skipped.

Using skip feature for ffi test is suggested by Yichun (agentzh).

Signed-off-by: Jovi Zhangwei <jovi.zhangwei@gmail.com>
delete test/ffi_test/.gitignore

Because all temp files of test/ffi_test compilation
will be delete after execute test/ffi_test.t finish,
so there have no need to maintain .gitignore file any more.

Signed-off-by: Jovi Zhangwei <jovi.zhangwei@gmail.com>
pre-allocate 2000 record entries in stack_profile.kp

Signed-off-by: Jovi Zhangwei <jovi.zhangwei@gmail.com>
simpily ktap_string structure definition

Signed-off-by: Jovi Zhangwei <jovi.zhangwei@gmail.com>
write kernel symbol memory address into kprobe_events

This patch also allow probe all available functions in
/proc/kallsyms.
	./ktap -e 'trace probe:* {}'

Note above oneliner will softlockup system at present,
the reason still under investigate, probably caused by
kprobe issue, not ktap, because below shell script
also lockup system.

TRACE_DIR=/sys/kernel/debug/tracing/

echo "Disable tracing to remove tracing overhead"
echo 0 > $TRACE_DIR/tracing_on

echo > $TRACE_DIR/kprobe_events
echo "Setup events on all functions"
grep -iw t /proc/kallsyms | awk 'BEGIN{i=0};{print("p:"$3"_"i, "0x"$1); i++}' | \
while read l; do echo $l >> $TRACE_DIR/kprobe_events || echo "Failed: $l" ; done

So use that script at you own risk, at least for now.

Signed-off-by: Jovi Zhangwei <jovi.zhangwei@gmail.com>
add sample script: kprobe_all_kernel_functions.kp

This script will lockup system.

Signed-off-by: Jovi Zhangwei <jovi.zhangwei@gmail.com>