X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;f=lttng-events.h;h=d761360c7757009971ad9f6b8a5a0c0f3c0f561c;hb=7e6f9ef6f2e62dfe359b94562cd98197367ddbac;hp=a537673ab605b92cad3ce00c0747800a516d00b4;hpb=12e579dbcb23fab949879ed03a1757d22bd8a6b2;p=lttng-modules.git diff --git a/lttng-events.h b/lttng-events.h index a537673a..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); @@ -407,6 +438,7 @@ int lttng_syscall_filter_disable(struct lttng_channel *chan, const char *name); long lttng_channel_syscall_mask(struct lttng_channel *channel, struct lttng_kernel_syscall_mask __user *usyscall_mask); +int lttng_abi_syscall_list(void); #else static inline int lttng_syscalls_register(struct lttng_channel *chan, void *filter) { @@ -418,29 +450,36 @@ static inline int lttng_syscalls_unregister(struct lttng_channel *chan) return 0; } -static +static inline int lttng_syscall_filter_enable(struct lttng_channel *chan, const char *name) { return -ENOSYS; } -static +static inline int lttng_syscall_filter_disable(struct lttng_channel *chan, const char *name) { return -ENOSYS; } -static +static inline long lttng_channel_syscall_mask(struct lttng_channel *channel, struct lttng_kernel_syscall_mask __user *usyscall_mask) { return -ENOSYS; } + +static inline +int lttng_abi_syscall_list(void) +{ + return -ENOSYS; +} #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);