cmd/bent: add pgo benchmarking scenario

How to use.

The configuration for PGO measurements is located in the configurations-pgo.toml
file. This file contains two configurations, and you will need both of them.
The first configuration "pgo-generate" is enabled by default. It has a new
field "PgoGen", than contains a name of a sub-directory, where the .prof files
will be put. The second configuration "pgo-use" is disabled by default. This
configuration is needed to use the .prof files that were created during the
first phase. It has a new field "PgoUse", with a sub-directory path to .prof

The usages scenario is the following:

1. Run bent with the configuration "pgo-generate" to create .prof files
2. Disable the configuration "pgo-generate" and enable "pgo-use"
3. Run bent with this configuration. This will be pgo-guided run with
   better performance

Notes: we need two new fields, because PgoGen do not add any option,
but is enables environment variables for cpuprofile script. The PgoUse
option adds the -pgo=<path to prof file> to the build line. Probably we
could avoid a step with enabling/disabling configuration for our comfort,
but I do not know how to set the particular order of configuration launches.

Change-Id: I04adf494a01e62b491cc9afce7eed49b19f9fae5
Reviewed-by: Than McIntosh <>
Reviewed-by: David Chase <>
LUCI-TryBot-Result: Go LUCI <>
4 files changed