linux-trace-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] libtraceeval: Fix allocation of val_stats
@ 2023-09-27  8:19 Steven Rostedt
  2023-10-02 18:33 ` Ross Zwisler
  0 siblings, 1 reply; 2+ messages in thread
From: Steven Rostedt @ 2023-09-27  8:19 UTC (permalink / raw)
  To: Linux Trace Devel; +Cc: Ross Zwisler, Stevie Alvarez

From: "Steven Rostedt (Google)" <rostedt@goodmis.org>

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) <rostedt@goodmis.org>
---
 src/histograms.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/histograms.c b/src/histograms.c
index 42959c154a11..fdc9f0c2fbce 100644
--- a/src/histograms.c
+++ b/src/histograms.c
@@ -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;
 
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] libtraceeval: Fix allocation of val_stats
  2023-09-27  8:19 [PATCH] libtraceeval: Fix allocation of val_stats Steven Rostedt
@ 2023-10-02 18:33 ` Ross Zwisler
  0 siblings, 0 replies; 2+ messages in thread
From: Ross Zwisler @ 2023-10-02 18:33 UTC (permalink / raw)
  To: Steven Rostedt; +Cc: Linux Trace Devel, Ross Zwisler, Stevie Alvarez

On Wed, Sep 27, 2023 at 04:19:01AM -0400, Steven Rostedt wrote:
> From: "Steven Rostedt (Google)" <rostedt@goodmis.org>
> 
> 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) <rostedt@goodmis.org>

Reviewed-by: Ross Zwisler <zwisler@google.com>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-10-02 18:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-27  8:19 [PATCH] libtraceeval: Fix allocation of val_stats Steven Rostedt
2023-10-02 18:33 ` Ross Zwisler

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).