linux-trace-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/10] libtraceevent: Makefile updates fixes and unit tests
@ 2021-12-16 21:39 Steven Rostedt
  2021-12-16 21:39 ` [PATCH 01/10] libtraceevent: Fix installing of man pages in remote directory Steven Rostedt
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: Steven Rostedt @ 2021-12-16 21:39 UTC (permalink / raw)
  To: linux-trace-devel; +Cc: Steven Rostedt

The libtraceevent Makefiles are a result of its several foster homes.
It started at trace-cmd and then went into the kernel, and now lives in
its own repository. The Makefiles were brought over from the previous
homes and modified and tweaked to get them to work. This added a bunch
of unnecessary logic that is not needed for just this library.

The Makefiles were rewritten to be more consistent with libtracefs and
with trace-cmd, which greatly simplified them.

A unit test was added to start testing event parsing and reading to lay
the ground work for more unit tests that will help keep libtraceevent
from having more regressions (like one that slipped in).

The processing of the old dynamic string format (which had just he
offset where the length of the string was simply determined by the size
of the string at the offset) stopped working. It actually worked by
shear luck, but changes to add the rel_loc parsing took away all that
luck. It had to be refactored to be more specific in knowing that the
format is of the old size.

Deprecate tep_print_field() as it does not give the user to pass the in
the size of the data to parse, and since it could be from untrusted
sources, that would make it a security issue.

Add tep_print_field_content() that requires a size also passed in.

Use the size more to verify that only the data gets looked at and does
not rely on the data to stay within bounds.

*** NOTE *** there needs to be an audit of all the code to add checks to
make sure all access are within the data. Even though the size is now
passed in, there are many cases where what is parsed is going to be
within those limits.


Steven Rostedt (VMware) (10):
  libtraceevent: Fix installing of man pages in remote directory
  libtraceevent: Rewrite Makefiles to be like libtracefs
  libtraceevent: Have make tags and TAGS honor O= build directory
  libtraceevent: Move installed headers into their own directory
  libtraceevent: Add unit test framework for library commands
  libtraceveent: Add testing of old dynamic string event layout
  libraceevent: Add unit test to test print_fmt with dynamic strings
  libtraceevent: Account for old dynamic string formats and honor size
  libtraceevent: Replace tep_print_field() with
    tep_print_field_content()
  libtraceevent: Have print_field_raw() handle old data layout

 Documentation/Makefile                      |  16 +-
 Documentation/libtraceevent-field_print.txt |  10 +-
 Documentation/libtraceevent.txt             |   2 +-
 Makefile                                    | 215 +++++++++++---------
 build/Build.include                         | 103 ----------
 build/Makefile.build                        | 162 ---------------
 {src => include/traceevent}/event-parse.h   |   8 +-
 {src => include/traceevent}/event-utils.h   |   0
 {src => include/traceevent}/kbuffer.h       |   0
 {src => include/traceevent}/trace-seq.h     |   0
 plugins/Makefile                            |  63 ++----
 scripts/Makefile.include                    | 135 ------------
 scripts/features.mk                         |  37 ++++
 scripts/utils.mk                            | 174 ++++++++++++++++
 src/Makefile                                |  51 ++++-
 src/event-parse.c                           |  96 ++++++---
 utest/Makefile                              |  38 ++++
 utest/README                                |  17 ++
 utest/trace-utest.c                         |  86 ++++++++
 utest/trace-utest.h                         |  14 ++
 utest/traceevent-utest.c                    | 172 ++++++++++++++++
 21 files changed, 807 insertions(+), 592 deletions(-)
 delete mode 100644 build/Build.include
 delete mode 100644 build/Makefile.build
 rename {src => include/traceevent}/event-parse.h (99%)
 rename {src => include/traceevent}/event-utils.h (100%)
 rename {src => include/traceevent}/kbuffer.h (100%)
 rename {src => include/traceevent}/trace-seq.h (100%)
 delete mode 100644 scripts/Makefile.include
 create mode 100644 scripts/features.mk
 create mode 100644 scripts/utils.mk
 create mode 100644 utest/Makefile
 create mode 100644 utest/README
 create mode 100644 utest/trace-utest.c
 create mode 100644 utest/trace-utest.h
 create mode 100644 utest/traceevent-utest.c

-- 
2.33.0


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

end of thread, other threads:[~2021-12-16 21:40 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-12-16 21:39 [PATCH 00/10] libtraceevent: Makefile updates fixes and unit tests Steven Rostedt
2021-12-16 21:39 ` [PATCH 01/10] libtraceevent: Fix installing of man pages in remote directory Steven Rostedt
2021-12-16 21:39 ` [PATCH 02/10] libtraceevent: Rewrite Makefiles to be like libtracefs Steven Rostedt
2021-12-16 21:39 ` [PATCH 03/10] libtraceevent: Have make tags and TAGS honor O= build directory Steven Rostedt
2021-12-16 21:39 ` [PATCH 04/10] libtraceevent: Move installed headers into their own directory Steven Rostedt
2021-12-16 21:39 ` [PATCH 05/10] libtraceevent: Add unit test framework for library commands Steven Rostedt
2021-12-16 21:39 ` [PATCH 06/10] libtraceveent: Add testing of old dynamic string event layout Steven Rostedt
2021-12-16 21:39 ` [PATCH 07/10] libraceevent: Add unit test to test print_fmt with dynamic strings Steven Rostedt
2021-12-16 21:39 ` [PATCH 08/10] libtraceevent: Account for old dynamic string formats and honor size Steven Rostedt
2021-12-16 21:39 ` [PATCH 09/10] libtraceevent: Replace tep_print_field() with tep_print_field_content() Steven Rostedt
2021-12-16 21:39 ` [PATCH 10/10] libtraceevent: Have print_field_raw() handle old data layout Steven Rostedt

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).