Fix: Add vpid, vppid and vtid info in add-context help
[lttng-tools.git] / src / bin / lttng / commands / add_context.c
index 4904d2772b5181bb835d928595671b456b38f562..d034d0b86d1e13f94b5a58c2cc7911a54b48e78c 100644 (file)
@@ -67,6 +67,7 @@ enum context_type {
        CONTEXT_VPPID        = 9,
        CONTEXT_PTHREAD_ID   = 10,
        CONTEXT_HOSTNAME     = 11,
+       CONTEXT_IP           = 12,
 };
 
 /*
@@ -203,6 +204,7 @@ const struct ctx_opts {
        { "ppid", CONTEXT_PPID },
        { "vppid", CONTEXT_VPPID },
        { "hostname", CONTEXT_HOSTNAME },
+       { "ip", CONTEXT_IP },
        /* Perf options */
        PERF_HW(cpu-cycles, CPU_CYCLES),
        PERF_HW(cycles, CPU_CYCLES),
@@ -320,6 +322,9 @@ static void usage(FILE *ofp)
        fprintf(ofp, "                           TYPE can be one of the strings below:\n");
        print_ctx_type(ofp);
        fprintf(ofp, "\n");
+       fprintf(ofp, "Note that the vpid, vppid and vtid context types represent the virtual process id,\n"
+                       "virtual parent process id and virtual thread id as seen from the current execution context\n"
+                       "as opposed to the pid, ppid and tid which are kernel internal data structures.\n\n");
        fprintf(ofp, "Example:\n");
        fprintf(ofp, "This command will add the context information 'prio' and two perf\n"
                        "counters (hardware branch misses and cache misses), to all channels\n"
@@ -472,13 +477,13 @@ int cmd_add_context(int argc, const char **argv)
                        }
 
                        type->opt = &ctx_opts[index];
-                       if (type->opt->ctx_type == -1) {
+                       if (type->opt->symbol == NULL) {
                                ERR("Unknown context type %s", opt_type);
                                free(type);
                                ret = CMD_ERROR;
                                goto end;
                        } else {
-                               cds_list_add(&type->list, &ctx_type_list.head);
+                               cds_list_add_tail(&type->list, &ctx_type_list.head);
                        }
                        break;
                case OPT_USERSPACE:
This page took 0.024987 seconds and 4 git commands to generate.