simpleperf: add --sort option in stat cmd.

In stat cmd, if --per-thread or --per-core is used, we need to
sort entries belong to one event. So add --sort option to select
sort keys (like in report cmd).

Also make the default sort key to sort by cpu before sorting by count.

Also adding cpu column in csv output when --per-core is used.

Bug: 159159465
Test: run simpleperf_unit_test.
Change-Id: I7d711c86ae3282cc40bdb8662f06f8058a205028
4 files changed