aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/sched_events.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/sched_events.h')
-rw-r--r--src/plugins/sched_events.h50
1 files changed, 17 insertions, 33 deletions
diff --git a/src/plugins/sched_events.h b/src/plugins/sched_events.h
index dbc9963c..4c576065 100644
--- a/src/plugins/sched_events.h
+++ b/src/plugins/sched_events.h
@@ -1,7 +1,7 @@
/* SPDX-License-Identifier: LGPL-2.1 */
/*
- * Copyright (C) 2017 VMware Inc, Yordan Karadzhov <y.karadz@gmail.com>
+ * Copyright (C) 2017 VMware Inc, Yordan Karadzhov (VMware) <y.karadz@gmail.com>
*/
/**
@@ -14,6 +14,7 @@
// KernelShark
#include "libkshark.h"
+#include "libkshark-plugin.h"
#ifdef __cplusplus
extern "C" {
@@ -21,11 +22,8 @@ extern "C" {
/** Structure representing a plugin-specific context. */
struct plugin_sched_context {
- /** Input handle for the trace data file. */
- struct tracecmd_input *handle;
-
/** Page event used to parse the page. */
- struct tep_handle *pevent;
+ struct tep_handle *tep;
/** Pointer to the sched_switch_event object. */
struct tep_event *sched_switch_event;
@@ -39,47 +37,33 @@ struct plugin_sched_context {
/** Pointer to the sched_switch_prev_state_field format descriptor. */
struct tep_format_field *sched_switch_prev_state_field;
- /** Pointer to the sched_wakeup_event object. */
- struct tep_event *sched_wakeup_event;
-
- /** Pointer to the sched_wakeup_pid_field format descriptor. */
- struct tep_format_field *sched_wakeup_pid_field;
-
- /** Pointer to the sched_wakeup_new_event object. */
- struct tep_event *sched_wakeup_new_event;
-
- /** Pointer to the sched_wakeup_new_pid_field format descriptor. */
- struct tep_format_field *sched_wakeup_new_pid_field;
-
/** Pointer to the sched_waking_event object. */
struct tep_event *sched_waking_event;
/** Pointer to the sched_waking_pid_field format descriptor. */
struct tep_format_field *sched_waking_pid_field;
- /** List of Data collections used by this plugin. */
- struct kshark_entry_collection *collections;
+ /** True if the second pass is already done. */
+ bool second_pass_done;
- /** Hash of the tasks for which the second pass is already done. */
- struct tracecmd_filter_id *second_pass_hash;
-};
+ /** Data container for sched_switch data. */
+ struct kshark_data_container *ss_data;
-int plugin_get_next_pid(struct tep_record *record);
+ /** Data container for sched_waking data. */
+ struct kshark_data_container *sw_data;
+};
-bool plugin_wakeup_match_rec_pid(struct kshark_context *kshark_ctx,
- struct kshark_entry *e, int pid);
+KS_DEFINE_PLUGIN_CONTEXT(struct plugin_sched_context);
-bool plugin_switch_match_rec_pid(struct kshark_context *kshark_ctx,
- struct kshark_entry *e, int pid);
+/** The type of the data field stored in the kshark_data_container object. */
+typedef int64_t ks_num_field_t;
-bool plugin_switch_match_entry_pid(struct kshark_context *kshark_ctx,
- struct kshark_entry *e,
- int pid);
+int plugin_sched_get_pid(ks_num_field_t field);
-bool plugin_match_pid(struct kshark_context *kshark_ctx,
- struct kshark_entry *e, int pid);
+int plugin_sched_get_prev_state(ks_num_field_t field);
-void plugin_draw(struct kshark_cpp_argv *argv, int pid, int draw_action);
+void plugin_draw(struct kshark_cpp_argv *argv, int sd, int pid,
+ int draw_action);
#ifdef __cplusplus
}