@@ -427,7 +427,14 @@ static bool filter_is_set(struct tracecmd_filter_id *filter)
return filter && filter->count;
}
-static bool kshark_filter_is_set(struct kshark_context *kshark_ctx)
+/**
+ * @brief Check if an Id filter is set.
+ *
+ * @param kshark_ctx: Input location for the session context pointer.
+ *
+ * @returns True if at least one Id filter is set, otherwise False.
+ */
+bool kshark_filter_is_set(struct kshark_context *kshark_ctx)
{
return filter_is_set(kshark_ctx->show_task_filter) ||
filter_is_set(kshark_ctx->hide_task_filter) ||
@@ -499,6 +506,25 @@ void kshark_filter_entries(struct kshark_context *kshark_ctx,
}
}
+/**
+ * @brief This function loops over the array of entries specified by "data"
+ * and "n_entries" and resets the "visible" fields of each entry to
+ * the default value of "0xFF" (visible everywhere).
+ *
+ * @param kshark_ctx: Input location for the session context pointer.
+ * @param data: Input location for the trace data to be filtered.
+ * @param n_entries: The size of the inputted data.
+ */
+void kshark_clear_all_filters(struct kshark_context *kshark_ctx,
+ struct kshark_entry **data,
+ size_t n_entries)
+{
+ int i;
+
+ for (i = 0; i < n_entries; ++i)
+ data[i]->visible = 0xFF;
+}
+
static void kshark_set_entry_values(struct kshark_context *kshark_ctx,
struct tep_record *record,
struct kshark_entry *entry)
@@ -224,10 +224,16 @@ void kshark_filter_add_id(struct kshark_context *kshark_ctx,
void kshark_filter_clear(struct kshark_context *kshark_ctx, int filter_id);
+bool kshark_filter_is_set(struct kshark_context *kshark_ctx);
+
void kshark_filter_entries(struct kshark_context *kshark_ctx,
struct kshark_entry **data,
size_t n_entries);
+void kshark_clear_all_filters(struct kshark_context *kshark_ctx,
+ struct kshark_entry **data,
+ size_t n_entries);
+
/** Search failed identifiers. */
enum kshark_search_failed {
/** All entries have timestamps greater timestamps. */