X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;f=src%2Flttngtop.c;h=bfae663182c0cb89a9dd0d59da74a5627d66f09a;hb=bab469fc468832ae02c61e24bf3afaba24228c09;hp=b9646e0a3b1dbebea5037bd45cc325e1da7ae7b3;hpb=863dc4851aa3a0d7d7673353235cea0442ebbd1d;p=lttngtop.git diff --git a/src/lttngtop.c b/src/lttngtop.c index b9646e0..bfae663 100644 --- a/src/lttngtop.c +++ b/src/lttngtop.c @@ -59,6 +59,7 @@ const char *opt_input_path; static int opt_textdump; static int opt_child; +static int opt_begin; int quit = 0; @@ -91,6 +92,7 @@ enum { OPT_HOSTNAME, OPT_RELAY_HOSTNAME, OPT_KPROBES, + OPT_BEGIN, }; static struct poptOption long_options[] = { @@ -98,6 +100,7 @@ static struct poptOption long_options[] = { { "help", 'h', POPT_ARG_NONE, NULL, OPT_HELP, NULL, NULL }, { "textdump", 't', POPT_ARG_NONE, NULL, OPT_TEXTDUMP, NULL, NULL }, { "child", 'f', POPT_ARG_NONE, NULL, OPT_CHILD, NULL, NULL }, + { "begin", 'b', POPT_ARG_NONE, NULL, OPT_BEGIN, NULL, NULL }, { "pid", 'p', POPT_ARG_STRING, &opt_tid, OPT_PID, NULL, NULL }, { "hostname", 'n', POPT_ARG_STRING, &opt_hostname, OPT_HOSTNAME, NULL, NULL }, { "relay-hostname", 'r', POPT_ARG_STRING, &opt_relay_hostname, @@ -545,6 +548,8 @@ void usage(FILE *fp) 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"); + fprintf(fp, " -r, --relay-hostname Network live streaming : hostname of the lttng-relayd (default port)\n"); + fprintf(fp, " -b, --begin Network live streaming : read the trace for the beginning of the recording\n"); } /* @@ -664,6 +669,10 @@ static int parse_options(int argc, char **argv) tmp_str = strtok(NULL, ","); } break; + case OPT_BEGIN: + /* start reading the live trace from the beginning */ + opt_begin = 1; + break; case OPT_HOSTNAME: toggle_filter = 1; tmp_str = strtok(opt_hostname, ","); @@ -854,7 +863,6 @@ int bt_context_add_traces_recursive(struct bt_context *ctx, const char *path, metafd = openat(dirfd, "metadata", O_RDONLY); if (metafd < 0) { close(dirfd); - ret = -1; continue; } else { int trace_id; @@ -1036,7 +1044,7 @@ int main(int argc, char **argv) #endif /* LTTNGTOP_MMAP_LIVE */ } else if (!opt_input_path && remote_live) { /* network live */ - ret = setup_network_live(opt_relay_hostname); + ret = setup_network_live(opt_relay_hostname, opt_begin); if (ret < 0) { goto end; }