X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=lttng-events.h;h=da2637d7800e88cc70c61f1898ac88525a9327bb;hb=refs%2Fheads%2Fstable-2.12;hp=d4d99766d3291a3efacf16b10cf591bc8855a509;hpb=ad594e3a953db1b0c3c059fde45b5a5494f6be78;p=lttng-modules.git diff --git a/lttng-events.h b/lttng-events.h index d4d99766..da2637d7 100644 --- a/lttng-events.h +++ b/lttng-events.h @@ -10,18 +10,19 @@ #ifndef _LTTNG_EVENTS_H #define _LTTNG_EVENTS_H -#include +#include #include #include #include #include #include +#include #include #include #include #include -#define lttng_is_signed_type(type) (((type)(-1)) < 0) +#define lttng_is_signed_type(type) (((type) -1) < (type) 1) struct lttng_channel; struct lttng_session; @@ -74,7 +75,7 @@ struct lttng_enum_entry { }; #define __type_integer(_type, _size, _alignment, _signedness, \ - _byte_order, _base, _encoding) \ + _byte_order, _user, _base, _encoding) \ { \ .atype = atype_integer, \ .u.basic.integer = \ @@ -82,8 +83,9 @@ struct lttng_enum_entry { .size = (_size) ? : sizeof(_type) * CHAR_BIT, \ .alignment = (_alignment) ? : lttng_alignof(_type) * CHAR_BIT, \ .signedness = (_signedness) >= 0 ? (_signedness) : lttng_is_signed_type(_type), \ - .reverse_byte_order = _byte_order != __BYTE_ORDER, \ - .base = _base, \ + .reverse_byte_order = (_byte_order) != __BYTE_ORDER, \ + .base = (_base), \ + .user = (_user), \ .encoding = lttng_encode_##_encoding, \ }, \ } \ @@ -92,7 +94,8 @@ struct lttng_integer_type { unsigned int size; /* in bits */ unsigned short alignment; /* in bits */ unsigned int signedness:1, - reverse_byte_order:1; + reverse_byte_order:1, + user:1; /* fetch from user-space */ unsigned int base; /* 2, 8, 10, 16, for pretty print */ enum lttng_string_encodings encoding; }; @@ -105,6 +108,7 @@ union _lttng_basic_type { } enumeration; struct { enum lttng_string_encodings encoding; + unsigned int user:1; /* fetch from user-space */ } string; }; @@ -160,8 +164,7 @@ struct lttng_enum_desc { struct lttng_event_field { const char *name; struct lttng_type type; - unsigned int nowrite:1, /* do not write into trace */ - user:1; /* fetch from user-space */ + unsigned int nowrite:1; /* do not write into trace */ }; union lttng_ctx_value { @@ -175,7 +178,7 @@ union lttng_ctx_value { * lttng_ctx_field because cpu hotplug needs fixed-location addresses. */ struct lttng_perf_counter_field { -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) +#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,10,0)) struct lttng_cpuhp_node cpuhp_prepare; struct lttng_cpuhp_node cpuhp_online; #else @@ -692,13 +695,13 @@ static inline int lttng_syscalls_destroy(struct lttng_channel *chan) } static inline int lttng_syscall_filter_enable(struct lttng_channel *chan, - struct lttng_event *event); + struct lttng_event *event) { return -ENOSYS; } static inline int lttng_syscall_filter_disable(struct lttng_channel *chan, - struct lttng_event *event); + struct lttng_event *event) { return -ENOSYS; } @@ -715,6 +718,7 @@ int lttng_enabler_attach_bytecode(struct lttng_enabler *enabler, struct lttng_kernel_filter_bytecode __user *bytecode); void lttng_enabler_event_link_bytecode(struct lttng_event *event, struct lttng_enabler *enabler); +void lttng_free_event_filter_runtime(struct lttng_event *event); int lttng_probes_init(void); @@ -764,7 +768,7 @@ int lttng_add_migratable_to_ctx(struct lttng_ctx **ctx) int lttng_add_callstack_to_ctx(struct lttng_ctx **ctx, int type); #if defined(CONFIG_CGROUPS) && \ - ((LINUX_VERSION_CODE >= KERNEL_VERSION(4,6,0)) || \ + ((LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,6,0)) || \ LTTNG_UBUNTU_KERNEL_RANGE(4,4,0,0, 4,5,0,0)) int lttng_add_cgroup_ns_to_ctx(struct lttng_ctx **ctx); #else @@ -776,7 +780,7 @@ int lttng_add_cgroup_ns_to_ctx(struct lttng_ctx **ctx) #endif #if defined(CONFIG_IPC_NS) && \ - (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)) + (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,8,0)) int lttng_add_ipc_ns_to_ctx(struct lttng_ctx **ctx); #else static inline @@ -787,7 +791,7 @@ int lttng_add_ipc_ns_to_ctx(struct lttng_ctx **ctx) #endif #if !defined(LTTNG_MNT_NS_MISSING_HEADER) && \ - (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)) + (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,8,0)) int lttng_add_mnt_ns_to_ctx(struct lttng_ctx **ctx); #else static inline @@ -798,7 +802,7 @@ int lttng_add_mnt_ns_to_ctx(struct lttng_ctx **ctx) #endif #if defined(CONFIG_NET_NS) && \ - (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)) + (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,8,0)) int lttng_add_net_ns_to_ctx(struct lttng_ctx **ctx); #else static inline @@ -809,7 +813,7 @@ int lttng_add_net_ns_to_ctx(struct lttng_ctx **ctx) #endif #if defined(CONFIG_PID_NS) && \ - (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)) + (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,8,0)) int lttng_add_pid_ns_to_ctx(struct lttng_ctx **ctx); #else static inline @@ -820,7 +824,7 @@ int lttng_add_pid_ns_to_ctx(struct lttng_ctx **ctx) #endif #if defined(CONFIG_USER_NS) && \ - (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)) + (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,8,0)) int lttng_add_user_ns_to_ctx(struct lttng_ctx **ctx); #else static inline @@ -831,7 +835,7 @@ int lttng_add_user_ns_to_ctx(struct lttng_ctx **ctx) #endif #if defined(CONFIG_UTS_NS) && \ - (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)) + (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,8,0)) int lttng_add_uts_ns_to_ctx(struct lttng_ctx **ctx); #else static inline