kprobes usage
[lttngtop.git] / src / lttngtop.c
index d1b36a3e31e17ac20d7493c7e7c0e1849912747b..024dc5b4e2b7d562319498757f05a2d60b4f2554 100644 (file)
@@ -514,6 +514,7 @@ void usage(FILE *fp)
        fprintf(fp, "  -p, --pid                Comma-separated list of PIDs to display\n");
        fprintf(fp, "  -f, --child              Follow threads associated with selected PIDs\n");
        fprintf(fp, "  -n, --hostname           Comma-separated list of hostnames to display (require hostname context in trace)\n");
+       fprintf(fp, "  -k, --kprobes            Comma-separated list of kprobes to insert (same format as lttng enable-event)\n");
 }
 
 /*
@@ -1230,9 +1231,11 @@ int setup_live_tracing()
                goto error_session;
        }
 
-       ret = enable_kprobes(handle, channel_name);
-       if (ret < 0) {
-               goto error_session;
+       if (lttngtop.kprobes_table) {
+               ret = enable_kprobes(handle, channel_name);
+               if (ret < 0) {
+                       goto error_session;
+               }
        }
 
        kctxpid.ctx = LTTNG_EVENT_CONTEXT_PID;
@@ -1276,6 +1279,7 @@ int main(int argc, char **argv)
        struct mmap_stream *mmap_info;
        unsigned long mmap_len;
 
+       init_lttngtop();
        ret = parse_options(argc, argv);
        if (ret < 0) {
                fprintf(stdout, "Error parsing options.\n\n");
@@ -1290,7 +1294,6 @@ int main(int argc, char **argv)
                        signal(SIGTERM, handle_textdump_sigterm);
                        signal(SIGINT, handle_textdump_sigterm);
                }
-               init_lttngtop();
                ret = setup_live_tracing();
                if (ret < 0) {
                        goto end;
@@ -1335,7 +1338,7 @@ int main(int argc, char **argv)
 
                goto end;
        } else {
-               init_lttngtop();
+               //init_lttngtop();
 
                bt_ctx = bt_context_create();
                ret = bt_context_add_traces_recursive(bt_ctx, opt_input_path, "ctf", NULL);
This page took 0.022843 seconds and 4 git commands to generate.