aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2009-12-09 22:12:07 -0500
committerSteven Rostedt <rostedt@goodmis.org>2009-12-09 22:12:07 -0500
commit2d802a522d04d89fc9277cd5c79dafb7af62fae4 (patch)
treec9498fbf39d1dba8b9f1e41d45ebd97f9e79edcd
parenteef499fb3baf1ae058520bf16ced41c1dd45f9c1 (diff)
Do not record if no plugin or event was specified
An new user may just try doing a record and see what happens, and will be surprised when there is no output to show. This patch adds an error message if no event or plugin is specified. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
-rw-r--r--trace-cmd.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/trace-cmd.c b/trace-cmd.c
index 22441b8..52ae03c 100644
--- a/trace-cmd.c
+++ b/trace-cmd.c
@@ -1191,7 +1191,7 @@ int main (int argc, char **argv)
1191 case 'o': 1191 case 'o':
1192 if (!record) 1192 if (!record)
1193 die("start does not take output\n" 1193 die("start does not take output\n"
1194 "Did you mean 'record'?\n"); 1194 "Did you mean 'record'?");
1195 if (output) 1195 if (output)
1196 die("only one output file allowed"); 1196 die("only one output file allowed");
1197 output = optarg; 1197 output = optarg;
@@ -1264,6 +1264,9 @@ int main (int argc, char **argv)
1264 die("Command start does not take any commands\n" 1264 die("Command start does not take any commands\n"
1265 "Did you mean 'record'?"); 1265 "Did you mean 'record'?");
1266 1266
1267 if (!events && !plugin)
1268 die("no event or plugin was specified... aborting");
1269
1267 if (record) { 1270 if (record) {
1268 if (output) 1271 if (output)
1269 output_file = output; 1272 output_file = output;