Scalability fix for many events: event hash table size
[lttng-ust.git] / include / lttng / ust-events.h
index e45a6a7187621afc1a09175cacf68409cbc52f23..b5d758500af19382249bb23f60404a9bc8b96f86 100644 (file)
  *
  * The above copyright notice and this permission notice shall be included in
  * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
  */
 
 #include <urcu/list.h>
@@ -291,14 +299,27 @@ struct lttng_event;
 
 struct lttng_ust_filter_bytecode_node {
        struct cds_list_head node;
-       struct lttng_ust_filter_bytecode bc;
        struct lttng_enabler *enabler;
+       /*
+        * struct lttng_ust_filter_bytecode has var. sized array, must
+        * be last field.
+        */
+       struct lttng_ust_filter_bytecode bc;
+};
+
+/*
+ * Filter return value masks.
+ */
+enum lttng_filter_ret {
+       LTTNG_FILTER_DISCARD = 0,
+       LTTNG_FILTER_RECORD_FLAG = (1ULL << 0),
+       /* Other bits are kept for future use. */
 };
 
 struct lttng_bytecode_runtime {
        /* Associated bytecode */
        struct lttng_ust_filter_bytecode_node *bc;
-       int (*filter)(void *filter_data, const char *filter_stack_data);
+       uint64_t (*filter)(void *filter_data, const char *filter_stack_data);
        int link_failed;
        struct cds_list_head node;      /* list of bytecode runtime in event */
 };
@@ -338,9 +359,10 @@ struct lttng_event {
        /* LTTng-UST 2.1 starts here */
        /* list of struct lttng_bytecode_runtime, sorted by seqnum */
        struct cds_list_head bytecode_runtime_head;
-
+       int has_enablers_without_bytecode;
        /* Backward references: list of lttng_enabler_ref (ref to enablers) */
        struct cds_list_head enablers_ref_head;
+       struct cds_hlist_node hlist;    /* session ht of events */
 };
 
 struct channel;
@@ -418,7 +440,7 @@ struct lttng_channel {
        unsigned char uuid[LTTNG_UST_UUID_LEN]; /* Trace session unique ID */
 };
 
-#define LTTNG_UST_EVENT_HT_BITS                6
+#define LTTNG_UST_EVENT_HT_BITS                12
 #define LTTNG_UST_EVENT_HT_SIZE                (1U << LTTNG_UST_EVENT_HT_BITS)
 
 struct lttng_ust_event_ht {
@@ -446,6 +468,7 @@ struct lttng_session {
        /* New UST 2.1 */
        /* List of enablers */
        struct cds_list_head enablers_head;
+       struct lttng_ust_event_ht events_ht;    /* ht of events */
 };
 
 struct lttng_transport {
@@ -500,8 +523,6 @@ void synchronize_trace(void);
 int lttng_probe_register(struct lttng_probe_desc *desc);
 void lttng_probe_unregister(struct lttng_probe_desc *desc);
 int lttng_fix_pending_event_desc(const struct lttng_event_desc *desc);
-const struct lttng_event_desc *lttng_event_get(const char *name);
-void lttng_event_put(const struct lttng_event_desc *desc);
 int lttng_probes_init(void);
 void lttng_probes_exit(void);
 int lttng_find_context(struct lttng_ctx *ctx, const char *name);
This page took 0.024001 seconds and 4 git commands to generate.