Fix: lttng add_context.c: use zmalloc
[lttng-tools.git] / src / bin / lttng / commands / add_context.c
index 6483c9891d83038e929b3a1b96fd3f5cd6ab07c4..8806400575783924133eed948d6b8ac84d61a8e1 100644 (file)
@@ -322,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"
@@ -466,7 +469,7 @@ int cmd_add_context(int argc, const char **argv)
                                goto end;
                        }
 
-                       type = malloc(sizeof(struct ctx_type));
+                       type = zmalloc(sizeof(struct ctx_type));
                        if (type == NULL) {
                                perror("malloc ctx_type");
                                ret = CMD_FATAL;
This page took 0.025963 seconds and 4 git commands to generate.