raminski at hotmail.co.uk
2007-Jul-24 15:25 UTC
[dtrace-discuss] Capture kernel stack if a function is called from a specific function
Hi all, I''ve tried hunting for examples of this to no avail. I''ve also purchased the Solaris Performance and Tools book but havn''t found what I want there either :( What i''m after is a specific way of obtaining a kernel stack (possible args, but stack would do fine to start with as I''m sure (hope) I could work out what args I want to capture if needed), if and only if, it was called by a certain other function. My kernel module can call other routines, not necessarily in the same module, it maybe in genunix module. i.e. one example, say my module sometimes calls timeout(9f) from it''s routine called internal_timeout. What I want to use dtrace to do, is capture the stack in timeout, if and only if it was called from my modules routine internal_timeout... the reason for this is because i''m sure timeout (and others) is probably a very popular routine, so I want to limit the output. hopefull you get my drift. any help would be muchly appreciated, thanks in advance, regards, Raminski. -- This message posted from opensolaris.org
Michael Schuster
2007-Jul-24 15:26 UTC
[dtrace-discuss] Capture kernel stack if a function is called from a specific function
raminski at hotmail.co.uk wrote:> Hi all, > > I''ve tried hunting for examples of this to no avail. I''ve also purchased >the Solaris Performance and Tools book but havn''t found what I want there either :(> > What i''m after is a specific way of obtaining a kernel stack (possibleargs, but stack would do fine to start with as I''m sure (hope) I could work out what args I want to capture if needed), if and only if, it was called by a certain other function. My kernel module can call other routines, not necessarily in the same module, it maybe in genunix module. [..] try this (or something similar): fbt::internal_timeout:entry { self->watch = 1; } fbt::timeout:entry /self->watch/ { printf... } fbt::internal_timeout:return /self->watch/ { self->watch = 0; } HTH -- Michael Schuster Sun Microsystems, Inc. Recursion, n.: see ''Recursion''
raminski at hotmail.co.uk
2007-Jul-25 06:47 UTC
[dtrace-discuss] Capture kernel stack if a function is called from a specific function
Michael, Thanks for the prompt reply. I''ll give it a go. regards -- This message posted from opensolaris.org
michael schuster
2007-Jul-25 06:57 UTC
[dtrace-discuss] Capture kernel stack if a function is called from a specific function
raminski at hotmail.co.uk wrote:> Michael, > > Thanks for the prompt reply. I''ll give it a go.yw. It just occurred to me that you wanted the stack, so replace the "printf" I gave yesterday with "stack". Michael -- Michael Schuster Sun Microsystems, Inc. recursion, n: see ''recursion''