[RFC,0/2] v4l2 stateless tracer/retracer utilities

Message ID cover.1660955263.git.deborah.brouwer@collabora.com (mailing list archive)
Headers
Series v4l2 stateless tracer/retracer utilities |

Message

Deborah Brouwer Aug. 20, 2022, 12:50 a.m. UTC
  This project helps to test v4l2 stateless decoder drivers by tracing,
recording and replaying (i.e. "retracing") userspace's interaction with
a stateless decoder driver.

The tracer utility attaches to a userspace application and generates a
json file with relevant system calls, parameters and encoded data.

The retracer utility reads the json-file and makes the same system calls
to a v4l2 stateless driver. Since the retracer is independent from the
original userspace application that was traced, testing can be decoupled
from extraneous factors in the userspace environment. The json-file can
also be edited to inject errors and test a driver's error-handling
abilities.

NOTE:
This project is work in progress and currently only traces VP8, but
H264 and FWHT will follow shortly.

EXAMPLE:
./tracer gst-launch-1.0 -- filesrc location=<some_vp8_file> ! parsebin !
v4l2slvp8dec ! videocodectestsink

./retracer 10284_trace.json

FURTHER INFO AND TEST FILES:
https://gitlab.collabora.com/dbrouwer/v4l2-stateless-tracer-utility/-/tree/main/

Deborah Brouwer (2):
  utils: add stateless tracer utility
  utils: add stateless retracer utility

 configure.ac                    |    6 +
 utils/Makefile.am               |    5 +
 utils/common/v4l2-info.cpp      |    7 +-
 utils/common/v4l2-info.h        |    8 +
 utils/tracer/.gitignore         |    9 +
 utils/tracer/Makefile.am        |   23 +
 utils/tracer/libtracer.cpp      |  217 ++++++
 utils/tracer/libtracer.h        |   92 +++
 utils/tracer/retrace-helper.cpp |  141 ++++
 utils/tracer/retrace-helper.h   |   18 +
 utils/tracer/retrace-vp8.cpp    |  288 ++++++++
 utils/tracer/retrace-vp8.h      |   11 +
 utils/tracer/retracer.cpp       | 1090 +++++++++++++++++++++++++++++++
 utils/tracer/retracer.h         |   24 +
 utils/tracer/trace-helper.cpp   |  218 +++++++
 utils/tracer/trace-info.cpp     |  358 ++++++++++
 utils/tracer/trace-info.h       |   72 ++
 utils/tracer/trace-vp8.cpp      |  183 ++++++
 utils/tracer/trace.cpp          |  520 +++++++++++++++
 utils/tracer/tracer.cpp         |   91 +++
 20 files changed, 3375 insertions(+), 6 deletions(-)
 create mode 100644 utils/tracer/.gitignore
 create mode 100644 utils/tracer/Makefile.am
 create mode 100644 utils/tracer/libtracer.cpp
 create mode 100644 utils/tracer/libtracer.h
 create mode 100755 utils/tracer/retrace-helper.cpp
 create mode 100644 utils/tracer/retrace-helper.h
 create mode 100755 utils/tracer/retrace-vp8.cpp
 create mode 100644 utils/tracer/retrace-vp8.h
 create mode 100755 utils/tracer/retracer.cpp
 create mode 100644 utils/tracer/retracer.h
 create mode 100644 utils/tracer/trace-helper.cpp
 create mode 100644 utils/tracer/trace-info.cpp
 create mode 100644 utils/tracer/trace-info.h
 create mode 100644 utils/tracer/trace-vp8.cpp
 create mode 100644 utils/tracer/trace.cpp
 create mode 100644 utils/tracer/tracer.cpp
  

Comments

Nicolas Dufresne Aug. 26, 2022, 7:05 p.m. UTC | #1
Hi Deborah,

very nice work, I'm very exciting to see such a tool coming to life.

