kshark_entry contains all information from one trace record, needed in order to visualize the time-series of trace records. Here we reorganize data fields to kshark_entry in order to make room for the unique identifier of the Data stream this entry belongs to. Signed-off-by: Yordan Karadzhov (VMware) <y.karadz@xxxxxxxxx> --- src/libkshark.c | 2 +- src/libkshark.h | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/libkshark.c b/src/libkshark.c index 52aacd3..92e2450 100644 --- a/src/libkshark.c +++ b/src/libkshark.c @@ -489,7 +489,7 @@ static inline void unset_event_filter_flag(struct kshark_context *kshark_ctx, e->visible &= ~event_mask; } -static void set_all_visible(uint16_t *v) { +static void set_all_visible(uint8_t *v) { /* Keep the original value of the PLUGIN_UNTOUCHED bit flag. */ *v |= 0xFF & ~KS_PLUGIN_UNTOUCHED_MASK; } diff --git a/src/libkshark.h b/src/libkshark.h index b57fb5d..726f3d2 100644 --- a/src/libkshark.h +++ b/src/libkshark.h @@ -1,7 +1,7 @@ /* SPDX-License-Identifier: LGPL-2.1 */ /* - * Copyright (C) 2017 VMware Inc, Yordan Karadzhov <y.karadz@xxxxxxxxx> + * Copyright (C) 2017 VMware Inc, Yordan Karadzhov (VMware) <y.karadz@xxxxxxxxx> */ /** @@ -50,7 +50,10 @@ struct kshark_entry { * kshark_filter_masks to check the level of visibility/invisibility * of the entry. */ - uint16_t visible; + uint8_t visible; + + /** Data stream identifier. */ + int8_t stream_id; /** The CPU core of the record. */ int16_t cpu; @@ -58,7 +61,7 @@ struct kshark_entry { /** The PID of the task the record was generated. */ int32_t pid; - /** Unique Id ot the trace event type. */ + /** Unique Id of the trace event type. */ int32_t event_id; /** The offset into the trace file, used to find the record. */ @@ -351,6 +354,9 @@ struct kshark_data_stream { struct kshark_data_stream_interface interface; }; +/** Hard-coded maximum number of data stream. */ +#define KS_MAX_NUM_STREAMS 127 + /** Size of the task's hash table. */ #define KS_TASK_HASH_SHIFT 16 #define KS_TASK_HASH_SIZE (1 << KS_TASK_HASH_SHIFT) -- 2.25.1