Search code examples
c++boostgprof

using gprof and boost


While profiling a bit of code that use's many boost functions with gprof, there is a very nasty and hard to follow output see sample below , is there any way to clean up gprof for use with boost or more boost friendly alternatives? from the looks of it there is a repition of boost::math::policy that is cluttering up the profiling output making it difficult to see or understand the call graph

btw heres the a snippet of an example

boost::math::policies::policy<boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy> >(long double, long double, long double*, long double*, int, boost::math::policies::policy<boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy> const&)

Solution

  • I think you will very much prefer callgrind to gprof. It's part of valgrind, so you probably already have it. You can use kcachegrind to view the results graphically.