X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;f=src%2Fcommon%2Fkernel-ctl%2Fkernel-ctl.c;h=ce8d8a0eb1f4ec4df60d388589be6ab209673b4f;hb=6e911cad03751b6814fddd65b19a592acdc2b7b7;hp=495301e5ff362cc85d9748fa4ad0ee60938b0490;hpb=309167d2a6f59d0c8cbf64eb23ba912cdea76a34;p=lttng-tools.git diff --git a/src/common/kernel-ctl/kernel-ctl.c b/src/common/kernel-ctl/kernel-ctl.c index 495301e5f..ce8d8a0eb 100644 --- a/src/common/kernel-ctl/kernel-ctl.c +++ b/src/common/kernel-ctl/kernel-ctl.c @@ -139,6 +139,30 @@ int kernctl_create_channel(int fd, struct lttng_channel_attr *chops) return ioctl(fd, LTTNG_KERNEL_CHANNEL, &channel); } +int kernctl_enable_syscall(int fd, const char *syscall_name) +{ + struct lttng_kernel_event event; + + memset(&event, 0, sizeof(event)); + strncpy(event.name, syscall_name, sizeof(event.name)); + event.name[sizeof(event.name) - 1] = '\0'; + event.instrumentation = LTTNG_KERNEL_SYSCALL; + event.u.syscall.disable = 0; + return ioctl(fd, LTTNG_KERNEL_EVENT, &event); +} + +int kernctl_disable_syscall(int fd, const char *syscall_name) +{ + struct lttng_kernel_event event; + + memset(&event, 0, sizeof(event)); + strncpy(event.name, syscall_name, sizeof(event.name)); + event.name[sizeof(event.name) - 1] = '\0'; + event.instrumentation = LTTNG_KERNEL_SYSCALL; + event.u.syscall.disable = 1; + return ioctl(fd, LTTNG_KERNEL_EVENT, &event); +} + int kernctl_create_stream(int fd) { return compat_ioctl_no_arg(fd, LTTNG_KERNEL_OLD_STREAM, @@ -188,7 +212,7 @@ int kernctl_add_context(int fd, struct lttng_kernel_context *ctx) old_ctx.ctx = ctx->ctx; /* only type that uses the union */ - if (ctx->ctx == LTTNG_KERNEL_CONTEXT_PERF_COUNTER) { + if (ctx->ctx == LTTNG_KERNEL_CONTEXT_PERF_CPU_COUNTER) { old_ctx.u.perf_counter.type = ctx->u.perf_counter.type; old_ctx.u.perf_counter.config = @@ -426,3 +450,9 @@ int kernctl_get_stream_id(int fd, uint64_t *stream_id) { return ioctl(fd, LTTNG_RING_BUFFER_GET_STREAM_ID, stream_id); } + +/* Returns the current timestamp. */ +int kernctl_get_current_timestamp(int fd, uint64_t *ts) +{ + return ioctl(fd, LTTNG_RING_BUFFER_GET_CURRENT_TIMESTAMP, ts); +}