paycheck: fix errors around percentage / formatting of zero sizes

This fixes two problems, both having to do with histogram generation:

* When the total number of elements is zero, paycheck would crash due to
  a division by zero; further, even if the crash is fixed (returning,
  say, None) the histogram will contain a meaningless value in
  parenthesis, which we might as well drop. Both are fixed here.

* When some size (say, bytes) is zero, its formatter
  (bytes-to-human-readable) returns None, which shows up as is in the
  final report. This should be checked and avoided.

BUG=None
TEST=Crash fixed; None percentage/formatted value omitted.

Change-Id: I8bb5fbc47e1cde9dcbee7f7b96bcb63ef3a0935e
Reviewed-on: https://chromium-review.googlesource.com/172046
Reviewed-by: Don Garrett <dgarrett@chromium.org>
Commit-Queue: Gilad Arnold <garnold@chromium.org>
Tested-by: Gilad Arnold <garnold@chromium.org>
3 files changed
tree: a969f9169908b5ea4c73c1608238f3d5244575eb
  1. scripts/