2 * Copyright (C) 2019 Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
3 * Copyright (C) 2020 Jérémie Galarneau <jeremie.galarneau@efficios.com>
5 * SPDX-License-Identifier: LGPL-2.1-only
9 #ifndef LTTNG_TRACKER_H
10 #define LTTNG_TRACKER_H
12 #include <lttng/constant.h>
13 #include <lttng/domain.h>
14 #include <lttng/lttng-error.h>
15 #include <lttng/lttng-export.h>
16 #include <lttng/session.h>
18 #include <sys/types.h>
25 * Process attribute tracked by a tracker.
27 enum lttng_process_attr
{
28 /* Kernel space domain only. */
29 LTTNG_PROCESS_ATTR_PROCESS_ID
= 0,
30 /* Kernel and user space domains. */
31 LTTNG_PROCESS_ATTR_VIRTUAL_PROCESS_ID
= 1,
32 /* Kernel space domain only. */
33 LTTNG_PROCESS_ATTR_USER_ID
= 2,
34 /* Kernel and user space domains. */
35 LTTNG_PROCESS_ATTR_VIRTUAL_USER_ID
= 3,
36 /* Kernel space domain only. */
37 LTTNG_PROCESS_ATTR_GROUP_ID
= 4,
38 /* Kernel and user space domains. */
39 LTTNG_PROCESS_ATTR_VIRTUAL_GROUP_ID
= 5,
43 * Tracking (filtering) policy of a process attribute tracker.
45 enum lttng_tracking_policy
{
47 * Track all possible process attribute value of a given type
48 * (i.e. no filtering).
49 * This is the default state of a process attribute tracker.
51 LTTNG_TRACKING_POLICY_INCLUDE_ALL
= 0,
52 /* Exclude all possible process attribute values of a given type. */
53 LTTNG_TRACKING_POLICY_EXCLUDE_ALL
= 1,
54 /* Track a set of specific process attribute values. */
55 LTTNG_TRACKING_POLICY_INCLUDE_SET
= 2,
59 * Type of a process attribute value.
61 * This allows the use of the matching accessor given the type of a value.
63 enum lttng_process_attr_value_type
{
64 LTTNG_PROCESS_ATTR_VALUE_TYPE_INVALID
= -1,
65 LTTNG_PROCESS_ATTR_VALUE_TYPE_PID
= 0,
66 LTTNG_PROCESS_ATTR_VALUE_TYPE_UID
= 1,
67 LTTNG_PROCESS_ATTR_VALUE_TYPE_USER_NAME
= 2,
68 LTTNG_PROCESS_ATTR_VALUE_TYPE_GID
= 3,
69 LTTNG_PROCESS_ATTR_VALUE_TYPE_GROUP_NAME
= 4,
72 enum lttng_process_attr_tracker_handle_status
{
73 LTTNG_PROCESS_ATTR_TRACKER_HANDLE_STATUS_GROUP_NOT_FOUND
= -7,
74 LTTNG_PROCESS_ATTR_TRACKER_HANDLE_STATUS_USER_NOT_FOUND
= -6,
75 LTTNG_PROCESS_ATTR_TRACKER_HANDLE_STATUS_INVALID_TRACKING_POLICY
= -5,
76 LTTNG_PROCESS_ATTR_TRACKER_HANDLE_STATUS_SESSION_DOES_NOT_EXIST
= -4,
77 LTTNG_PROCESS_ATTR_TRACKER_HANDLE_STATUS_ERROR
= -3,
78 LTTNG_PROCESS_ATTR_TRACKER_HANDLE_STATUS_COMMUNICATION_ERROR
= -2,
79 LTTNG_PROCESS_ATTR_TRACKER_HANDLE_STATUS_INVALID
= -1,
80 LTTNG_PROCESS_ATTR_TRACKER_HANDLE_STATUS_OK
= 0,
81 LTTNG_PROCESS_ATTR_TRACKER_HANDLE_STATUS_EXISTS
= 1,
82 LTTNG_PROCESS_ATTR_TRACKER_HANDLE_STATUS_MISSING
= 2,
85 enum lttng_process_attr_values_status
{
86 LTTNG_PROCESS_ATTR_VALUES_STATUS_INVALID_TYPE
= -2,
87 LTTNG_PROCESS_ATTR_VALUES_STATUS_INVALID
= -1,
88 LTTNG_PROCESS_ATTR_VALUES_STATUS_OK
= 0,
92 * A process attribute tracker handle.
94 * A process attribute tracker is an _inclusion set_ of process
95 * attribute values. Tracked processes are allowed to emit events,
96 * provided those events are targeted by enabled event rules.
98 * An LTTng session is created with a number of process attribute
99 * trackers by default. The process attributes that can be tracked vary by
100 * domain (see enum lttng_process_attr).
102 * Trackers are per-domain (user and kernel space) and allow the filtering
103 * of events based on a process's attributes.
105 struct lttng_process_attr_tracker_handle
;
107 /* A set of process attribute values. */
108 struct lttng_process_attr_values
;
111 * Get a handle to one of the process attribute trackers of a session's domain.
113 * Returns LTTNG_OK and a process attribute tracker handle on success,
114 * or an lttng_error_code on error.
116 * The tracker's ownership is transfered to the caller. Use
117 * lttng_process_attr_tracker_handle_destroy() to dispose of it.
119 LTTNG_EXPORT
extern enum lttng_error_code
lttng_session_get_tracker_handle(
120 const char *session_name
,
121 enum lttng_domain_type domain
,
122 enum lttng_process_attr process_attr
,
123 struct lttng_process_attr_tracker_handle
**out_tracker_handle
);
126 * Destroy a process attribute tracker handle.
128 LTTNG_EXPORT
extern void lttng_process_attr_tracker_handle_destroy(
129 struct lttng_process_attr_tracker_handle
*tracker_handle
);
132 * Get the tracking policy of a process attribute tracker.
134 * Returns the LTTNG_PROCESS_ATTR_TRACKER_HANDLE_STATUS_OK and the tracking
135 * policy of a process attribute tracker on success,
136 * LTTNG_PROCESS_ATTR_TRACKER_HANDLE_STATUS_INVALID on error.
138 LTTNG_EXPORT
extern enum lttng_process_attr_tracker_handle_status
139 lttng_process_attr_tracker_handle_get_tracking_policy(
140 const struct lttng_process_attr_tracker_handle
*tracker_handle
,
141 enum lttng_tracking_policy
*policy
);
144 * Set the tracking policy of a process attribute tracker.
146 * Setting the tracking policy to the current tracking policy has no effect.
148 * Returns the LTTNG_PROCESS_ATTR_TRACKER_HANDLE_STATUS_OK on success,
149 * LTTNG_PROCESS_ATTR_TRACKER_HANDLE_STATUS_INVALID on error.
151 LTTNG_EXPORT
extern enum lttng_process_attr_tracker_handle_status
152 lttng_process_attr_tracker_handle_set_tracking_policy(
153 const struct lttng_process_attr_tracker_handle
*tracker_handle
,
154 enum lttng_tracking_policy policy
);
157 * Add a numerical PID to the process ID process attribute tracker inclusion
160 * Returns LTTNG_PROCESS_ATTR_TRACKER_HANDLE_STATUS_OK on success,
161 * LTTNG_PROCESS_ATTR_TRACKER_HANDLE_STATUS_EXISTS if it was already
162 * present in the inclusion set, and
163 * LTTNG_PROCESS_ATTR_TRACKER_HANDLE_STATUS_INVALID if an invalid tracker
164 * argument was provided.
166 LTTNG_EXPORT
extern enum lttng_process_attr_tracker_handle_status
167 lttng_process_attr_process_id_tracker_handle_add_pid(
168 const struct lttng_process_attr_tracker_handle
173 * Remove a numerical PID from the process ID process attribute tracker include
176 * Returns LTTNG_PROCESS_ATTR_TRACKED_HANDLE_STATUS_OK on success,
177 * LTTNG_PROCESS_ATTR_TRACKED_HANDLE_STATUS_MISSING if it was not present
178 * in the inclusion set, and LTTNG_PROCESS_ATTR_TRACKED_HANDLE_STATUS_INVALID if
179 * an invalid tracker argument was provided.
181 LTTNG_EXPORT
extern enum lttng_process_attr_tracker_handle_status
182 lttng_process_attr_process_id_tracker_handle_remove_pid(
183 const struct lttng_process_attr_tracker_handle
188 * Add a numerical PID to the virtual process ID process attribute tracker
191 * Returns LTTNG_PROCESS_ATTR_TRACKED_HANDLE_STATUS_OK on success,
192 * LTTNG_PROCESS_ATTR_TRACKED_HANDLE_STATUS_EXISTS if it was already
193 * present in the inclusion set, and
194 * LTTNG_PROCESS_ATTR_TRACKED_HANDLE_STATUS_INVALID if an invalid tracker
195 * argument was provided.
197 LTTNG_EXPORT
extern enum lttng_process_attr_tracker_handle_status
198 lttng_process_attr_virtual_process_id_tracker_handle_add_pid(
199 const struct lttng_process_attr_tracker_handle
204 * Remove a numerical PID from the virtual process ID process attribute tracker
207 * Returns LTTNG_PROCESS_ATTR_TRACKED_HANDLE_STATUS_OK on success,
208 * LTTNG_PROCESS_ATTR_TRACKED_HANDLE_STATUS_MISSING if it was not present
209 * in the inclusion set, and LTTNG_PROCESS_ATTR_TRACKED_HANDLE_STATUS_INVALID if
210 * an invalid tracker argument was provided.
212 LTTNG_EXPORT
extern enum lttng_process_attr_tracker_handle_status
213 lttng_process_attr_virtual_process_id_tracker_handle_remove_pid(
214 const struct lttng_process_attr_tracker_handle
219 * Add a numerical UID to the user ID process attribute tracker inclusion set.
221 * Returns LTTNG_PROCESS_ATTR_TRACKED_HANDLE_STATUS_OK on success,
222 * LTTNG_PROCESS_ATTR_TRACKED_HANDLE_STATUS_EXISTS if it was already
223 * present in the inclusion set, and
224 * LTTNG_PROCESS_ATTR_TRACKED_HANDLE_STATUS_INVALID if an invalid tracker
225 * argument was provided.
227 LTTNG_EXPORT
extern enum lttng_process_attr_tracker_handle_status
228 lttng_process_attr_user_id_tracker_handle_add_uid(
229 const struct lttng_process_attr_tracker_handle
*user_id_tracker
,
233 * Remove a numerical UID from the user ID process attribute tracker include
236 * Returns LTTNG_PROCESS_ATTR_TRACKED_HANDLE_STATUS_OK on success,
237 * LTTNG_PROCESS_ATTR_TRACKED_HANDLE_STATUS_MISSING if it was not present
238 * in the inclusion set, and LTTNG_PROCESS_ATTR_TRACKED_HANDLE_STATUS_INVALID if
239 * an invalid tracker argument was provided.
241 LTTNG_EXPORT
extern enum lttng_process_attr_tracker_handle_status
242 lttng_process_attr_user_id_tracker_handle_remove_uid(
243 const struct lttng_process_attr_tracker_handle
*user_id_tracker
,
247 * Add a user name to the user ID process attribute tracker inclusion set.
249 * The user name resolution is performed by the session daemon on addition to
250 * the user ID inclusion set.
252 * Returns LTTNG_PROCESS_ATTR_TRACKED_HANDLE_STATUS_OK on success,
253 * LTTNG_PROCESS_ATTR_TRACKED_HANDLE_STATUS_EXISTS if it was already
254 * present in the inclusion set, and
255 * LTTNG_PROCESS_ATTR_TRACKED_HANDLE_STATUS_INVALID if an invalid tracker
256 * argument was provided.
258 LTTNG_EXPORT
extern enum lttng_process_attr_tracker_handle_status
259 lttng_process_attr_user_id_tracker_handle_add_user_name(
260 const struct lttng_process_attr_tracker_handle
*user_id_tracker
,
261 const char *user_name
);
264 * Remove a user name from the user ID process attribute tracker include
267 * No name resolution is performed; the user name will be matched against the
268 * names in the inclusion set.
270 * Returns LTTNG_PROCESS_ATTR_TRACKED_HANDLE_STATUS_OK on success,
271 * LTTNG_PROCESS_ATTR_TRACKED_HANDLE_STATUS_MISSING if it was not present
272 * in the inclusion set, and LTTNG_PROCESS_ATTR_TRACKED_HANDLE_STATUS_INVALID if
273 * an invalid tracker argument was provided.
275 LTTNG_EXPORT
extern enum lttng_process_attr_tracker_handle_status
276 lttng_process_attr_user_id_tracker_handle_remove_user_name(
277 const struct lttng_process_attr_tracker_handle
*user_id_tracker
,
278 const char *user_name
);
281 * Add a numerical UID to the virtual user ID process attribute tracker
284 * Returns LTTNG_PROCESS_ATTR_TRACKED_HANDLE_STATUS_OK on success,
285 * LTTNG_PROCESS_ATTR_TRACKED_HANDLE_STATUS_EXISTS if it was already
286 * present in the inclusion set, and
287 * LTTNG_PROCESS_ATTR_TRACKED_HANDLE_STATUS_INVALID if an invalid tracker
288 * argument was provided.
290 LTTNG_EXPORT
extern enum lttng_process_attr_tracker_handle_status
291 lttng_process_attr_virtual_user_id_tracker_handle_add_uid(
292 const struct lttng_process_attr_tracker_handle
*user_id_tracker
,
296 * Remove a numerical UID from the virtual user ID process attribute tracker
299 * Returns LTTNG_PROCESS_ATTR_TRACKED_HANDLE_STATUS_OK on success,
300 * LTTNG_PROCESS_ATTR_TRACKED_HANDLE_STATUS_MISSING if it was not present
301 * in the inclusion set, and LTTNG_PROCESS_ATTR_TRACKED_HANDLE_STATUS_INVALID if
302 * an invalid tracker argument was provided.
304 LTTNG_EXPORT
extern enum lttng_process_attr_tracker_handle_status
305 lttng_process_attr_virtual_user_id_tracker_handle_remove_uid(
306 const struct lttng_process_attr_tracker_handle
*user_id_tracker
,
310 * Add a user name to the virtual user ID process attribute tracker include
313 * The user name resolution is performed by the session daemon on addition to
314 * the virtual user ID inclusion set.
316 * Returns LTTNG_PROCESS_ATTR_TRACKED_HANDLE_STATUS_OK on success,
317 * LTTNG_PROCESS_ATTR_TRACKED_HANDLE_STATUS_EXISTS if it was already
318 * present in the inclusion set, and
319 * LTTNG_PROCESS_ATTR_TRACKED_HANDLE_STATUS_INVALID if an invalid tracker
320 * argument was provided.
322 LTTNG_EXPORT
extern enum lttng_process_attr_tracker_handle_status
323 lttng_process_attr_virtual_user_id_tracker_handle_add_user_name(
324 const struct lttng_process_attr_tracker_handle
*user_id_tracker
,
325 const char *virtual_user_name
);
328 * Remove a user name from the virtual user ID process attribute tracker
331 * No name resolution is performed; the user name will be matched against the
332 * names in the inclusion set.
334 * Returns LTTNG_PROCESS_ATTR_TRACKED_HANDLE_STATUS_OK on success,
335 * LTTNG_PROCESS_ATTR_TRACKED_HANDLE_STATUS_MISSING if it was not present
336 * in the inclusion set, and LTTNG_PROCESS_ATTR_TRACKED_HANDLE_STATUS_INVALID if
337 * an invalid tracker argument was provided.
339 LTTNG_EXPORT
extern enum lttng_process_attr_tracker_handle_status
340 lttng_process_attr_virtual_user_id_tracker_handle_remove_user_name(
341 const struct lttng_process_attr_tracker_handle
*user_id_tracker
,
342 const char *virtual_user_name
);
345 * Add a numerical GID to the group ID process attribute tracker inclusion set.
347 * Returns LTTNG_PROCESS_ATTR_TRACKED_HANDLE_STATUS_OK on success,
348 * LTTNG_PROCESS_ATTR_TRACKED_HANDLE_STATUS_EXISTS if it was already
349 * present in the inclusion set, and
350 * LTTNG_PROCESS_ATTR_TRACKED_HANDLE_STATUS_INVALID if an invalid tracker
351 * argument was provided.
353 LTTNG_EXPORT
extern enum lttng_process_attr_tracker_handle_status
354 lttng_process_attr_group_id_tracker_handle_add_gid(
355 const struct lttng_process_attr_tracker_handle
*group_id_tracker
,
359 * Remove a numerical GID from the group ID process attribute tracker include
362 * Returns LTTNG_PROCESS_ATTR_TRACKED_HANDLE_STATUS_OK on success,
363 * LTTNG_PROCESS_ATTR_TRACKED_HANDLE_STATUS_MISSING if it was not present
364 * in the inclusion set, and LTTNG_PROCESS_ATTR_TRACKED_HANDLE_STATUS_INVALID if
365 * an invalid tracker argument was provided.
367 LTTNG_EXPORT
extern enum lttng_process_attr_tracker_handle_status
368 lttng_process_attr_group_id_tracker_handle_remove_gid(
369 const struct lttng_process_attr_tracker_handle
*group_id_tracker
,
373 * Add a group name to the group ID process attribute tracker inclusion set.
375 * The group name resolution is performed by the session daemon on addition to
376 * the group ID inclusion set.
378 * Returns LTTNG_PROCESS_ATTR_TRACKED_HANDLE_STATUS_OK on success,
379 * LTTNG_PROCESS_ATTR_TRACKED_HANDLE_STATUS_EXISTS if it was already
380 * present in the inclusion set, and
381 * LTTNG_PROCESS_ATTR_TRACKED_HANDLE_STATUS_INVALID if an invalid tracker
382 * argument was provided.
384 LTTNG_EXPORT
extern enum lttng_process_attr_tracker_handle_status
385 lttng_process_attr_group_id_tracker_handle_add_group_name(
386 const struct lttng_process_attr_tracker_handle
*group_id_tracker
,
387 const char *group_name
);
390 * Remove a group name from the group ID process attribute tracker include
393 * No name resolution is performed; the user name will be matched against the
394 * names in the inclusion set.
396 * Returns LTTNG_PROCESS_ATTR_TRACKED_HANDLE_STATUS_OK on success,
397 * LTTNG_PROCESS_ATTR_TRACKED_HANDLE_STATUS_MISSING if it was not present
398 * in the inclusion set, and LTTNG_PROCESS_ATTR_TRACKED_HANDLE_STATUS_INVALID if
399 * an invalid tracker argument was provided.
401 LTTNG_EXPORT
extern enum lttng_process_attr_tracker_handle_status
402 lttng_process_attr_group_id_tracker_handle_remove_group_name(
403 const struct lttng_process_attr_tracker_handle
*group_id_tracker
,
404 const char *group_name
);
407 * Add a numerical GID to the virtual group ID process attribute tracker
410 * Returns LTTNG_PROCESS_ATTR_TRACKED_HANDLE_STATUS_OK on success,
411 * LTTNG_PROCESS_ATTR_TRACKED_HANDLE_STATUS_EXISTS if it was already
412 * present in the inclusion set, and
413 * LTTNG_PROCESS_ATTR_TRACKED_HANDLE_STATUS_INVALID if an invalid tracker
414 * argument was provided.
416 LTTNG_EXPORT
extern enum lttng_process_attr_tracker_handle_status
417 lttng_process_attr_virtual_group_id_tracker_handle_add_gid(
418 const struct lttng_process_attr_tracker_handle
*group_id_tracker
,
422 * Remove a numerical GID from the virtual group ID process attribute tracker
425 * Returns LTTNG_PROCESS_ATTR_TRACKED_HANDLE_STATUS_OK on success,
426 * LTTNG_PROCESS_ATTR_TRACKED_HANDLE_STATUS_MISSING if it was not present
427 * in the inclusion set, and LTTNG_PROCESS_ATTR_TRACKED_HANDLE_STATUS_INVALID if
428 * an invalid tracker argument was provided.
430 LTTNG_EXPORT
extern enum lttng_process_attr_tracker_handle_status
431 lttng_process_attr_virtual_group_id_tracker_handle_remove_gid(
432 const struct lttng_process_attr_tracker_handle
*group_id_tracker
,
436 * Add a group name to the virtual group ID process attribute tracker include
439 * The group name resolution is performed by the session daemon on addition to
440 * the virtual group ID inclusion set.
442 * Returns LTTNG_PROCESS_ATTR_TRACKED_HANDLE_STATUS_OK on success,
443 * LTTNG_PROCESS_ATTR_TRACKED_HANDLE_STATUS_EXISTS if it was already
444 * present in the inclusion set, and
445 * LTTNG_PROCESS_ATTR_TRACKED_HANDLE_STATUS_INVALID if an invalid tracker
446 * argument was provided.
448 LTTNG_EXPORT
extern enum lttng_process_attr_tracker_handle_status
449 lttng_process_attr_virtual_group_id_tracker_handle_add_group_name(
450 const struct lttng_process_attr_tracker_handle
*group_id_tracker
,
451 const char *virtual_group_name
);
454 * Remove a group name from the virtual group ID process attribute tracker
457 * No name resolution is performed; the user name will be matched against the
458 * names in the inclusion set.
460 * Returns LTTNG_PROCESS_ATTR_TRACKED_HANDLE_STATUS_OK on success,
461 * LTTNG_PROCESS_ATTR_TRACKED_HANDLE_STATUS_MISSING if it was not present
462 * in the inclusion set, and LTTNG_PROCESS_ATTR_TRACKED_HANDLE_STATUS_INVALID if
463 * an invalid tracker argument was provided.
465 LTTNG_EXPORT
extern enum lttng_process_attr_tracker_handle_status
466 lttng_process_attr_virtual_group_id_tracker_handle_remove_group_name(
467 const struct lttng_process_attr_tracker_handle
*group_id_tracker
,
468 const char *virtual_group_name
);
471 * Get the process attribute values that are part of a tracker's inclusion set.
473 * The values returned are a snapshot of the values that are part of the
474 * tracker's inclusion set at the moment of the invocation; it is not updated
475 * as entries are added or removed.
477 * The values remain valid until the tracker is destroyed.
479 * Returns LTTNG_PROCESS_ATTR_TRACKER_HANDLE_STATUS_OK on success,
480 * LTTNG_PROCESS_ATTR_TRACKER_HANDLE_STATUS_INVALID if the tracker's policy is
481 * not LTTNG_POLICY_INCLUDE_SET.
483 LTTNG_EXPORT
extern enum lttng_process_attr_tracker_handle_status
484 lttng_process_attr_tracker_handle_get_inclusion_set(
485 struct lttng_process_attr_tracker_handle
*tracker_handle
,
486 const struct lttng_process_attr_values
**values
);
489 * Get the count of values within a set of process attribute values.
491 * Returns LTTNG_PROCESS_ATTR_VALUES_STATUS_OK on success,
492 * LTTNG_PROCESS_ATTR_VALUES_STATUS_INVALID if an invalid argument is provided.
494 LTTNG_EXPORT
extern enum lttng_process_attr_values_status
495 lttng_process_attr_values_get_count(
496 const struct lttng_process_attr_values
*values
,
497 unsigned int *count
);
500 * Get the type of a process attribute value at a given index.
502 * Returns a process attribute value type on success,
503 * LTTNG_PROCESS_ATTR_VALUE_TYPE_INVALID if an invalid argument is provided.
505 LTTNG_EXPORT
extern enum lttng_process_attr_value_type
506 lttng_process_attr_values_get_type_at_index(
507 const struct lttng_process_attr_values
*values
,
511 * Get a process ID process attribute value.
513 * Returns LTTNG_PROCESS_ATTR_VALUES_STATUS_OK on success,
514 * LTTNG_PROCESS_ATTR_VALUES_STATUS_INVALID_TYPE if the process attribute value
515 * is not a process ID.
517 LTTNG_EXPORT
extern enum lttng_process_attr_values_status
518 lttng_process_attr_values_get_pid_at_index(
519 const struct lttng_process_attr_values
*values
,
524 * Get a user ID process attribute value.
526 * Returns LTTNG_PROCESS_ATTR_VALUES_STATUS_OK on success,
527 * LTTNG_PROCESS_ATTR_VALUES_STATUS_INVALID_TYPE if the process attribute value
530 LTTNG_EXPORT
extern enum lttng_process_attr_values_status
531 lttng_process_attr_values_get_uid_at_index(
532 const struct lttng_process_attr_values
*values
,
537 * Get a user name process attribute value.
539 * Returns LTTNG_PROCESS_ATTR_VALUES_STATUS_OK on success,
540 * LTTNG_PROCESS_ATTR_VALUES_STATUS_INVALID_TYPE if the process attribute value
541 * is not a user name.
543 LTTNG_EXPORT
extern enum lttng_process_attr_values_status
544 lttng_process_attr_values_get_user_name_at_index(
545 const struct lttng_process_attr_values
*values
,
547 const char **user_name
);
550 * Get a group ID process attribute value.
552 * Returns LTTNG_PROCESS_ATTR_VALUES_STATUS_OK on success,
553 * LTTNG_PROCESS_ATTR_VALUES_STATUS_INVALID_TYPE if the process attribute value
556 LTTNG_EXPORT
extern enum lttng_process_attr_values_status
557 lttng_process_attr_values_get_gid_at_index(
558 const struct lttng_process_attr_values
*values
,
563 * Get a group name process attribute value.
565 * Returns LTTNG_PROCESS_ATTR_VALUES_STATUS_OK on success,
566 * LTTNG_PROCESS_ATTR_VALUES_STATUS_INVALID_TYPE if the process attribute value
567 * is not a group name.
569 LTTNG_EXPORT
extern enum lttng_process_attr_values_status
570 lttng_process_attr_values_get_group_name_at_index(
571 const struct lttng_process_attr_values
*values
,
573 const char **group_name
);
575 /* The following entry points are deprecated. */
578 * Deprecated: see `lttng_process_attr_tracker_handle_get_inclusion_set` and
579 * `lttng_process_tracker_handle_get_tracking_policy`.
583 * `enabled` indicates whether or not the PID tracker is enabled.
585 * `pids` is set to an allocated array of PIDs currently being tracked. On
586 * success, `pids` must be freed by the caller.
588 * `nr_pids` is set to the number of entries contained in the `pids` array.
590 * Returns 0 on success, else a negative LTTng error code.
592 LTTNG_EXPORT
extern int lttng_list_tracker_pids(struct lttng_handle
*handle
,
598 * Deprecated: see `lttng_process_attr_process_id_tracker_handle_add_pid`.
600 * Add PID to session tracker.
602 * A pid argument >= 0 adds the PID to the session's PID tracker.
603 * A pid argument of -1 means "track all PIDs".
605 * Note on 'real' PIDs vs 'virtual' VPIDs:
606 * - With the user space domain specified, this function will add a VPID
607 * value to the virtual process ID process attribute tracker's inclusion
609 * - With the kernel space domain specified, this function will add a PID
610 * value to the process ID process attribute tracker's inclusion set.
612 * Returns 0 on success, else a negative LTTng error code.
614 LTTNG_EXPORT
extern int lttng_track_pid(struct lttng_handle
*handle
, int pid
);
617 * Deprecated: see `lttng_process_attr_process_id_tracker_handle_remove_pid`.
619 * Remove PID from session tracker.
621 * A pid argument >= 0 removes the PID from the session's PID tracker.
622 * A pid argument of -1 means "untrack all PIDs".
624 * Note on 'real' PIDs vs 'virtual' VPIDs:
625 * - With the user space domain specified, this function will remove a VPID
626 * value from the virtual process ID process attribute tracker's inclusion
628 * - With the kernel space domain specified, this function will remove a PID
629 * value from the process ID process attribute tracker's inclusion set.
631 * Returns 0 on success, else a negative LTTng error code.
633 LTTNG_EXPORT
extern int lttng_untrack_pid(struct lttng_handle
*handle
, int pid
);
639 #endif /* LTTNG_TRACKER_H */