X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Flib%2Flttng-ctl%2Flttng-ctl.c;h=ff57a0d1a7a70237e396274b8a4847f1194beb3d;hp=a398e34d6d7b3c825bb8e4a4e0802412ae96e83f;hb=834978fd9e2392f20867351ca99bf7bdf31b4f56;hpb=5a510c9fc5ac8b5292a497192bd47aeec07112e3 diff --git a/src/lib/lttng-ctl/lttng-ctl.c b/src/lib/lttng-ctl/lttng-ctl.c index a398e34d6..ff57a0d1a 100644 --- a/src/lib/lttng-ctl/lttng-ctl.c +++ b/src/lib/lttng-ctl/lttng-ctl.c @@ -1323,6 +1323,35 @@ int lttng_list_tracepoint_fields(struct lttng_handle *handle, return ret / sizeof(struct lttng_event_field); } +/* + * Lists all available kernel system calls. Allocates and sets the contents of + * the events array. + * + * Returns the number of lttng_event entries in events; on error, returns a + * negative value. + */ +int lttng_list_syscalls(struct lttng_event **events) +{ + int ret; + struct lttcomm_session_msg lsm; + + if (!events) { + return -LTTNG_ERR_INVALID; + } + + memset(&lsm, 0, sizeof(lsm)); + lsm.cmd_type = LTTNG_LIST_SYSCALLS; + /* Force kernel domain for system calls. */ + lsm.domain.type = LTTNG_DOMAIN_KERNEL; + + ret = lttng_ctl_ask_sessiond(&lsm, (void **) events); + if (ret < 0) { + return ret; + } + + return ret / sizeof(struct lttng_event); +} + /* * Returns a human readable string describing * the error code (a negative value).