trace-cmd: Initialize handle->options list in tracecmd_attach_cpu_data_fd()
trace-cmd: Initialize handle->options list in tracecmd_attach_cpu_data_fd()

When recorder sends trace data via network, server recording process is
killed by SIGSEGV from the patch 71484a0854f7. This is because add_options()
uses handle->options list from the patch, but tracecmd_attach_cpu_data_fd()
calling add_options() does not initialize the list in spite of allocation of
new handle. As the result, the server recording process will be killed because
handle->options is cleared to zero in tracecmd_attach_cpu_data_fd().

<How to test>
1. Execute network(listen) server
 # trace-cmd listen -p 12345

2. Execute network client
 # trace-cmd record -e sched* -N <server IP>:12345

3. Stop the record on client
 ^C

 Here, network server should output a line "CPUX data recorded at offset=XXXX",
 but current network server aborts silently.

 Moreover the client's per-cpu files are separated. (Normally those files
 are merged into one trace file.)

4. Confirm error on network server
 #  dmesg | tail -1
[18551.537113] trace-cmd[23073]: segfault at ffffffffffffffe8 ip 0000000000432fd1 sp 00007fffffa4caa0 error 5 in trace-cmd[400000+47000]

 After we would introduce this patch, the server will be fully able to output
 the client's tracing data and we will not get this error.

Link: http://lkml.kernel.org/p/20140624022343.14037.69077.stgit@yuno-kbuild.novalocal

Cc: Hidehiro Kawai <b7bc4b5607293eac066e07a10278a5cc56317e37@hitachi.com>
Cc: Masami Hiramatsu <60fcdccfd958d359debfe6e6e7417cd7f1aaa9e3@hitachi.com>
Signed-off-by: Yoshihiro YUNOMAE <ac8be5af0813417580b5f61951eb565904da1b77@hitachi.com>
Signed-off-by: Steven Rostedt <43232e92d70cc7aa53504ad0397085ee47bad87f@goodmis.org>

bigzz/trace-cmd,bigzz/trace-cmd