0

Is it possible to collect call stack history in Visual Studio? That is, whenever the call stack changes at runtime, I'd like to capture a snapshot of the stack trace and write it to a log perhaps for later parsing.

EDIT: If it's possible, what's the best way to collect call stack history in Visual Studio?

solstice333
  • 2,617
  • 19
  • 26
  • Yes, it's theoretically possible. Realistically, you *really* want to narrow down the data you collect a *lot*. Let's say an average stack trace generates one kilobyte of data, and you're calling/returning from functions an average of a million times a second. That works out to logging one gigabyte per second. Unless you invest a lot in fast hard drives (or SSDs) this is going to slow your program to a crawl. – Jerry Coffin May 03 '17 at 23:13
  • Right, I was thinking of adjusting the delta of where to start begin capturing and when to stop capturing. – solstice333 May 03 '17 at 23:36
  • Related: [Function Call Stack in C++](http://stackoverflow.com/questions/17069557/function-call-stack-in-c) – sergiol May 04 '17 at 00:29
  • What you're talking about is *tracing*. It generates enormous quantities of data, far too much to analyze in any sensible way. Is your overall goal to find ways to speed up the software? There are better ways to do that. – Mike Dunlavey May 04 '17 at 13:38
  • Probably related: http://stackoverflow.com/questions/4394606/beyond-stack-sampling-c-profilers – osgx May 09 '17 at 20:12

0 Answers0