Le vendredi 19 août 2022 à 17:50 -0700, Deborah Brouwer a écrit :
> This project helps to test v4l2 stateless decoder drivers by tracing,
> recording and replaying (i.e. "retracing") userspace's interaction with
> a stateless decoder driver.
> 
> The tracer utility attaches to a userspace application and generates a
> json file with relevant system calls, parameters and encoded data.
> 
> The retracer utility reads the json-file and makes the same system calls
> to a v4l2 stateless driver. Since the retracer is independent from the
> original userspace application that was traced, testing can be decoupled
> from extraneous factors in the userspace environment. The json-file can
> also be edited to inject errors and test a driver's error-handling
> abilities.
> 
> NOTE:
> This project is work in progress and currently only traces VP8, but
> H264 and FWHT will follow shortly.
> 
> EXAMPLE:
> ./tracer gst-launch-1.0 -- filesrc location=<some_vp8_file> ! parsebin !
> v4l2slvp8dec ! videocodectestsink
> 
> ./retracer 10284_trace.json

My first comment would be to polish a bit the user interface, and make the
installation of the tool a bit more friendly to Linux distribution. I would like
suggest to have a single executable, and to name it with a proper name space.
Something like:

v4l2-tracer trace -- gst-launch-1.0 filesrc location=<some_vp8_file> ...
v4l2-tracer retrace 10284_trace.json

We can refine this interface over time, but at least this gives a single command
to remember, and will be more friendly when installing this onto your system.

regards,
Nicolas

> 
> FURTHER INFO AND TEST FILES:
> https://gitlab.collabora.com/dbrouwer/v4l2-stateless-tracer-utility/-/tree/main/
> 
> Deborah Brouwer (2):
>   utils: add stateless tracer utility
>   utils: add stateless retracer utility
> 
>  configure.ac                    |    6 +
>  utils/Makefile.am               |    5 +
>  utils/common/v4l2-info.cpp      |    7 +-
>  utils/common/v4l2-info.h        |    8 +
>  utils/tracer/.gitignore         |    9 +
>  utils/tracer/Makefile.am        |   23 +
>  utils/tracer/libtracer.cpp      |  217 ++++++
>  utils/tracer/libtracer.h        |   92 +++
>  utils/tracer/retrace-helper.cpp |  141 ++++
>  utils/tracer/retrace-helper.h   |   18 +
>  utils/tracer/retrace-vp8.cpp    |  288 ++++++++
>  utils/tracer/retrace-vp8.h      |   11 +
>  utils/tracer/retracer.cpp       | 1090 +++++++++++++++++++++++++++++++
>  utils/tracer/retracer.h         |   24 +
>  utils/tracer/trace-helper.cpp   |  218 +++++++
>  utils/tracer/trace-info.cpp     |  358 ++++++++++
>  utils/tracer/trace-info.h       |   72 ++
>  utils/tracer/trace-vp8.cpp      |  183 ++++++
>  utils/tracer/trace.cpp          |  520 +++++++++++++++
>  utils/tracer/tracer.cpp         |   91 +++
>  20 files changed, 3375 insertions(+), 6 deletions(-)
>  create mode 100644 utils/tracer/.gitignore
>  create mode 100644 utils/tracer/Makefile.am
>  create mode 100644 utils/tracer/libtracer.cpp
>  create mode 100644 utils/tracer/libtracer.h
>  create mode 100755 utils/tracer/retrace-helper.cpp
>  create mode 100644 utils/tracer/retrace-helper.h
>  create mode 100755 utils/tracer/retrace-vp8.cpp
>  create mode 100644 utils/tracer/retrace-vp8.h
>  create mode 100755 utils/tracer/retracer.cpp
>  create mode 100644 utils/tracer/retracer.h
>  create mode 100644 utils/tracer/trace-helper.cpp
>  create mode 100644 utils/tracer/trace-info.cpp
>  create mode 100644 utils/tracer/trace-info.h
>  create mode 100644 utils/tracer/trace-vp8.cpp
>  create mode 100644 utils/tracer/trace.cpp
>  create mode 100644 utils/tracer/tracer.cpp
>