Re: [PATCH v4 2/5] histograms: Add traceeval initialize and release

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed,  9 Aug 2023 13:53:35 -0400
Stevie Alvarez <stevie.6strings@xxxxxxxxx> wrote:

> From: Stevie Alvarez (Google) <stevie.6strings@xxxxxxxxx>
> 
> traceeval_init() creates a new struct traceeval instance with regards
> to the struct traceeval_type array arguments keys and vals. These arrays
> define the structure of the histogram, with each describing the expected
> structure of inserted arrays of union traceeval_data. The keys and vals
> arguments are copied on the heap to ensure that the struct traceeval
> instance has access to the definition regardless of how the user
> initialized keys and vals.
> 
> traceeval_init() uses traceeval_release() and it's helper functions to
> clean up on error.
> 
> traceeval_release() deconstructs a given struct traceeval instance. It
> frees any data allocated to the heap within the entries to the histogram,
> and the names allocated for the struct traceeval_type key-value
> definitions.
> 
> Signed-off-by: Stevie Alvarez (Google) <stevie.6strings@xxxxxxxxx>
> ---
>  Makefile                 |   2 +-
>  include/traceeval-hist.h |   7 +
>  src/Makefile             |   1 +
>  src/histograms.c         | 315 +++++++++++++++++++++++++++++++++++++++
>  4 files changed, 324 insertions(+), 1 deletion(-)
>  create mode 100644 src/histograms.c
> 
> diff --git a/Makefile b/Makefile
> index 4a24d5a..3ea051c 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -172,7 +172,7 @@ libs: $(LIBRARY_A) $(LIBRARY_SO)
>  
>  VALGRIND = $(shell which valgrind)
>  UTEST_DIR = utest
> -UTEST_BINARY = trace-utest
> +UTEST_BINARY = eval-utest
>  

I forgot to mention this in previous reviews. I'm assuming this was a
leftover from previous versions?

Rest of this patch looks good.

-- Steve


>  test: force $(LIBRARY_STATIC)
>  ifneq ($(CUNIT_INSTALLED),1)
> diff --git a/include/traceeval-hist.h b/include/traceeval-hist.h
> index 3565756..63e8b0e 100644
> --- a/include/traceeval-hist.h
> +++ b/include/traceeval-hist.h
> @@ -127,4 +127,11 @@ struct traceeval_iterator;
>  



[Index of Archives]     [Linux USB Development]     [Linux USB Development]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux