From c221572c39ece274d202b6cffecc3a0ac6351097 Mon Sep 17 00:00:00 2001 From: "Christopher J. Morrone" Date: Thu, 15 Aug 2024 13:04:23 -0700 Subject: [PATCH] decomp_static: call ldmsd_row_cache_make_list() just once We only need to generate the row cache list once before iterating over the columns in the rows. We don't need to fully regenerate the list for each operation. --- ldms/src/decomp/static/decomp_static.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/ldms/src/decomp/static/decomp_static.c b/ldms/src/decomp/static/decomp_static.c index f46dd2916..d51c5d10a 100644 --- a/ldms/src/decomp/static/decomp_static.c +++ b/ldms/src/decomp/static/decomp_static.c @@ -1792,13 +1792,13 @@ static int decomp_static_decompose(ldmsd_strgp_t strgp, ldms_set_t set, dup_row = row_cache_dup(cfg_row, mid_rbn, row); /* Apply functional operators to columns */ + struct ldmsd_row_list_s tmp_row_list; + int count; + count = ldmsd_row_cache_make_list(&tmp_row_list, + cfg_row->row_limit, + strgp->row_cache, + group_idx); for (j = 0; j < row->col_count; j++) { - struct ldmsd_row_list_s row_list; - int count = ldmsd_row_cache_make_list( - &row_list, - cfg_row->row_limit, - strgp->row_cache, - group_idx); cfg_col = &cfg_row->cols[j]; if (cfg_col->op != LDMSD_DECOMP_OP_NONE && count < cfg_row->row_limit) @@ -1809,7 +1809,7 @@ static int decomp_static_decompose(ldmsd_strgp_t strgp, ldms_set_t set, strgp->obj.name, count, cfg_row->row_limit, ldmsd_decomp_op_to_string(cfg_col->op), cfg_col->dst); - rc = op_table[cfg_col->op](&row_list, dup_row, j); + rc = op_table[cfg_col->op](&tmp_row_list, dup_row, j); } ldmsd_row_cache_idx_free(group_idx); row = dup_row;