Skip to contentSkip to conversation

kernel-shark-qt: Debug the Quick Context Menu

PATCH New Yordan Karadzhov 1 participant 2 messages Nov 30, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kernel-shark-qt: Debug the Quick Context Menu

This patch fixes a simple bug in KsQuickContextMenu::_hideTask().

---
 kernel-shark-qt/src/KsQuickContextMenu.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel-shark-qt/src/KsQuickContextMenu.cpp +1 -1
index 95ffc4f..815e4b9 100644
@@ -168,7 +168,7 @@ void KsQuickContextMenu::_hideTask()
 		return;
 
 	vec =_getFilterVector(kshark_ctx->hide_task_filter, pid);
-	_data->applyPosTaskFilter(vec);
+	_data->applyNegTaskFilter(vec);
 }
 
 void KsQuickContextMenu::_showTask()
Signature · 1 line
2.17.1
#1 lore raw

PATCH 1/1 kernel-shark-qt: Don't use collection when searching for sched_wakeup

This patch modifies the way the wake up latency is plotted by the Sched events plugin. The sched_wakeup event does not belong to the task it is waking, hence we cannot use the task's collection to search for it. It was partially working so far because in most of the cases the sched_wakeup event happened to be inside the "margins" of the collection. Note that if we do not use collection when searching, the time complexity of the plugin becomes linear. However, this should not be a problem, because we have an explicit cut which disables plotting if the number of entries shown by the graph is bigger than PLUGIN_MAX_ENTRIES (10 000).

---
 kernel-shark-qt/src/plugins/SchedEvents.cpp | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
kernel-shark-qt/src/plugins/SchedEvents.cpp +7 -3
index ea07662..c8dc3bf 100644
@@ -122,7 +122,7 @@ static void pluginDraw(plugin_sched_context *plugin_ctx,
 			/*
 			 * Starting from the last element in this bin, go backward
 			 * in time until you find a trace entry that satisfies the
-			 * condition defined by plugin_switch_match_pid.
+			 * condition defined by plugin_switch_match_rec_pid.
 			 */
 			entryOpen =
 				ksmodel_get_entry_back(histo, bin, false,
@@ -133,12 +133,16 @@ static void pluginDraw(plugin_sched_context *plugin_ctx,
 			/*
 			 * Starting from the last element in this bin, go backward
 			 * in time until you find a trace entry that satisfies the
-			 * condition defined by plugin_wakeup_match_pid.
+			 * condition defined by plugin_wakeup_match_rec_pid. Note
+			 * that the wakeup event does not belong to this task,
+			 * hence we cannot use the task's collection.
 			 */
 			entryOpen =
 				ksmodel_get_entry_back(histo, bin, false,
 						       plugin_wakeup_match_rec_pid,
-						       pid, col, &indexOpen);
+						       pid,
+						       nullptr, // No collection.
+						       &indexOpen);
 
 			if (entryOpen) {
 				int cpu = ksmodel_get_cpu_back(histo, bin,
Signature · 1 line
2.17.1