X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;f=ustctl%2Fchannel_cmds.c;fp=ustctl%2Fchannel_cmds.c;h=315fd56f0a50211e031ff52ba77d8e561c47919f;hb=8b26d56b9988ac0c09999c14a08bc28d42551367;hp=2ccf460ad2b96671094bd832a5364d73e505f34b;hpb=bc549f166d7ece1bfd6d1a937019a7568b38b332;p=ust.git diff --git a/ustctl/channel_cmds.c b/ustctl/channel_cmds.c index 2ccf460..315fd56 100644 --- a/ustctl/channel_cmds.c +++ b/ustctl/channel_cmds.c @@ -24,12 +24,11 @@ static int set_subbuf_size(int argc, char *argv[]) { - int result = 0; - pid_t pid; + int sock, result = 0; char *channel = NULL; unsigned int size; - pid = parse_pid(argv[1]); + sock = parse_and_connect_pid(argv[1]); if (scan_ch_and_num(argv[3], &channel, &size)) { fprintf(stderr, "Failed to scan channel and size from" @@ -38,10 +37,10 @@ static int set_subbuf_size(int argc, char *argv[]) free(channel); return -1; } - if (ustctl_set_subbuf_size(argv[2], channel, size, pid)) { + if (ustctl_set_subbuf_size(sock, argv[2], channel, size)) { ERR("error while trying to set the size of subbuffers " - "for PID %u\n", - pid); + "for PID %s\n", + argv[1]); result = -1; } @@ -52,12 +51,11 @@ static int set_subbuf_size(int argc, char *argv[]) static int set_subbuf_num(int argc, char *argv[]) { - int result = 0; - pid_t pid; + int sock, result = 0; char *channel = NULL; unsigned int num; - pid = parse_pid(argv[1]); + sock = parse_and_connect_pid(argv[1]); if (scan_ch_and_num(argv[3], &channel, &num)) { fprintf(stderr, "Failed to scan channel and number from" @@ -66,9 +64,9 @@ static int set_subbuf_num(int argc, char *argv[]) free(channel); return -1; } - if (ustctl_set_subbuf_num(argv[2], channel, num, pid)) { - ERR("error while trying to set the number of subbuffers for PID %u\n", - pid); + if (ustctl_set_subbuf_num(sock, argv[2], channel, num)) { + ERR("error while trying to set the number of subbuffers for PID %s\n", + argv[1]); result = -1; } @@ -79,14 +77,14 @@ static int set_subbuf_num(int argc, char *argv[]) static int get_subbuf_size(int argc, char *argv[]) { - pid_t pid; + int sock; unsigned int size; - pid = parse_pid(argv[1]); + sock = parse_and_connect_pid(argv[1]); - if ((size = ustctl_get_subbuf_size(argv[2], argv[3], pid)) < 0) { - ERR("error while trying to get the subbuffer size from PID %u\n", - pid); + if ((size = ustctl_get_subbuf_size(sock, argv[2], argv[3])) < 0) { + ERR("error while trying to get the subbuffer size from PID %s\n", + argv[1]); return -1; } @@ -97,14 +95,14 @@ static int get_subbuf_size(int argc, char *argv[]) static int get_subbuf_num(int argc, char *argv[]) { - pid_t pid; + int sock; unsigned int num; - pid = parse_pid(argv[1]); + sock = parse_and_connect_pid(argv[1]); - if ((num = ustctl_get_subbuf_num(argv[2], argv[3], pid)) < 0) { - ERR("error while trying to get the subbuffer size from PID %u\n", - pid); + if ((num = ustctl_get_subbuf_num(sock, argv[2], argv[3])) < 0) { + ERR("error while trying to get the subbuffer size from PID %s\n", + argv[1]); return -1; }