crash-pipe: Introduce option to copy core using splice(2)
Linux splice(2) avoids user-space copy and is effectively faster than
regular read(2) + write(2).
According to (ftrace) test below splice is about 20% faster.
sysctl -w kernel.core_pattern='|/usr/libexec/core-pipe --save-core /opt/usr/share/temp/core.%p'
cd /sys/fs/kernel/tracing/
echo do_coredump > set_ftrace_filter
echo function_graph > current_tracer
cat trace_pipe
/* splice */
2) $ 2183078 us | } /* do_coredump */
4) $ 2127946 us | } /* do_coredump */
1) $ 2377004 us | } /* do_coredump */
1) $ 2088114 us | } /* do_coredump */
/* read/write */
1) $ 3088297 us | } /* do_coredump */
1) $ 2953330 us | } /* do_coredump */
1) $ 2647784 us | } /* do_coredump */
3) $ 2271315 us | }
Change-Id: Id2c681a364ce96d98c70329abdf4a64f6d0b405d