RE: Context of a kernel routine

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

 



> -----Original Message-----
> From: kernelnewbies-bounce@xxxxxxxxxxxx [mailto:kernelnewbies-
> bounce@xxxxxxxxxxxx] On Behalf Of Mulyadi Santosa
> Sent: Sunday, September 19, 2010 8:13 AM
> To: Vimal
> Cc: Kernel Newbies
> Subject: Re: Context of a kernel routine
> 
> Hi..
> 
> On Sun, Sep 19, 2010 at 08:50, Vimal <j.vimal@xxxxxxxxx> wrote:
> > Most of the times, I just end up tracing the code path manually
> from
> > the source code.  I have another question, though:  Is it possible
> in
> > gdb to break on all function calls?  Would be useful. :)
> 
> 
> None that I know :) But maybe that is doable inside system emulator
> such as Qemu. You need to trap the call of "call", "far jmp" or
> things
> like that. But the problem here is it is done system widely...thus
> you
> need a way to selectively filter which function calls you want to
> trap
> and which ones are not

Regarding the code trace:
Another approach which I used to use. It's ugly but worked for me most of the times. :-)
We can use stack_trace()/dump_stack() functions (same routines which get called when kernel panics or Oops). Pass the stack pointer as NULL and it will dump the stack, register set of current process. 

Question is if it gets called multiple times and flood the console? 
You can create a sysctl entry - enable it (non-zero) from command prompt, once you get the expected trace - make sysctl_variable = 0 (will disable the function calls) :-)

Something like: 
if(sysctl_variable)
	stack_trace(NULL); 

> 
> --
> regards,
> 
> Mulyadi Santosa
> Freelance Linux trainer and consultant
> 
> blog: the-hydra.blogspot.com
> training: mulyaditraining.blogspot.com
> 

--
Thanks,
Nilesh

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