diff options
author | Raphael Herouart <rherouart@google.com> | 2024-02-16 05:11:22 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2024-02-16 05:11:22 +0000 |
commit | 742029a5cbffb9a1e6e5f0fa84c844d34adf6690 (patch) | |
tree | 3056743a3e59fcb98ff1e378f7665d56b3234722 | |
parent | d3aa42392bae0a11254b75673f997840af03a916 (diff) | |
parent | 9889688628212806becc69b0329845da9de27e70 (diff) | |
download | trusty-742029a5cbffb9a1e6e5f0fa84c844d34adf6690.tar.gz |
include/shared/lk/: Missing value callback for BENCH_RESULT am: 9889688628
Original change: https://android-review.googlesource.com/c/trusty/lk/trusty/+/2921731
Change-Id: I74c1157394f89392d55666ed48f610f5c4fd387f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r-- | include/shared/lk/trusty_bench_print_tables.h | 35 |
1 files changed, 22 insertions, 13 deletions
diff --git a/include/shared/lk/trusty_bench_print_tables.h b/include/shared/lk/trusty_bench_print_tables.h index 8f5e1a4..1eb76e9 100644 --- a/include/shared/lk/trusty_bench_print_tables.h +++ b/include/shared/lk/trusty_bench_print_tables.h @@ -271,16 +271,20 @@ static inline void trusty_bench_print_params(struct list_node* metric_list) { * @val: Value to print * @metric_name: Metric for which the aggregate stat is to be printed. */ -static inline void trusty_bench_print_col_stat(size_t sz, - int64_t val, - const char* metric_name) { - if (trusty_bench_get_formatted_value_cb == NULL) { +static inline void trusty_bench_print_col_stat( + size_t sz, + int64_t val, + const char* metric_name, + trusty_bench_get_formatted_value_callback_t value_format_cb) { + if (value_format_cb == NULL) { + value_format_cb = trusty_bench_get_formatted_value_cb; + } + if (value_format_cb == NULL) { trusty_unittest_printf("%*" PRId64 "|", (int)sz, val); } else { char buffer[32]; - trusty_bench_get_formatted_value_cb(buffer, sizeof(buffer), val, - metric_name); + value_format_cb(buffer, sizeof(buffer), val, metric_name); if (trusty_bench_validate_numeric(buffer)) { trusty_unittest_printf("%*s|", (int)sz, buffer); } else { @@ -311,10 +315,11 @@ static inline void trusty_bench_print_stat(struct list_node* metric_list, trusty_unittest_printf("|"); } else if (idx == BENCH_AGGREGATE_COLD) { trusty_bench_print_col_stat(entry->col_sz, entry->metric.cold, - entry->name); + entry->name, entry->formatted_value_cb); } else { - trusty_bench_print_col_stat( - entry->col_sz, entry->metric.aggregates[idx], entry->name); + trusty_bench_print_col_stat(entry->col_sz, + entry->metric.aggregates[idx], + entry->name, entry->formatted_value_cb); } } trusty_unittest_printf("\n"); @@ -420,15 +425,19 @@ static inline void trusty_bench_print_vertical_metric_list( if (entry->metric.cnt) { trusty_bench_print_col_stat( trusty_bench_max_metric_digit_width, - entry->metric.aggregates[BENCH_AGGREGATE_MIN], entry->name); + entry->metric.aggregates[BENCH_AGGREGATE_MIN], entry->name, + entry->formatted_value_cb); trusty_bench_print_col_stat( trusty_bench_max_metric_digit_width, - entry->metric.aggregates[BENCH_AGGREGATE_AVG], entry->name); + entry->metric.aggregates[BENCH_AGGREGATE_AVG], entry->name, + entry->formatted_value_cb); trusty_bench_print_col_stat( trusty_bench_max_metric_digit_width, - entry->metric.aggregates[BENCH_AGGREGATE_MAX], entry->name); + entry->metric.aggregates[BENCH_AGGREGATE_MAX], entry->name, + entry->formatted_value_cb); trusty_bench_print_col_stat(trusty_bench_max_metric_digit_width, - entry->metric.cold, entry->name); + entry->metric.cold, entry->name, + entry->formatted_value_cb); } else { for (int i = 0; i < 4; i++) { trusty_bench_center_print(trusty_bench_max_metric_digit_width, |