On Fri, Sep 20, 2013 at 11:32:41AM -0400, Josef Bacik wrote:
> I've been wanting to get back to the allocator and make some changes to try and
> fix our fragmenation woes with lots of metadata. But in order to make these
> changes I need to have something to tell me if my changes are making a real
> measurable difference. So this patch adds a bunch of new statistics to
> btrfs-calc-size. It will tell me how long it took to read in the trees, how
> many seeks it had (both forward and backward). It will tell me how far spread
> out the tree is and spit out a nice histogram of the seeks. Here is some sample
> output
Nice!
> + /* Make a tick count as 5% of the total seeks */
> + tick_interval = stat->total_seeks / 20;
> + printf("\tSeek histogram\n");
> + for (; n; n = rb_next(n)) {
> + u64 ticks, gticks = 0;
> +
> + seek = rb_entry(n, struct seek, n);
> + ticks = seek->count / tick_interval;
> + if (group_count)
> + gticks = group_count / tick_interval;
Divsion by zero, core dumped.
> total_size = pretty_sizes(stat.total_bytes);
> + printf("\tTotal size: %s\n", total_size);
> free(total_size);
There's the pretty_size thing that can be used directly in printf and
without free(). I've switched them all and committed to integration.
Please send a separate fix for the 0-division problem.
david
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html