perf record: Introduce special handling for pipe output
perf record: Introduce special handling for pipe output

Adds special treatment for stdout - if the user specifies '-o -'
to perf record, the intent is that the event stream be written
to stdout rather than to a disk file.

Also, redirect stdout of forked child to stderr - in pipe mode,
stdout of the forked child interferes with the stdout perf
stream, so redirect it to stderr where it can still be seen but
won't be mixed in with the perf output.

Signed-off-by: Tom Zanussi <ca42f6846873622f2a6dc51a5106ba83ffbdaf95@gmail.com>
Acked-by: Thomas Gleixner <00e4cf8f46a57000a44449bf9dd8cbbcc209fd2a@linutronix.de>
Cc: e8a1bf9163cb25e93cfd6540f223b3872ea7ee55@gmail.com
Cc: 43232e92d70cc7aa53504ad0397085ee47bad87f@goodmis.org
Cc: 13f128951b64a39a6efb8135a8cb8fd3e86618aa@bx.jp.nec.com
Cc: 293abb6b76d7791c0732cc517d38c4b5c734b87f@ghostprotocols.net
LKML-Reference: <1270184365-8281-3-git-send-email-ca42f6846873622f2a6dc51a5106ba83ffbdaf95@gmail.com>
Signed-off-by: Ingo Molnar <9dbbbf0688fedc85ad4da37637f1a64b8c718ee2@elte.hu>

TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas