SoW-2020-0002: Trace Hit Counters
[lttng-tools.git] / include / lttng / action / incr-value.h
1 /*
2 * Copyright (C) 2020 Francis Deslauriers <francis.deslauriers@efficios.com>
3 *
4 * SPDX-License-Identifier: LGPL-2.1-only
5 *
6 */
7
8 #ifndef LTTNG_ACTION_INCR_VALUE_H
9 #define LTTNG_ACTION_INCR_VALUE_H
10
11 #include <lttng/action/action.h>
12 #include <lttng/map-key.h>
13
14 struct lttng_action;
15 struct lttng_map_key;
16
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
20
21 /*
22 * Create a newly allocated incr-value action object.
23 *
24 * Returns a new action on success, NULL on failure. This action must be
25 * destroyed using lttng_action_destroy().
26 */
27 extern struct lttng_action *lttng_action_incr_value_create(void);
28
29 /*
30 * Set the session name of an lttng_action object of type
31 * LTTNG_ACTION_TYPE_INCREMENT_VALUE.
32 */
33 extern enum lttng_action_status lttng_action_incr_value_set_session_name(
34 struct lttng_action *action, const char *session_name);
35
36 /*
37 * Get the session name of an lttng_action object of type
38 * LTTNG_ACTION_TYPE_INCREMENT_VALUE.
39 */
40 extern enum lttng_action_status lttng_action_incr_value_get_session_name(
41 const struct lttng_action *action, const char **session_name);
42
43 /*
44 * Set the map name of an lttng_action object of type
45 * LTTNG_ACTION_TYPE_INCREMENT_VALUE.
46 */
47 extern enum lttng_action_status lttng_action_incr_value_set_map_name(
48 struct lttng_action *action, const char *map_name);
49
50 /*
51 * Get the map name of an lttng_action object of type
52 * LTTNG_ACTION_TYPE_INCREMENT_VALUE.
53 */
54 extern enum lttng_action_status lttng_action_incr_value_get_map_name(
55 const struct lttng_action *action, const char **map_name);
56
57 /*
58 * Set key allocation policy for an lttng_action object type
59 * LTTNG_ACTION_TYPE_INCREMENT_VALUE.
60 *
61 * The caller retains ownership of the passed lttng_map_key.
62 */
63 extern enum lttng_action_status
64 lttng_action_incr_value_set_key(struct lttng_action *action,
65 struct lttng_map_key *key);
66
67 /*
68 * Get key allocation policy for an lttng_action object type
69 * LTTNG_ACTION_TYPE_INCREMENT_VALUE.
70 */
71 extern enum lttng_action_status
72 lttng_action_incr_value_get_key(const struct lttng_action *action,
73 const struct lttng_map_key **key);
74
75 #ifdef __cplusplus
76 }
77 #endif
78
79 #endif /* LTTNG_ACTION_INCR_VALUE_H */
This page took 0.033234 seconds and 5 git commands to generate.