Fix: use the correct endian compat macros
[lttng-tools.git] / src / common / tracker.h
... / ...
CommitLineData
1/*
2 * Copyright (C) 2019 Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
3 * Copyright (C) 2020 Jérémie Galarneau <jeremie.galarneau@efficios.com>
4 *
5 * SPDX-License-Identifier: LGPL-2.1-only
6 *
7 */
8
9#ifndef LTTNG_COMMON_TRACKER_H
10#define LTTNG_COMMON_TRACKER_H
11
12#include <lttng/lttng-error.h>
13#include <lttng/tracker.h>
14
15#include <common/buffer-view.h>
16#include <common/dynamic-array.h>
17#include <common/macros.h>
18#include <common/sessiond-comm/sessiond-comm.h>
19
20struct process_attr_value {
21 enum lttng_process_attr_value_type type;
22 union value {
23 pid_t pid;
24 uid_t uid;
25 char *user_name;
26 gid_t gid;
27 char *group_name;
28 } value;
29};
30
31struct lttng_process_attr_values {
32 /* Array of struct process_attr_tracker_value. */
33 struct lttng_dynamic_pointer_array array;
34};
35
36LTTNG_HIDDEN
37const char *lttng_process_attr_to_string(enum lttng_process_attr process_attr);
38
39LTTNG_HIDDEN
40struct lttng_process_attr_values *lttng_process_attr_values_create(void);
41
42/* Prefixed with '_' since the name conflicts with a public API. */
43LTTNG_HIDDEN
44unsigned int _lttng_process_attr_values_get_count(
45 const struct lttng_process_attr_values *values);
46
47LTTNG_HIDDEN
48const struct process_attr_value *lttng_process_attr_tracker_values_get_at_index(
49 const struct lttng_process_attr_values *values,
50 unsigned int index);
51
52LTTNG_HIDDEN
53int lttng_process_attr_values_serialize(
54 const struct lttng_process_attr_values *values,
55 struct lttng_dynamic_buffer *buffer);
56
57LTTNG_HIDDEN
58ssize_t lttng_process_attr_values_create_from_buffer(
59 enum lttng_domain_type domain,
60 enum lttng_process_attr process_attr,
61 const struct lttng_buffer_view *buffer_view,
62 struct lttng_process_attr_values **_values);
63
64LTTNG_HIDDEN
65void lttng_process_attr_values_destroy(
66 struct lttng_process_attr_values *values);
67
68LTTNG_HIDDEN
69struct process_attr_value *process_attr_value_copy(
70 const struct process_attr_value *value);
71
72LTTNG_HIDDEN
73unsigned long process_attr_value_hash(const struct process_attr_value *a);
74
75LTTNG_HIDDEN
76bool process_attr_tracker_value_equal(const struct process_attr_value *a,
77 const struct process_attr_value *b);
78
79LTTNG_HIDDEN
80void process_attr_value_destroy(struct process_attr_value *value);
81
82LTTNG_HIDDEN
83enum lttng_error_code process_attr_value_from_comm(
84 enum lttng_domain_type domain,
85 enum lttng_process_attr process_attr,
86 enum lttng_process_attr_value_type value_type,
87 const struct process_attr_integral_value_comm *integral_value,
88 const struct lttng_buffer_view *value_view,
89 struct process_attr_value **value);
90
91#endif /* LTTNG_COMMON_TRACKER_H */
This page took 0.074951 seconds and 4 git commands to generate.