Re: Multithreaded debugging of kernel using kgdb

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

 



Hi Rick..

very late reply....sorry...
I am debugging Linux kernel using gdb (KGDB patch). I am successsfully
able to set breakpoints in the kernel and step though the code as far
as a single thread of execution is concerned.

Before I forget, I suggest to check any related kgdb documentations to see whether kgdb really support multi processing.
However, I was curious so as to how can I simulate and debug a race
condition that involves multiple threads?

For e.g., I want to simulate and analyse the state of some data structures when:

Process P1 takes a semaphore S.
......
(At certain time) Process P2 becomes runnable and preempts P1

How do I perform a context switch and simulate that "while P1 is
executing this instruction, P2 preempts it". Is it possible?
Tough work IMHO. Since I don't really know about kgdb, I think what you have to do here is to increase the probability of P1 being preempted by P2. However, this depends on what you really want to observe. How about doing a long loop doing only "nop" (no operation assembly) on P1? near in the future, P2 would certainly preempt it. Now, assume it would hit certain condition checks, you might tell kgdb to interrupt it.

What do you think?

regards,

Mulyadi


--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux