Clearer error message and usage for network live
authorJulien Desfossez <jdesfossez@efficios.com>
Thu, 28 Nov 2013 01:31:12 +0000 (20:31 -0500)
committerJulien Desfossez <jdesfossez@efficios.com>
Thu, 28 Nov 2013 01:31:12 +0000 (20:31 -0500)
Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
src/lttngtop.c

index bfae663182c0cb89a9dd0d59da74a5627d66f09a..9baaff3f94bfc0aa9b8b0a9699a5f03197eb19de 100644 (file)
@@ -540,8 +540,8 @@ void init_lttngtop()
 void usage(FILE *fp)
 {
        fprintf(fp, "LTTngTop %s\n\n", VERSION);
-       fprintf(fp, "Usage : lttngtop [OPTIONS] [TRACE]\n");
-       fprintf(fp, "  TRACE                    Path to the trace to analyse (no trace path for live tracing)\n");
+       fprintf(fp, "Usage : lttngtop [OPTIONS] TRACE\n");
+       fprintf(fp, "  TRACE                    Path to the trace to analyse (-r for network live tracing, nothing for mmap live streaming)\n");
        fprintf(fp, "  -h, --help               This help message\n");
        fprintf(fp, "  -t, --textdump           Display live events in text-only\n");
        fprintf(fp, "  -p, --pid                Comma-separated list of PIDs to display\n");
@@ -1039,7 +1039,10 @@ int main(int argc, char **argv)
 
                goto end;
 #else
-               fprintf(stderr, "Mmap live support not compiled\n");
+               fprintf(stderr, "[ERROR] Mmap live support not compiled, specify a "
+                               "trace directory or -r <relayd hostname/IP>\n");
+               usage(stdout);
+               ret = -1;
                goto end;
 #endif /* LTTNGTOP_MMAP_LIVE */
        } else if (!opt_input_path && remote_live) {
@@ -1080,9 +1083,11 @@ int main(int argc, char **argv)
        quit = 1;
        pthread_join(timer_thread, NULL);
 
+       ret = 0;
+
 end:
        if (bt_ctx)
                bt_context_put(bt_ctx);
 
-       return 0;
+       return ret;
 }
This page took 0.024408 seconds and 4 git commands to generate.