X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;f=ustctl%2Fustctl.c;h=35bea7ae6b3d84f17c1493e378593149f4b6e90c;hb=1e620c5350cfbd0b0be4122547115dd4da503bcf;hp=0e8e01d236de2eec52231bdd8c63f7dd594b6bd6;hpb=b0a5a08ba8fc4619baeead70e012c83f6d502d24;p=ust.git diff --git a/ustctl/ustctl.c b/ustctl/ustctl.c index 0e8e01d..35bea7a 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 { @@ -38,6 +37,11 @@ enum command { GET_ONLINE_PIDS, SET_SUBBUF_SIZE, SET_SUBBUF_NUM, + GET_SUBBUF_SIZE, + GET_SUBBUF_NUM, + GET_SOCK_PATH, + SET_SOCK_PATH, + FORCE_SWITCH, UNKNOWN }; @@ -56,14 +60,20 @@ void usage(void) \n\ Commands:\n\ --create-trace\t\t\tCreate trace\n\ + --alloc-trace\t\t\tAlloc trace\n\ --start-trace\t\t\tStart tracing\n\ --stop-trace\t\t\tStop tracing\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\ + --force-switch\t\t\tForce a subbuffer switch\n\ \ "); } @@ -90,6 +100,11 @@ int parse_opts_long(int argc, char **argv, struct ust_opts *opts) { "online-pids", 0, 0, GET_ONLINE_PIDS }, { "set-subbuf-size", 1, 0, SET_SUBBUF_SIZE }, { "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 } }; @@ -112,6 +127,9 @@ int parse_opts_long(int argc, char **argv, struct ust_opts *opts) case DISABLE_MARKER: case SET_SUBBUF_SIZE: case SET_SUBBUF_NUM: + case GET_SUBBUF_SIZE: + case GET_SUBBUF_NUM: + case SET_SOCK_PATH: opts->regex = strdup(optarg); break; @@ -129,7 +147,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