#include "../command.h"
-#define PRINT_LINE_LEN 80
-
static char *opt_channel_name;
static char *opt_session_name;
static int opt_kernel;
OPT_JUL,
OPT_LOG4J,
OPT_LIST_OPTIONS,
+ OPT_LIST,
};
static struct lttng_handle *handle;
CONTEXT_PERF_CPU_COUNTER = 13,
CONTEXT_PERF_THREAD_COUNTER = 14,
CONTEXT_APP_CONTEXT = 15,
+ CONTEXT_INTERRUPTIBLE = 16,
+ CONTEXT_PREEMPTIBLE = 17,
+ CONTEXT_NEED_RESCHEDULE = 18,
+ CONTEXT_MIGRATABLE = 19,
};
/*
{"jul", 'j', POPT_ARG_NONE, 0, OPT_JUL, 0, 0},
{"log4j", 'l', POPT_ARG_NONE, 0, OPT_LOG4J, 0, 0},
{"type", 't', POPT_ARG_STRING, &opt_type, OPT_TYPE, 0, 0},
+ {"list", 0, POPT_ARG_NONE, NULL, OPT_LIST, NULL, NULL},
{"list-options", 0, POPT_ARG_NONE, NULL, OPT_LIST_OPTIONS, NULL, NULL},
{0, 0, 0, 0, 0, 0, 0}
};
{ "vppid", CONTEXT_VPPID },
{ "hostname", CONTEXT_HOSTNAME },
{ "ip", CONTEXT_IP },
+ { "interruptible", CONTEXT_INTERRUPTIBLE },
+ { "preemptible", CONTEXT_PREEMPTIBLE },
+ { "need_reschedule", CONTEXT_NEED_RESCHEDULE },
+ { "migratable", CONTEXT_MIGRATABLE },
/* Perf options */
*/
static void print_ctx_type(FILE *ofp)
{
- const char *indent = " ";
- int indent_len = strlen(indent);
- int len, i = 0;
+ int i = 0;
- fprintf(ofp, "%s", indent);
- len = indent_len;
while (ctx_opts[i].symbol != NULL) {
if (!ctx_opts[i].hide_help) {
- if (len > indent_len) {
- if (len + strlen(ctx_opts[i].symbol) + 2
- >= PRINT_LINE_LEN) {
- fprintf(ofp, ",\n");
- fprintf(ofp, "%s", indent);
- len = indent_len;
- } else {
- len += fprintf(ofp, ", ");
- }
- }
- len += fprintf(ofp, "%s", ctx_opts[i].symbol);
+ fprintf(ofp, "%s\n", ctx_opts[i].symbol);
}
i++;
}
if (!type->opt) {
PERROR("malloc ctx_type options");
destroy_ctx_type(type);
+ type = NULL;
goto end;
}
end:
case OPT_HELP:
usage(stdout);
goto end;
+ case OPT_LIST:
+ print_ctx_type(stdout);
+ goto end;
case OPT_TYPE:
{
type = get_context_type(opt_type);