Skip to content

Commit

Permalink
decomp_static: call ldmsd_row_cache_make_list() just once
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
morrone authored and tom95858 committed Aug 20, 2024
1 parent b3cb1ec commit c221572
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions ldms/src/decomp/static/decomp_static.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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;
Expand Down

0 comments on commit c221572

Please sign in to comment.