Revert "only mainthread can call table pairs and histogram"

Sometime we have to call histogram or pairs in timer context,
so allow non-mainthread to do that.

This is still a temp solution, because using pairs and histogram
in non-mainthread have a little unsafe, find a more safe way
to fix it.

Signed-off-by: Jovi Zhangwei <jovi.zhangwei@gmail.com>
update comments of perf overflow callback

make comments to be more accurate.

Signed-off-by: Jovi Zhangwei <jovi.zhangwei@gmail.com>
kill unused function event_regstr

register dump functionality in ktap should be implemented
by some kind of FFI support(implement in future), don't dump
the register vaule one by one manually.

Signed-off-by: Jovi Zhangwei <jovi.zhangwei@gmail.com>
add skip and max_entries option arguments into print_backtrace()/backtrace()

Normally skip and max_entries both set to 10 when dump stack,
but sometimes stack entries exceed 10, or skip 10 entries is
not enough, so allow user dump stack with specific skip and
max_entries.

print_backtrace (skip, max_entries)
backtrace (skip, max_entries)

If user don't add skip or max_entries arguments, use 10 defaultly.

Note the max number of max_entries is 100.

Signed-off-by: Jovi Zhangwei <jovi.zhangwei@gmail.com>
skip 12 stack entries in dumpstack() for stack_profile.kp

Skip 12 stack entries to hide some timer interrupt function,
make stack dump more accurate.

Signed-off-by: Jovi Zhangwei <jovi.zhangwei@gmail.com>
fix error handling in kp_lib_printf function

add missed preempt_enable_notrace.

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