libtraceeval: Fix allocation of val_stats
PATCH 1/1 libtraceeval: Fix allocation of val_stats
From: "Steven Rostedt (Google)" <[email protected]>
The val_stats is to be the same size as the number of val types. But the number of key times was used to create the size.
Fixes 8df588c6bc128 ("libtraceeval histogram: Add updating of stats")
Signed-off-by Steven Rostedt (Google) <[email protected]>
--- src/histograms.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
src/histograms.c +1 -1
@@ -740,7 +740,7 @@ static int create_entry(struct traceeval *teval,if (!entry)return -1 ; - entry->val_stats =calloc (teval->nr_key_types,sizeof (*entry->val_stats)); + entry->val_stats =calloc (teval->nr_val_types,sizeof (*entry->val_stats));if (!entry->val_stats) goto fail_entry;
Signature · 1 line
2.40.1
Quoted 7 lines · Steven Rostedt
From: "Steven Rostedt (Google)" <[email protected]>
The
val_statsis to be the same size as the number of val types. But the number of key times was used to create the size.Fixes 8df588c6bc128 ("libtraceeval histogram: Add updating of stats")Signed-off-by Steven Rostedt (Google) <[email protected]>
Reviewed-by Ross Zwisler <[email protected]>