X-Git-Url: http://git.efficios.com/?p=lttng-tools.git;a=blobdiff_plain;f=include%2Flttng%2Fevent-rule%2Fkretprobe.h;fp=include%2Flttng%2Fevent-rule%2Fkretprobe.h;h=5ed08529a25042cb20e9c451982da3013013209f;hp=0000000000000000000000000000000000000000;hb=1831ae68b70dece8e9b847081526495adbbf05e5;hpb=25357057de5ae4dd2a572e8f9b893c1b90cbd60a diff --git a/include/lttng/event-rule/kretprobe.h b/include/lttng/event-rule/kretprobe.h new file mode 100644 index 000000000..5ed08529a --- /dev/null +++ b/include/lttng/event-rule/kretprobe.h @@ -0,0 +1,72 @@ +/* + * Copyright (C) 2019 - Jonathan Rajotte-Julien + * + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License, version 2.1 only, + * as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef LTTNG_EVENT_RULE_KRETPROBE_H +#define LTTNG_EVENT_RULE_KRETPROBE_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * TODO: + */ +extern struct lttng_event_rule *lttng_event_rule_kretprobe_create(void); + +/* + * Set the source of a kretprobe event rule. + * + * TODO: list possible format + * + * Return LTTNG_EVENT_RULE_STATUS_OK on success, LTTNG_EVENT_RULE_STATUS_INVALID + * if invalid parameters are passed. + */ +extern enum lttng_event_rule_status lttng_event_rule_kretprobe_set_source( + struct lttng_event_rule *rule, const char *source); + +/* + * Set the name of a kretprobe event rule. + * + * The name is copied. + * + * Return LTTNG_EVENT_RULE_STATUS_OK on success, LTTNG_EVENT_RULE_STATUS_INVALID + * if invalid parameters are passed. + */ +extern enum lttng_event_rule_status lttng_event_rule_kretprobe_set_name( + struct lttng_event_rule *rule, const char *name); + +/* + * Get the name of a kretprobe event rule. + * + * The caller does not assume the ownership of the returned name. + * The name shall only only be used for the duration of the event + * rule's lifetime, or before a different name is set. + * + * Returns LTTNG_EVENT_RULE_STATUS_OK and a pointer to the event rule's name on + * success, LTTNG_EVENT_RULE_STATUS_INVALID if an invalid parameter is passed, + * or LTTNG_EVENT_RULE_STATUS_UNSET if a name was not set prior to this call. + */ +extern enum lttng_event_rule_status lttng_event_rule_kretprobe_get_name( + const struct lttng_event_rule *rule, const char **name); + +#ifdef __cplusplus +} +#endif + +#endif /* LTTNG_EVENT_RULE_KRETPROBE_H */