diff options
author | Steven Rostedt <srostedt@redhat.com> | 2010-02-24 21:05:14 -0500 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2010-02-24 21:50:50 -0500 |
commit | 416c3be0ec78f6b9e58c560378a5bbb211f0c691 (patch) | |
tree | 09b20660611d3d9ce53813d80238b84675d9aec9 | |
parent | 3ed7f0839f5d184b24f60f77913f3ce2bf0df56a (diff) |
trace-cmd: Add -t to force use of TCP for live connection
Add the option -t for use with -N on record, to force the use
of TCP instead of UDP in recording the trace output. This makes
the connection more reliable at the cost of performance and
noise in the trace.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
-rw-r--r-- | trace-cmd.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/trace-cmd.c b/trace-cmd.c index 432523e..49110f3 100644 --- a/trace-cmd.c +++ b/trace-cmd.c | |||
@@ -1253,7 +1253,7 @@ void usage(char **argv) | |||
1253 | "usage:\n" | 1253 | "usage:\n" |
1254 | " %s record [-v][-e event [-f filter]][-p plugin][-F][-d][-o file] \\\n" | 1254 | " %s record [-v][-e event [-f filter]][-p plugin][-F][-d][-o file] \\\n" |
1255 | " [-s usecs][-O option ][-l func][-g func][-n func]\n" | 1255 | " [-s usecs][-O option ][-l func][-g func][-n func]\n" |
1256 | " [-P pid][-N host:port][command ...]\n" | 1256 | " [-P pid][-N host:port][-t][command ...]\n" |
1257 | " -e run command with event enabled\n" | 1257 | " -e run command with event enabled\n" |
1258 | " -f filter for previous -e event\n" | 1258 | " -f filter for previous -e event\n" |
1259 | " -p run command with plugin enabled\n" | 1259 | " -p run command with plugin enabled\n" |
@@ -1268,6 +1268,7 @@ void usage(char **argv) | |||
1268 | " -O option to enable (or disable)\n" | 1268 | " -O option to enable (or disable)\n" |
1269 | " -s sleep interval between recording (in usecs) [default: 1000]\n" | 1269 | " -s sleep interval between recording (in usecs) [default: 1000]\n" |
1270 | " -N host:port to connect to (see listen)\n" | 1270 | " -N host:port to connect to (see listen)\n" |
1271 | " -t used with -N, forces use of tcp in live trace\n" | ||
1271 | "\n" | 1272 | "\n" |
1272 | " %s start [-e event][-p plugin][-d][-O option ][-P pid]\n" | 1273 | " %s start [-e event][-p plugin][-d][-O option ][-P pid]\n" |
1273 | " Uses same options as record, but does not run a command.\n" | 1274 | " Uses same options as record, but does not run a command.\n" |
@@ -1363,7 +1364,7 @@ int main (int argc, char **argv) | |||
1363 | (strcmp(argv[1], "start") == 0) || | 1364 | (strcmp(argv[1], "start") == 0) || |
1364 | ((extract = strcmp(argv[1], "extract") == 0))) { | 1365 | ((extract = strcmp(argv[1], "extract") == 0))) { |
1365 | 1366 | ||
1366 | while ((c = getopt(argc-1, argv+1, "+he:f:Fp:do:O:s:vg:l:n:P:N:")) >= 0) { | 1367 | while ((c = getopt(argc-1, argv+1, "+he:f:Fp:do:O:s:vg:l:n:P:N:t")) >= 0) { |
1367 | switch (c) { | 1368 | switch (c) { |
1368 | case 'h': | 1369 | case 'h': |
1369 | usage(argv); | 1370 | usage(argv); |
@@ -1463,6 +1464,9 @@ int main (int argc, char **argv) | |||
1463 | die("-N incompatible with -o"); | 1464 | die("-N incompatible with -o"); |
1464 | host = optarg; | 1465 | host = optarg; |
1465 | break; | 1466 | break; |
1467 | case 't': | ||
1468 | use_tcp = 1; | ||
1469 | break; | ||
1466 | } | 1470 | } |
1467 | } | 1471 | } |
1468 | 1472 | ||