linux-trace-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] kernel-shark-qt: Debug the Quick Context Menu
@ 2018-11-29 14:56 Yordan Karadzhov
  2018-11-29 14:56 ` [PATCH] kernel-shark-qt: Don't use collection when searching for sched_wakeup Yordan Karadzhov
  0 siblings, 1 reply; 2+ messages in thread
From: Yordan Karadzhov @ 2018-11-29 14:56 UTC (permalink / raw)
  To: rostedt; +Cc: linux-trace-devel

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

Signed-off-by: Yordan Karadzhov <ykaradzhov@vmware.com>
---
 kernel-shark-qt/src/KsQuickContextMenu.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel-shark-qt/src/KsQuickContextMenu.cpp b/kernel-shark-qt/src/KsQuickContextMenu.cpp
index 95ffc4f..815e4b9 100644
--- a/kernel-shark-qt/src/KsQuickContextMenu.cpp
+++ b/kernel-shark-qt/src/KsQuickContextMenu.cpp
@@ -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()
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH] kernel-shark-qt: Don't use collection when searching for sched_wakeup
  2018-11-29 14:56 [PATCH] kernel-shark-qt: Debug the Quick Context Menu Yordan Karadzhov
@ 2018-11-29 14:56 ` Yordan Karadzhov
  0 siblings, 0 replies; 2+ messages in thread
From: Yordan Karadzhov @ 2018-11-29 14:56 UTC (permalink / raw)
  To: rostedt; +Cc: linux-trace-devel

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).

Signed-off-by: Yordan Karadzhov <ykaradzhov@vmware.com>
---
 kernel-shark-qt/src/plugins/SchedEvents.cpp | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/kernel-shark-qt/src/plugins/SchedEvents.cpp b/kernel-shark-qt/src/plugins/SchedEvents.cpp
index ea07662..c8dc3bf 100644
--- a/kernel-shark-qt/src/plugins/SchedEvents.cpp
+++ b/kernel-shark-qt/src/plugins/SchedEvents.cpp
@@ -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,
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-11-30  2:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-29 14:56 [PATCH] kernel-shark-qt: Debug the Quick Context Menu Yordan Karadzhov
2018-11-29 14:56 ` [PATCH] kernel-shark-qt: Don't use collection when searching for sched_wakeup Yordan Karadzhov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).