X-Git-Url: http://git.lttng.org/?p=ust.git;a=blobdiff_plain;f=libustcmd%2Fustcmd.c;h=930c078fcd9510aebad1eff190d0817a5280e092;hp=d22fb5236f4b01f707a554c313216f4e84cfeec2;hb=763f41e58126afdc361006831a7daca773a9627a;hpb=240578adf0e495c1cbe5d7558ed8ef72a5bf02a7 diff --git a/libustcmd/ustcmd.c b/libustcmd/ustcmd.c index d22fb52..930c078 100644 --- a/libustcmd/ustcmd.c +++ b/libustcmd/ustcmd.c @@ -101,6 +101,55 @@ int ustcmd_set_marker_state(const char *mn, int state, pid_t pid) return 0; } +/** + * Set subbuffer size. + * + * @param channel_size Channel name and size + * @param pid Traced process ID + * @return 0 if successful, or error + */ +int ustcmd_set_subbuf_size(const char *channel_size, pid_t pid) +{ + char *cmd; + int result; + + asprintf(&cmd, "%s %s", "set_subbuf_size", channel_size); + + result = ustcmd_send_cmd(cmd, pid, NULL); + if (result) { + free(cmd); + return 1; + } + + free(cmd); + return 0; +} + +/** + * Set subbuffer num. + * + * @param channel_num Channel name and num + * @param pid Traced process ID + * @return 0 if successful, or error + */ +int ustcmd_set_subbuf_num(const char *channel_size, pid_t pid) +{ + char *cmd; + int result; + + asprintf(&cmd, "%s %s", "set_subbuf_num", channel_size); + + result = ustcmd_send_cmd(cmd, pid, NULL); + if (result) { + free(cmd); + return 1; + } + + free(cmd); + return 0; +} + + /** * Destroys an UST trace according to a PID. * @@ -173,6 +222,24 @@ int ustcmd_start_trace(pid_t pid) return 0; } +/** + * Alloc an UST trace according to a PID. + * + * @param pid Traced process ID + * @return 0 if successful, or error USTCMD_ERR_GEN + */ +int ustcmd_alloc_trace(pid_t pid) +{ + int result; + + result = ustcmd_send_cmd("trace_alloc", pid, NULL); + if (result) { + return USTCMD_ERR_GEN; + } + + return 0; +} + /** * Stops an UST trace according to a PID. *