mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] trace-cmd: Fix err msg for record w/o the -e option
@ 2017-11-17  8:58 Vladislav Valtchev (VMware)
  0 siblings, 0 replies; only message in thread
From: Vladislav Valtchev (VMware) @ 2017-11-17  8:58 UTC (permalink / raw)
  To: rostedt, linux-kernel; +Cc: y.karadz, Vladislav Valtchev (VMware)

Currently, running just `trace-cmd record` without telling which events have to
be traced (-e) nor which tracer to use (-p), trace-cmd dies with the message:
        No instances reference??
Which might not be helpful to new users of the tool. This small patch removes
an early check in trace_record() allowing, in the same case, the execution to
continue a few more statements and fail more gracefully in the function
check_doing_something() with the following message:
        no event or plugin was specified... aborting

Signed-off-by: Vladislav Valtchev (VMware) <vladislav.valtchev@gmail.com>
---
 trace-record.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/trace-record.c b/trace-record.c
index 06fc0e6..e2fb731 100644
--- a/trace-record.c
+++ b/trace-record.c
@@ -4722,11 +4722,9 @@ void trace_record (int argc, char **argv)
 	 * If top_instance doesn't have any plugins or events, then
 	 * remove it from being processed.
 	 */
-	if (!extract && !__check_doing_something(&top_instance)) {
-		if (!buffer_instances)
-			die("No instances reference??");
+	if (!extract && !__check_doing_something(&top_instance))
 		first_instance = buffer_instances;
-	} else
+	else
 		topt = 1;
 
 	update_first_instance(instance, topt);
-- 
2.14.1

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-11-17  8:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-17  8:58 [PATCH] trace-cmd: Fix err msg for record w/o the -e option Vladislav Valtchev (VMware)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®