mbox series

[v2,0/5] histograms: bug fixes and convention compliance

Message ID 20230803225413.40697-1-stevie.6strings@gmail.com (mailing list archive)
Headers show
Series histograms: bug fixes and convention compliance | expand

Message

Stevie Alvarez Aug. 3, 2023, 10:53 p.m. UTC
From: "Stevie Alvarez (Google)" <stevie.6strings@gmail.com>

Changes in v2:
 * Renamed interface from histograms.h to traceeval-hist.h.
 * Internal traceeval_type arrays terminated by size rather than type.
 * type_alloc() guarantees traceeval_type name field is a valid pointer.
 * traceeval_release() sets released pointers to NULL.
 * Conditional simplifications and fixes across the board. 
 * Removed function stubs and their interface definitions.
 * Added a timestamp flag.
 * Added typedefs for traceeval_dynamic helper function signatures. 
 * Documentation follows established conventions (kernel docs, line comments).
 * Documentation moved from interface to source code.
 * Internal testing interface.
 * General documentation spell checking.

Since the addition of the traceeval_dynamic function signature typedefs,
warnings pertaining to these function signatures and traceeval_type have
popped up. Steven, Ross, and anyone else, any ideas on why these
warnings are showing up?

Warning from function signatures in include/traceeval-hist.h, line 65 and 69:
	warning: ‘struct traceeval_type’ declared inside parameter list will
	not be visible outside of this definition or declaration

		struct traceeval_type *);

Warning from dyn_release call in src/histograms.c line 258:
	warning: passing argument 2 of
	‘(defs + (sizetype)(i * 48))->dyn_release’ from incompatible
	pointer type

		defs[i].dyn_release(data[i].dyn_data, &defs[i]);

	note: expected ‘struct traceeval_type *’ but argument is of type
	‘struct traceeval_type *’

Warning from dyn_cmp call in src/histograms.c line 409:
	warning: passing argument 3 of ‘type->dyn_cmp’ from incompatible
	pointer type

		return type->dyn_cmp(orig->dyn_data, copy->dyn_data, type);

	note: expected ‘struct traceeval_type *’ but argument is of type
	‘struct traceeval_type *’

---
v1 discussion: https://lore.kernel.org/linux-trace-devel/20230731212542.3fb668b1@gandalf.local.home/T/

Stevie Alvarez (Google) (5):
  histograms: Initial histograms interface
  histograms: Add traceeval initialize
  histograms: Add traceeval release
  histograms: Add traceeval compare
  histograms: Initial unit tests

 Makefile                 |   2 +-
 include/traceeval-hist.h | 135 ++++++++++
 include/traceeval-test.h |  15 ++
 src/Makefile             |   1 +
 src/histograms.c         | 522 +++++++++++++++++++++++++++++++++++++++
 utest/.gitignore         |   1 +
 utest/Makefile           |  35 +++
 utest/eval-test.h        |  13 +
 utest/eval-utest.c       |  28 +++
 utest/traceeval-utest.c  | 217 ++++++++++++++++
 10 files changed, 968 insertions(+), 1 deletion(-)
 create mode 100644 include/traceeval-hist.h
 create mode 100644 include/traceeval-test.h
 create mode 100644 src/histograms.c
 create mode 100644 utest/.gitignore
 create mode 100644 utest/Makefile
 create mode 100644 utest/eval-test.h
 create mode 100644 utest/eval-utest.c
 create mode 100644 utest/traceeval-utest.c

Comments

Steven Rostedt Aug. 4, 2023, 12:37 p.m. UTC | #1
On Thu,  3 Aug 2023 18:53:58 -0400
Stevie Alvarez <stevie.6strings@gmail.com> wrote:

> From: "Stevie Alvarez (Google)" <stevie.6strings@gmail.com>
> 
> Changes in v2:
>  * Renamed interface from histograms.h to traceeval-hist.h.
>  * Internal traceeval_type arrays terminated by size rather than type.
>  * type_alloc() guarantees traceeval_type name field is a valid pointer.
>  * traceeval_release() sets released pointers to NULL.
>  * Conditional simplifications and fixes across the board. 
>  * Removed function stubs and their interface definitions.
>  * Added a timestamp flag.
>  * Added typedefs for traceeval_dynamic helper function signatures. 
>  * Documentation follows established conventions (kernel docs, line comments).
>  * Documentation moved from interface to source code.
>  * Internal testing interface.
>  * General documentation spell checking.
> 
> Since the addition of the traceeval_dynamic function signature typedefs,
> warnings pertaining to these function signatures and traceeval_type have
> popped up. Steven, Ross, and anyone else, any ideas on why these
> warnings are showing up?
> 
> Warning from function signatures in include/traceeval-hist.h, line 65 and 69:
> 	warning: ‘struct traceeval_type’ declared inside parameter list will
> 	not be visible outside of this definition or declaration
> 
> 		struct traceeval_type *);

This is because the typedef is before the declaration. Just add:

struct traceeval_type;

above it.

> 
> Warning from dyn_release call in src/histograms.c line 258:
> 	warning: passing argument 2 of
> 	‘(defs + (sizetype)(i * 48))->dyn_release’ from incompatible
> 	pointer type
> 
> 		defs[i].dyn_release(data[i].dyn_data, &defs[i]);

Try passing in: defs + i

I'll review these later today.

-- Steve

> 
> 	note: expected ‘struct traceeval_type *’ but argument is of type
> 	‘struct traceeval_type *’
> 
> Warning from dyn_cmp call in src/histograms.c line 409:
> 	warning: passing argument 3 of ‘type->dyn_cmp’ from incompatible
> 	pointer type
> 
> 		return type->dyn_cmp(orig->dyn_data, copy->dyn_data, type);
> 
> 	note: expected ‘struct traceeval_type *’ but argument is of type
> 	‘struct traceeval_type *’
> 
> ---
> v1 discussion: https://lore.kernel.org/linux-trace-devel/20230731212542.3fb668b1@gandalf.local.home/T/
> 
> Stevie Alvarez (Google) (5):
>   histograms: Initial histograms interface
>   histograms: Add traceeval initialize
>   histograms: Add traceeval release
>   histograms: Add traceeval compare
>   histograms: Initial unit tests
> 
>  Makefile                 |   2 +-
>  include/traceeval-hist.h | 135 ++++++++++
>  include/traceeval-test.h |  15 ++
>  src/Makefile             |   1 +
>  src/histograms.c         | 522 +++++++++++++++++++++++++++++++++++++++
>  utest/.gitignore         |   1 +
>  utest/Makefile           |  35 +++
>  utest/eval-test.h        |  13 +
>  utest/eval-utest.c       |  28 +++
>  utest/traceeval-utest.c  | 217 ++++++++++++++++
>  10 files changed, 968 insertions(+), 1 deletion(-)
>  create mode 100644 include/traceeval-hist.h
>  create mode 100644 include/traceeval-test.h
>  create mode 100644 src/histograms.c
>  create mode 100644 utest/.gitignore
>  create mode 100644 utest/Makefile
>  create mode 100644 utest/eval-test.h
>  create mode 100644 utest/eval-utest.c
>  create mode 100644 utest/traceeval-utest.c
>