Re: [DynInst_API:] Dyninst callpath collection


Date: Thu, 15 Aug 2013 04:55:44 +0000
From: "Legendre, Matthew P." <legendre1@xxxxxxxx>
Subject: Re: [DynInst_API:] Dyninst callpath collection

You probably don't want to use Thread::getCallStack.  If you tried to invoke this on every memory instruction there would be very serious performance problems.  Thread::getCallStack runs from the mutator, so you'd have to signal the mutator, stop the mutatee, context switch, take a stack walk, resume the mutatee, and context switch again.  Your program would probably never reach main.

You'll want to use first-party Stackwalks.  StackwalkerAPI could be linked with the application, and you could call its stack walk routines from instrumentation.  Alternatively, you folks at Rice have a very fast first-party Stackwalker that works well.  You'd probably want to take the stack walk using instrumentation at function entry time rather than at every memory instruction.

You should also be able to use instrumentation at function entry/exit to keep a shadow stack, as you mentioned in your email.  I don't have any experience with this, and don't know if it would be faster (though I suspect it would be).  It would be an interesting thing to explore. 

-Matt



From: Jeff Hollingsworth [hollings@xxxxxxxxxx]
Sent: Wednesday, August 14, 2013 7:16 AM
To: Legendre, Matthew P.
Cc: dyninst-api@xxxxxxxxxxx
Subject: Fwd: [DynInst_API:] Dyninst callpath collection


Matt,

Could you answer this question?  I think it really boils down to a stack walker question.

Jeff


-------- Original Message --------
Subject: [DynInst_API:] Dyninst callpath collection
Date: Tue, 13 Aug 2013 22:51:11 -0700
From: Milind Chabbi <Milind.Chabbi@xxxxxxxx>
To: dyninst-api@xxxxxxxxxxx


I am considering using dyninst for a heavy-weight instrumentation
where I would like to monitor each memory access instruction.
In addition, on each monitored instruction I would like to store the
call path for a later use.
I noticed in the documentation that I can use getCallStack() API to
get the call stack.
I would like to know how getCallStack() works. Does it perform a call
stack unwind or does dyninst maintain a shadow call stack? I imagine
it is the former.
If it is unwinding based, perhaps calling getCallStack() very
frequently is expensive, is there any alternative?

-Milind
_______________________________________________
Dyninst-api mailing list
Dyninst-api@xxxxxxxxxxx
https://lists.cs.wisc.edu/mailman/listinfo/dyninst-api
[← Prev in Thread] Current Thread [Next in Thread→]