X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;f=lttng-events.h;h=d761360c7757009971ad9f6b8a5a0c0f3c0f561c;hb=7e6f9ef6f2e62dfe359b94562cd98197367ddbac;hp=e5cd0eeadeb6198b20958c34f68f517b13aa6710;hpb=082d4946ed719b3c73759ae88753c511624af952;p=lttng-modules.git diff --git a/lttng-events.h b/lttng-events.h index e5cd0eea..d761360c 100644 --- a/lttng-events.h +++ b/lttng-events.h @@ -167,6 +167,7 @@ struct lttng_ctx { struct lttng_ctx_field *fields; unsigned int nr_fields; unsigned int allocated_fields; + size_t largest_align; /* in bytes */ }; struct lttng_event_desc { @@ -323,6 +324,23 @@ struct lttng_metadata_stream { struct mutex lock; }; + +/* + * struct lttng_pid_tracker declared in header due to deferencing of *v + * in RCU_INITIALIZER(v). + */ +#define LTTNG_PID_HASH_BITS 6 +#define LTTNG_PID_TABLE_SIZE (1 << LTTNG_PID_HASH_BITS) + +struct lttng_pid_tracker { + struct hlist_head pid_hash[LTTNG_PID_TABLE_SIZE]; +}; + +struct lttng_pid_hash_node { + struct hlist_node hlist; + int pid; +}; + struct lttng_session { int active; /* Is trace session active ? */ int been_active; /* Has trace session been active ? */ @@ -333,6 +351,7 @@ struct lttng_session { unsigned int free_chan_id; /* Next chan ID to allocate */ uuid_le uuid; /* Trace session unique ID */ struct lttng_metadata_cache *metadata_cache; + struct lttng_pid_tracker *pid_tracker; unsigned int metadata_dumped:1; }; @@ -398,6 +417,18 @@ void lttng_probes_exit(void); int lttng_metadata_output_channel(struct lttng_metadata_stream *stream, struct channel *chan); +int lttng_pid_tracker_get_node_pid(const struct lttng_pid_hash_node *node); +struct lttng_pid_tracker *lttng_pid_tracker_create(void); +void lttng_pid_tracker_destroy(struct lttng_pid_tracker *lpf); +bool lttng_pid_tracker_lookup(struct lttng_pid_tracker *lpf, int pid); +int lttng_pid_tracker_add(struct lttng_pid_tracker *lpf, int pid); +int lttng_pid_tracker_del(struct lttng_pid_tracker *lpf, int pid); + +int lttng_session_track_pid(struct lttng_session *session, int pid); +int lttng_session_untrack_pid(struct lttng_session *session, int pid); + +int lttng_session_list_tracker_pids(struct lttng_session *session); + #if defined(CONFIG_HAVE_SYSCALL_TRACEPOINTS) int lttng_syscalls_register(struct lttng_channel *chan, void *filter); int lttng_syscalls_unregister(struct lttng_channel *chan); @@ -448,6 +479,7 @@ int lttng_abi_syscall_list(void) #endif struct lttng_ctx_field *lttng_append_context(struct lttng_ctx **ctx); +void lttng_context_update(struct lttng_ctx *ctx); int lttng_find_context(struct lttng_ctx *ctx, const char *name); void lttng_remove_context_field(struct lttng_ctx **ctx, struct lttng_ctx_field *field);