Messages in this thread | | | Date | Thu, 9 Sep 2010 11:41:06 -0300 | From | Arnaldo Carvalho de Melo <> | Subject | Re: perf events over (net) console? |
| |
Em Thu, Sep 09, 2010 at 03:21:00PM +0200, Frederic Weisbecker escreveu: > In the beginning this could wrap into perf record - | perf pipe | netcat > and so, until we get the splice support.
Isn't this what Tom Zanussi's live mode, that we have already special casing 'perf record -' does?
Look at these tools/perf/builtin-record.c excerpts:
static int __cmd_record(int argc, const char **argv) { <SNIP> if (!strcmp(output_name, "-")) pipe_output = 1; <SNIP> if (pipe_output) output = STDOUT_FILENO; else output = open(output_name, flags, S_IRUSR | S_IWUSR); <SNIP> if (pipe_output) { err = perf_header__write_pipe(output); <SNIP> if (pipe_output) { err = event__synthesize_attrs(&session->header, process_synthesized_event, session) <SNIP> }
Harald, can you please take a look at the comment for these commits:
commit 454c407ec17a0c63e4023ac0877d687945a7df4a Author: Tom Zanussi <tzanussi@gmail.com> Date: Sat May 1 01:41:20 2010 -0500
perf: add perf-inject builtin
commit 529870e37473a9fc609078f03cc5b4148cf06a87 Author: Tom Zanussi <tzanussi@gmail.com> Date: Thu Apr 1 23:59:16 2010 -0500
perf record: Introduce special handling for pipe output
commit 8dc58101f2c838355d44402aa77646649d10dbec Author: Tom Zanussi <tzanussi@gmail.com> Date: Thu Apr 1 23:59:15 2010 -0500
perf: Add pipe-specific header read/write and event processing code
Using live mode you can stream to a perf.data for later analisys or do it live, piping it to trace scripts, etc.
Doing it using splice, talking directly to an in kernel mini-server, etc are all optimizations that we should think about, but if you can try using the live mode and see if it is ok, that would be good.
A mini binary with just record can come in handy if you like and should be rather easy to build, please let me know if you think it is a good idea and if you need help, lemme know.
- Arnaldo
| |