gdb-walkers icon indicating copy to clipboard operation
gdb-walkers copied to clipboard

Create a "histogram" walker

Open hardenedapple opened this issue 4 years ago • 1 comments

For some performance problems the problem is rarely one specific element.

Histogram output (like dtrace can produce) can be very useful. It would be nice to create a walker to produce such output.

This would

  • only be allowed at the end of a pipeline
  • take each pointer coming in, evaluate its expression argument for each one
  • record all the values that the expression yields
  • once its input is finished, print a histogram of the values to stdout
  • ?? Maybe take an argument to determine the buckets, or whether logarithmic vs scalar buckets ??

hardenedapple avatar Jul 17 '20 10:07 hardenedapple

Since gdb has the power to pipe to a shell command, we may just be able to print to stdout and pipe that to gnuplot.

If that's feasible then it would be much better to do that and just write an example in the TODO and help text. If it's currently awkward then might want to write a helper walker to get around the awkwardness rather than entirely one way or the other.

hardenedapple avatar Jul 17 '20 10:07 hardenedapple