afdo_redaction: Implement a script to remove cold functions in AFDO profiles.

Implement a script to keep removing cold functions in AFDO profiles
until the target is met. The result will be a smaller profile that
can possibly result in smaller binary size. Also support passing
the source CWP and benchmark profiles to analyze how many functions
are trimmed from the source profiles, etc.

The script will be used in experimental AFDO pipeline first, no
impact on prod profiles so far.

BUG=chromium:1062014
TEST=unittest pass

Change-Id: I651ce3f47ee8061557e3f1cdc83fd770e1b2b9ad
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2216445
Reviewed-by: George Burgess <gbiv@chromium.org>
Commit-Queue: Tiancong Wang <tcwang@google.com>
Tested-by: Tiancong Wang <tcwang@google.com>
2 files changed