check event id file exist before write to u(k)probes_event file

A bug was found when execute glibc_trace.kp, that bug was
introduced by last commit.

There have some symbols mapping to same event name(eg, glibc functions)
because of debugfs naming rule issue, so the next event
may overwrite the previous event, cause register previous event
failure.

So if many events mapping to same symbol name, then share
same event id.

(todo: every symbol have its own event id)

Signed-off-by: Jovi Zhangwei <jovi.zhangwei@gmail.com>
add sample script: scripts/userspace/glibc_func_hist.kp

This script output all glibc functions in histogram style.

[root@localhost ktap]# ./ktap scripts/userspace/glibc_func_hist.kp
Tracing... Ctrl-C to end.
^C
                          value ------------- Distribution ------------- count
                   _IO_sputbackc |                                       1536
                  __strncmp_sse2 |                                       1522
                    __GI_strncmp |                                       1522
                     __GI_memcpy |                                       1446
                   __memcpy_sse2 |                                       1446
        _dl_mcount_wrapper_check |                                       1433
   __GI__dl_mcount_wrapper_check |                                       1433
 __gconv_transform_utf8_internal |                                       1429
                       __mbrtowc |                                       1425
                        mbrtoc32 |                                       1425
                  __GI___mbrtowc |                                       1425
                         mbrtowc |                                       1425
                    __GI_mbrtowc |                                       1425
                         strtouq |                                       1274
                        strtoull |                                       1274
                         strtoul |                                       1274
          __ctype_get_mb_cur_max |                                       984
         ____strtoull_l_internal |                                       970
     __GI_____strtoul_l_internal |                                       970
              __GI__IO_sputbackc |                                       960
                             ... |

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

- add -q option to silence some testcae
- update kprobe.kp testcase

Signed-off-by: Jovi Zhangwei <jovi.zhangwei@gmail.com>
test: sleep for 1 second before killing deadloop

Sometimes, pkill get run first before ktap and return 1, which
leaves the deadloop running forever.

Signed-off-by: Qingping Hou <qingping.hou@gmail.com>
use POSIX syntax for shell function definition in run_test

Signed-off-by: Qingping Hou <qingping.hou@gmail.com>