X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=ustctl%2Fmarker_cmds.c;h=8bcab832dd10a59e2c181c11a47c0b230cd8e00b;hb=b521931e0000388ff9080d46719936be98af54c6;hp=6544669051bebb6d0e5109aa9945c71aa8d08ff8;hpb=cacf036243594e11fc8a7e0f47f07af97a79042f;p=ust.git diff --git a/ustctl/marker_cmds.c b/ustctl/marker_cmds.c index 6544669..8bcab83 100644 --- a/ustctl/marker_cmds.c +++ b/ustctl/marker_cmds.c @@ -24,22 +24,21 @@ static int list_markers(int argc, char *argv[]) { - struct marker_status *cmsf = NULL; - int i; - pid_t pid; + struct ust_marker_status *cmsf = NULL; + int i, sock; - pid = parse_pid(argv[1]); + sock = parse_and_connect_pid(argv[1]); - if (ustctl_get_cmsf(&cmsf, pid)) { - ERR("error while trying to list markers for PID %u\n", pid); + if (ustctl_get_cmsf(sock, &cmsf)) { + ERR("error while trying to list markers for PID %s\n", argv[1]); return -1; } for (i = 0; cmsf[i].channel; i++) { - printf("{PID: %u, channel/marker: %s/%s, " + printf("{PID: %s, channel/marker: %s/%s, " "state: %u, fmt: %s}\n", - (unsigned int) pid, + argv[1], cmsf[i].channel, - cmsf[i].marker, + cmsf[i].ust_marker, cmsf[i].state, cmsf[i].fs); } @@ -49,11 +48,10 @@ static int list_markers(int argc, char *argv[]) static int enable_marker(int argc, char *argv[]) { - int i, result = 0; - pid_t pid; + int i, sock, result = 0; char *channel, *marker; - pid = parse_pid(argv[1]); + sock = parse_and_connect_pid(argv[1]); for (i = 3; i < argc; i++) { channel = NULL; @@ -68,9 +66,9 @@ static int enable_marker(int argc, char *argv[]) if (marker) free(marker); } - if (ustctl_set_marker_state(argv[2], channel, marker, 1, pid)) { - PERROR("error while trying to enable marker %s with PID %u", - argv[i], pid); + if (ustctl_set_ust_marker_state(sock, argv[2], channel, marker, 1)) { + PERROR("error while trying to enable marker %s with PID %s", + argv[i], argv[1]); result = -1; } free(channel); @@ -82,11 +80,10 @@ static int enable_marker(int argc, char *argv[]) static int disable_marker(int argc, char *argv[]) { - int i, result = 0; - pid_t pid; + int i, sock, result = 0; char *channel, *marker; - pid = parse_pid(argv[1]); + sock = parse_and_connect_pid(argv[1]); for (i = 3; i < argc; i++) { channel = NULL; @@ -101,9 +98,9 @@ static int disable_marker(int argc, char *argv[]) free(marker); return -1; } - if (ustctl_set_marker_state(argv[2], channel, marker, 0, pid)) { - PERROR("error while trying to disable marker %s with PID %u", - argv[i], pid); + if (ustctl_set_ust_marker_state(sock, argv[2], channel, marker, 0)) { + PERROR("error while trying to disable marker %s with PID %s", + argv[i], argv[1]); result = -1; } free(channel); @@ -113,7 +110,7 @@ static int disable_marker(int argc, char *argv[]) return result; } -struct cli_cmd __cli_cmds marker_cmds[] = { +struct cli_cmd __cli_cmds ust_marker_cmds[] = { { .name = "list-markers", .description = "List markers for a given pid",