X-Git-Url: https://git.liburcu.org/?a=blobdiff_plain;f=src%2Fcommon%2Fkernel-ctl%2Fkernel-ctl.c;h=592e1a2f4146d4b118655eb59680267a0d1686be;hb=90aa04a116a8be510b9d256b47de6bbb4144fb8b;hp=f7b92f045498c870de9181c1e754228353ea033d;hpb=cfb1c9bcab7801380b6ffbab9e505b861072254c;p=lttng-tools.git diff --git a/src/common/kernel-ctl/kernel-ctl.c b/src/common/kernel-ctl/kernel-ctl.c index f7b92f045..592e1a2f4 100644 --- a/src/common/kernel-ctl/kernel-ctl.c +++ b/src/common/kernel-ctl/kernel-ctl.c @@ -430,6 +430,27 @@ int kernctl_create_event_notifier_group_notification_fd(int group_fd) LTTNG_KERNEL_EVENT_NOTIFIER_GROUP_NOTIFICATION_FD); } +int kernctl_create_event_notifier_group_error_counter(int group_fd, + const struct lttng_kernel_counter_conf *error_counter_conf) +{ + return LTTNG_IOCTL_NO_CHECK(group_fd, LTTNG_KERNEL_COUNTER, + error_counter_conf); +} + +int kernctl_counter_get_aggregate_value(int counter_fd, + struct lttng_kernel_counter_aggregate *value) +{ + return LTTNG_IOCTL_NO_CHECK(counter_fd, LTTNG_KERNEL_COUNTER_AGGREGATE, + value); +} + +int kernctl_counter_clear(int counter_fd, + struct lttng_kernel_counter_clear *clear) +{ + return LTTNG_IOCTL_NO_CHECK(counter_fd, LTTNG_KERNEL_COUNTER_CLEAR, + clear); +} + int kernctl_create_event_notifier(int group_fd, const struct lttng_kernel_event_notifier *event_notifier) { @@ -437,7 +458,29 @@ int kernctl_create_event_notifier(int group_fd, LTTNG_KERNEL_EVENT_NOTIFIER_CREATE, event_notifier); } -int kernctl_filter(int fd, struct lttng_filter_bytecode *filter) +int kernctl_capture(int fd, const struct lttng_bytecode *capture) +{ + int ret; + struct lttng_kernel_capture_bytecode *kb; + + /* Translate bytecode to kernel bytecode. */ + kb = zmalloc(sizeof(*kb) + capture->len); + if (!kb) { + ret = -ENOMEM; + goto end; + } + + kb->len = capture->len; + kb->reloc_offset = capture->reloc_table_offset; + kb->seqnum = capture->seqnum; + memcpy(kb->data, capture->data, capture->len); + ret = LTTNG_IOCTL_CHECK(fd, LTTNG_KERNEL_CAPTURE, kb); + free(kb); +end: + return ret; +} + +int kernctl_filter(int fd, const struct lttng_bytecode *filter) { struct lttng_kernel_filter_bytecode *kb; uint32_t len;