[Crash-utility] [PATCH v4 13/16] set_context(): check if context is already current

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Alexey Makhalov <alexey.makhalov@xxxxxxxxxxxx>

By doing it we avoid dropping gdb caches unnecessarily.

Cc: Sourabh Jain <sourabhjain@xxxxxxxxxxxxx>
Cc: Hari Bathini <hbathini@xxxxxxxxxxxxx>
Cc: Mahesh J Salgaonkar <mahesh@xxxxxxxxxxxxx>
Cc: Naveen N. Rao <naveen.n.rao@xxxxxxxxxxxxxxxxxx>
Cc: Lianbo Jiang <lijiang@xxxxxxxxxx>
Cc: HAGIO KAZUHITO(萩尾 一仁) <k-hagio-ab@xxxxxxx>
Cc: Tao Liu <ltao@xxxxxxxxxx>
Cc: Alexey Makhalov <alexey.makhalov@xxxxxxxxxxxx>
Signed-off-by: Alexey Makhalov <alexey.makhalov@xxxxxxxxxxxx>
---
 task.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/task.c b/task.c
index 8c00837..3814f6d 100644
--- a/task.c
+++ b/task.c
@@ -5287,6 +5287,9 @@ set_context(ulong task, ulong pid, uint update_gdb_thread)
 	struct task_context *tc;
 	int found;
 
+	if (CURRENT_CONTEXT() && CURRENT_TASK() == task)
+		return TRUE;
+
 	tc = FIRST_CONTEXT();
 
         for (i = 0, found = FALSE; i < RUNNING_TASKS(); i++, tc++) {
-- 
2.40.1
--
Crash-utility mailing list -- devel@xxxxxxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxxxxxxxxxxxx
https://${domain_name}/admin/lists/devel.lists.crash-utility.osci.io/
Contribution Guidelines: https://github.com/crash-utility/crash/wiki




[Index of Archives]     [Fedora Development]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [KDE Users]     [Fedora Tools]

 

Powered by Linux