SoW-2019-0002: Dynamic Snapshot
[lttng-tools.git] / src / common / event-rule-kretprobe.c
CommitLineData
1831ae68
FD
1/*
2 * Copyright (C) 2019 - Jonathan Rajotte-Julien <jonathan.rajotte-julien@efficios.com>
3 *
4 * This library is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU Lesser General Public License, version 2.1 only,
6 * as published by the Free Software Foundation.
7 *
8 * This library is distributed in the hope that it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
11 * for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this library; if not, write to the Free Software Foundation,
15 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16 */
17
18#include <lttng/event-rule/event-rule-internal.h>
19#include <lttng/event-rule/kretprobe-internal.h>
20#include <common/macros.h>
21#include <common/error.h>
22#include <common/runas.h>
23#include <assert.h>
24
25#define IS_KRETPROBE_EVENT_RULE(rule) ( \
26 lttng_event_rule_get_type(rule) == LTTNG_EVENT_RULE_TYPE_KRETPROBE \
27 )
28
29static
30void lttng_event_rule_kretprobe_destroy(struct lttng_event_rule *rule)
31{
32 struct lttng_event_rule_kretprobe *kretprobe;
33
34 kretprobe = container_of(rule, struct lttng_event_rule_kretprobe,
35 parent);
36
37 /*
38 * TODO
39 */
40 free(kretprobe);
41}
42
43static
44bool lttng_event_rule_kretprobe_validate(
45 const struct lttng_event_rule *rule)
46{
47 /* TODO */
48 return false;
49}
50
51static
52int lttng_event_rule_kretprobe_serialize(
53 const struct lttng_event_rule *rule,
54 struct lttng_dynamic_buffer *buf, int *fd_to_send)
55{
56 /* TODO */
57 return -1;
58}
59
60static
61bool lttng_event_rule_kretprobe_is_equal(const struct lttng_event_rule *_a,
62 const struct lttng_event_rule *_b)
63{
64 /* TODO */
65 return false;
66}
67
68static
69enum lttng_error_code lttng_event_rule_kretprobe_populate(struct lttng_event_rule *rule, uid_t uid, gid_t gid)
70{
71 /* Nothing to do */
72 return LTTNG_OK;
73}
74
75static const char *lttng_event_rule_kretprobe_get_filter(
76 const struct lttng_event_rule *rule)
77{
78 /* Not supported */
79 return NULL;
80}
81
82static const struct lttng_filter_bytecode *
83lttng_event_rule_kretprobe_get_filter_bytecode(
84 const struct lttng_event_rule *rule)
85{
86 /* Not supported */
87 return NULL;
88}
89
90static struct lttng_event_exclusion *
91lttng_event_rule_kretprobe_generate_exclusions(struct lttng_event_rule *rule)
92{
93 /* Not supported */
94 return NULL;
95}
96
97struct lttng_event_rule *lttng_event_rule_kretprobe_create()
98{
99 struct lttng_event_rule_kretprobe *rule;
100
101 rule = zmalloc(sizeof(struct lttng_event_rule_kretprobe));
102 if (!rule) {
103 return NULL;
104 }
105
106 lttng_event_rule_init(&rule->parent, LTTNG_EVENT_RULE_TYPE_KRETPROBE);
107 rule->parent.validate = lttng_event_rule_kretprobe_validate;
108 rule->parent.serialize = lttng_event_rule_kretprobe_serialize;
109 rule->parent.equal = lttng_event_rule_kretprobe_is_equal;
110 rule->parent.destroy = lttng_event_rule_kretprobe_destroy;
111 rule->parent.populate = lttng_event_rule_kretprobe_populate;
112 rule->parent.get_filter = lttng_event_rule_kretprobe_get_filter;
113 rule->parent.get_filter_bytecode = lttng_event_rule_kretprobe_get_filter_bytecode;
114 rule->parent.generate_exclusions = lttng_event_rule_kretprobe_generate_exclusions;
115 return &rule->parent;
116}
117
118LTTNG_HIDDEN
119ssize_t lttng_event_rule_kretprobe_create_from_buffer(
120 const struct lttng_buffer_view *view,
121 struct lttng_event_rule **_event_rule)
122{
123 /* TODO */
124 return -1;
125}
126
127enum lttng_event_rule_status lttng_event_rule_kretprobe_set_source(
128 struct lttng_event_rule *rule, const char *source)
129{
130 return LTTNG_EVENT_RULE_STATUS_UNSUPPORTED;
131}
132
133enum lttng_event_rule_status lttng_event_rule_kretprobe_set_name(
134 struct lttng_event_rule *rule, const char *name)
135{
136 return LTTNG_EVENT_RULE_STATUS_UNSUPPORTED;
137}
138
139enum lttng_event_rule_status lttng_event_rule_kretprobe_get_name(
140 const struct lttng_event_rule *rule, const char **name)
141{
142 return LTTNG_EVENT_RULE_STATUS_UNSUPPORTED;
143}
144
145LTTNG_HIDDEN
146uint64_t lttng_event_rule_kretprobe_get_address(
147 const struct lttng_event_rule *rule)
148{
149 assert("Not implemented" && 0);
150}
151
152LTTNG_HIDDEN
153uint64_t lttng_event_rule_kretprobe_get_offset(
154 const struct lttng_event_rule *rule)
155{
156 assert("Not implemented" && 0);
157}
158
159LTTNG_HIDDEN
160const char *lttng_event_rule_kretprobe_get_symbol_name(
161 const struct lttng_event_rule *rule)
162{
163 assert("Not implemented" && 0);
164}
This page took 0.029358 seconds and 5 git commands to generate.