X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=ustctl%2Fustctl.c;h=bf149d11f8b6b4c666467f91505d5686783d3076;hb=a3adfb05f9a9d0bb3f49b6696a0c233d6e9f6626;hp=822ef4c9f505b3be009856510bf4972b52457c96;hpb=e77b8e8e6202b3a5ff87dc20553d2fad9ed5ff2e;p=ust.git diff --git a/ustctl/ustctl.c b/ustctl/ustctl.c index 822ef4c..bf149d1 100644 --- a/ustctl/ustctl.c +++ b/ustctl/ustctl.c @@ -22,8 +22,7 @@ #include #include -#include "ustcomm.h" -#include "ustcmd.h" +#include "ust/ustcmd.h" #include "usterr.h" enum command { @@ -33,6 +32,7 @@ enum command { STOP_TRACE, DESTROY_TRACE, LIST_MARKERS, + LIST_TRACE_EVENTS, ENABLE_MARKER, DISABLE_MARKER, GET_ONLINE_PIDS, @@ -40,6 +40,9 @@ enum command { SET_SUBBUF_NUM, GET_SUBBUF_SIZE, GET_SUBBUF_NUM, + GET_SOCK_PATH, + SET_SOCK_PATH, + FORCE_SWITCH, UNKNOWN }; @@ -64,11 +67,15 @@ Commands:\n\ --destroy-trace\t\t\tDestroy the trace\n\ --set-subbuf-size \"CHANNEL/bytes\"\tSet the size of subbuffers per channel\n\ --set-subbuf-num \"CHANNEL/n\"\tSet the number of subbuffers per channel\n\ + --set-sock-path\t\t\tSet the path of the daemon socket\n\ --get-subbuf-size \"CHANNEL\"\t\tGet the size of subbuffers per channel\n\ --get-subbuf-num \"CHANNEL\"\t\tGet the number of subbuffers per channel\n\ + --get-sock-path\t\t\tGet the path of the daemon socket\n\ --enable-marker \"CHANNEL/MARKER\"\tEnable a marker\n\ --disable-marker \"CHANNEL/MARKER\"\tDisable a marker\n\ --list-markers\t\t\tList the markers of the process, their\n\t\t\t\t\t state and format string\n\ + --list-trace-events\t\t\tList the trace-events of the process\n\ + --force-switch\t\t\tForce a subbuffer switch\n\ \ "); } @@ -89,6 +96,7 @@ int parse_opts_long(int argc, char **argv, struct ust_opts *opts) { "stop-trace", 0, 0, STOP_TRACE }, { "destroy-trace", 0, 0, DESTROY_TRACE }, { "list-markers", 0, 0, LIST_MARKERS }, + { "list-trace-events", 0, 0, LIST_TRACE_EVENTS}, { "enable-marker", 1, 0, ENABLE_MARKER }, { "disable-marker", 1, 0, DISABLE_MARKER }, { "help", 0, 0, 'h' }, @@ -97,6 +105,9 @@ int parse_opts_long(int argc, char **argv, struct ust_opts *opts) { "set-subbuf-num", 1, 0, SET_SUBBUF_NUM }, { "get-subbuf-size", 1, 0, GET_SUBBUF_SIZE }, { "get-subbuf-num", 1, 0, GET_SUBBUF_NUM }, + { "get-sock-path", 0, 0, GET_SOCK_PATH }, + { "set-sock-path", 1, 0, SET_SOCK_PATH }, + { "force-switch", 0, 0, FORCE_SWITCH }, { 0, 0, 0, 0 } }; @@ -121,6 +132,7 @@ int parse_opts_long(int argc, char **argv, struct ust_opts *opts) case SET_SUBBUF_NUM: case GET_SUBBUF_SIZE: case GET_SUBBUF_NUM: + case SET_SOCK_PATH: opts->regex = strdup(optarg); break; @@ -138,7 +150,7 @@ int parse_opts_long(int argc, char **argv, struct ust_opts *opts) if (argc - optind > 0 && opts->cmd != GET_ONLINE_PIDS) { int i; int pididx=0; - opts->pids = malloc((argc-optind+1) * sizeof(pid_t)); + opts->pids = zmalloc((argc-optind+1) * sizeof(pid_t)); for(i=optind; i