mbox series

[v3,0/5] coresight: syscfg: Extend configfs for config load

Message ID 20220414064457.12052-1-mike.leach@linaro.org (mailing list archive)
Headers show
Series coresight: syscfg: Extend configfs for config load | expand

Message

Mike Leach April 14, 2022, 6:44 a.m. UTC
This set extends the configfs support to allow loading and unloading of
configurations as binary files via configfs.

Additional attributes - load and unload are provided to in the
configurations group to implement the load functionality.

Routines to generate binary configuration files are supplied in
./tools/coresight.

Example generator and reader applications are provided.

Tools may be cross compiled or built for use on host system.

Documentation is updated to describe feature usage.

Changes since v2:
1) Rebased & tested oo coresight/next - 5.18-rc2
2) Moved coresight config generator and reader programs from samples to
tools/coresight. Docs updated to match. (suggested by Mathieu)
3) userspace builds now use userspace headers from tools/...
4) Other minor fixes from Mathieu's review.

Changes since v1:
1) Rebased to coresight/next - 5.16-rc1 with previous coresight config
set applied.
2) Makefile.host fixed to default to all target.

Mike Leach (5):
  coresight: configfs: Add in functionality for load via configfs
  coresight: configfs: Add in binary attributes to load files
  coresight: configfs: Modify config files to allow userspace use
  coresight: tools: Add config file write and reader tools
  Documentation: coresight: docs for config load via configfs

 .../trace/coresight/coresight-config.rst      | 166 +++++-
 MAINTAINERS                                   |   2 +
 drivers/hwtracing/coresight/Makefile          |   2 +-
 .../coresight/coresight-config-file.c         | 475 ++++++++++++++++++
 .../coresight/coresight-config-file.h         | 126 +++++
 .../hwtracing/coresight/coresight-config.h    |  27 +
 .../coresight/coresight-syscfg-configfs.c     |  91 ++++
 .../hwtracing/coresight/coresight-syscfg.c    |  37 ++
 .../hwtracing/coresight/coresight-syscfg.h    |   2 +
 tools/coresight/Makefile                      |  51 ++
 tools/coresight/coresight-cfg-bufw.c          | 303 +++++++++++
 tools/coresight/coresight-cfg-bufw.h          |  26 +
 tools/coresight/coresight-cfg-example1.c      |  65 +++
 tools/coresight/coresight-cfg-examples.h      |  27 +
 tools/coresight/coresight-cfg-file-read.c     | 197 ++++++++
 tools/coresight/coresight-cfg-filegen.c       |  58 +++
 tools/include/uapi/coresight-config-uapi.h    |  76 +++
 17 files changed, 1724 insertions(+), 7 deletions(-)
 create mode 100644 drivers/hwtracing/coresight/coresight-config-file.c
 create mode 100644 drivers/hwtracing/coresight/coresight-config-file.h
 create mode 100644 tools/coresight/Makefile
 create mode 100644 tools/coresight/coresight-cfg-bufw.c
 create mode 100644 tools/coresight/coresight-cfg-bufw.h
 create mode 100644 tools/coresight/coresight-cfg-example1.c
 create mode 100644 tools/coresight/coresight-cfg-examples.h
 create mode 100644 tools/coresight/coresight-cfg-file-read.c
 create mode 100644 tools/coresight/coresight-cfg-filegen.c
 create mode 100644 tools/include/uapi/coresight-config-uapi.h

Comments

Mathieu Poirier May 10, 2022, 3:39 p.m. UTC | #1
On Thu, Apr 14, 2022 at 07:44:52AM +0100, Mike Leach wrote:
> This set extends the configfs support to allow loading and unloading of
> configurations as binary files via configfs.
> 
> Additional attributes - load and unload are provided to in the
> configurations group to implement the load functionality.
> 
> Routines to generate binary configuration files are supplied in
> ./tools/coresight.
> 
> Example generator and reader applications are provided.
> 
> Tools may be cross compiled or built for use on host system.
> 
> Documentation is updated to describe feature usage.
> 
> Changes since v2:
> 1) Rebased & tested oo coresight/next - 5.18-rc2
> 2) Moved coresight config generator and reader programs from samples to
> tools/coresight. Docs updated to match. (suggested by Mathieu)
> 3) userspace builds now use userspace headers from tools/...
> 4) Other minor fixes from Mathieu's review.
> 
> Changes since v1:
> 1) Rebased to coresight/next - 5.16-rc1 with previous coresight config
> set applied.
> 2) Makefile.host fixed to default to all target.
> 
> Mike Leach (5):
>   coresight: configfs: Add in functionality for load via configfs
>   coresight: configfs: Add in binary attributes to load files
>   coresight: configfs: Modify config files to allow userspace use
>   coresight: tools: Add config file write and reader tools
>   Documentation: coresight: docs for config load via configfs

I have started reviewing this set.  Comments will be spread out over several
days.  I will advise when I am done.

Thanks,
Mathieu

> 
>  .../trace/coresight/coresight-config.rst      | 166 +++++-
>  MAINTAINERS                                   |   2 +
>  drivers/hwtracing/coresight/Makefile          |   2 +-
>  .../coresight/coresight-config-file.c         | 475 ++++++++++++++++++
>  .../coresight/coresight-config-file.h         | 126 +++++
>  .../hwtracing/coresight/coresight-config.h    |  27 +
>  .../coresight/coresight-syscfg-configfs.c     |  91 ++++
>  .../hwtracing/coresight/coresight-syscfg.c    |  37 ++
>  .../hwtracing/coresight/coresight-syscfg.h    |   2 +
>  tools/coresight/Makefile                      |  51 ++
>  tools/coresight/coresight-cfg-bufw.c          | 303 +++++++++++
>  tools/coresight/coresight-cfg-bufw.h          |  26 +
>  tools/coresight/coresight-cfg-example1.c      |  65 +++
>  tools/coresight/coresight-cfg-examples.h      |  27 +
>  tools/coresight/coresight-cfg-file-read.c     | 197 ++++++++
>  tools/coresight/coresight-cfg-filegen.c       |  58 +++
>  tools/include/uapi/coresight-config-uapi.h    |  76 +++
>  17 files changed, 1724 insertions(+), 7 deletions(-)
>  create mode 100644 drivers/hwtracing/coresight/coresight-config-file.c
>  create mode 100644 drivers/hwtracing/coresight/coresight-config-file.h
>  create mode 100644 tools/coresight/Makefile
>  create mode 100644 tools/coresight/coresight-cfg-bufw.c
>  create mode 100644 tools/coresight/coresight-cfg-bufw.h
>  create mode 100644 tools/coresight/coresight-cfg-example1.c
>  create mode 100644 tools/coresight/coresight-cfg-examples.h
>  create mode 100644 tools/coresight/coresight-cfg-file-read.c
>  create mode 100644 tools/coresight/coresight-cfg-filegen.c
>  create mode 100644 tools/include/uapi/coresight-config-uapi.h
> 
> -- 
> 2.17.1
>
Mathieu Poirier May 27, 2022, 4:32 p.m. UTC | #2
On Thu, Apr 14, 2022 at 07:44:52AM +0100, Mike Leach wrote:
> This set extends the configfs support to allow loading and unloading of
> configurations as binary files via configfs.
> 
> Additional attributes - load and unload are provided to in the
> configurations group to implement the load functionality.
> 
> Routines to generate binary configuration files are supplied in
> ./tools/coresight.
> 
> Example generator and reader applications are provided.
> 
> Tools may be cross compiled or built for use on host system.
> 
> Documentation is updated to describe feature usage.

I think this patchset is looking quite good now.  The main issue for now is to
know if we want to keep the capability to read and print configurations.  To me
it doesn't provide much for the quirks it adds, i.e patch 3.

James and/or Leo will also have to do a review.  As such they should be added,
along with Arnaldo, to the next revision.

I am done reviewing this set.

Thanks,
Mathieu

> 
> Changes since v2:
> 1) Rebased & tested oo coresight/next - 5.18-rc2
> 2) Moved coresight config generator and reader programs from samples to
> tools/coresight. Docs updated to match. (suggested by Mathieu)
> 3) userspace builds now use userspace headers from tools/...
> 4) Other minor fixes from Mathieu's review.
> 
> Changes since v1:
> 1) Rebased to coresight/next - 5.16-rc1 with previous coresight config
> set applied.
> 2) Makefile.host fixed to default to all target.
> 
> Mike Leach (5):
>   coresight: configfs: Add in functionality for load via configfs
>   coresight: configfs: Add in binary attributes to load files
>   coresight: configfs: Modify config files to allow userspace use
>   coresight: tools: Add config file write and reader tools
>   Documentation: coresight: docs for config load via configfs
> 
>  .../trace/coresight/coresight-config.rst      | 166 +++++-
>  MAINTAINERS                                   |   2 +
>  drivers/hwtracing/coresight/Makefile          |   2 +-
>  .../coresight/coresight-config-file.c         | 475 ++++++++++++++++++
>  .../coresight/coresight-config-file.h         | 126 +++++
>  .../hwtracing/coresight/coresight-config.h    |  27 +
>  .../coresight/coresight-syscfg-configfs.c     |  91 ++++
>  .../hwtracing/coresight/coresight-syscfg.c    |  37 ++
>  .../hwtracing/coresight/coresight-syscfg.h    |   2 +
>  tools/coresight/Makefile                      |  51 ++
>  tools/coresight/coresight-cfg-bufw.c          | 303 +++++++++++
>  tools/coresight/coresight-cfg-bufw.h          |  26 +
>  tools/coresight/coresight-cfg-example1.c      |  65 +++
>  tools/coresight/coresight-cfg-examples.h      |  27 +
>  tools/coresight/coresight-cfg-file-read.c     | 197 ++++++++
>  tools/coresight/coresight-cfg-filegen.c       |  58 +++
>  tools/include/uapi/coresight-config-uapi.h    |  76 +++
>  17 files changed, 1724 insertions(+), 7 deletions(-)
>  create mode 100644 drivers/hwtracing/coresight/coresight-config-file.c
>  create mode 100644 drivers/hwtracing/coresight/coresight-config-file.h
>  create mode 100644 tools/coresight/Makefile
>  create mode 100644 tools/coresight/coresight-cfg-bufw.c
>  create mode 100644 tools/coresight/coresight-cfg-bufw.h
>  create mode 100644 tools/coresight/coresight-cfg-example1.c
>  create mode 100644 tools/coresight/coresight-cfg-examples.h
>  create mode 100644 tools/coresight/coresight-cfg-file-read.c
>  create mode 100644 tools/coresight/coresight-cfg-filegen.c
>  create mode 100644 tools/include/uapi/coresight-config-uapi.h
> 
> -- 
> 2.17.1
>
Mike Leach June 1, 2022, 8:30 a.m. UTC | #3
HI Mathieu,

On Fri, 27 May 2022 at 17:32, Mathieu Poirier
<mathieu.poirier@linaro.org> wrote:
>
> On Thu, Apr 14, 2022 at 07:44:52AM +0100, Mike Leach wrote:
> > This set extends the configfs support to allow loading and unloading of
> > configurations as binary files via configfs.
> >
> > Additional attributes - load and unload are provided to in the
> > configurations group to implement the load functionality.
> >
> > Routines to generate binary configuration files are supplied in
> > ./tools/coresight.
> >
> > Example generator and reader applications are provided.
> >
> > Tools may be cross compiled or built for use on host system.
> >
> > Documentation is updated to describe feature usage.
>
> I think this patchset is looking quite good now.  The main issue for now is to
> know if we want to keep the capability to read and print configurations.  To me
> it doesn't provide much for the quirks it adds, i.e patch 3.
>

Given that the binary configuration files are very portable, I think
the reader is essential.
It is possible to install / use ETM4 configuration files on kernels /
systems separate from which they were built for (unlike configurations
in loadable modules which are bound to a kernel build).

It may be that a user of a file does not have the original source for
that file - which is fine as long as it can be passed through the
reader and evaluated by the user to assess suitability for the current
target.

> James and/or Leo will also have to do a review.  As such they should be added,
> along with Arnaldo, to the next revision.

OK

Thanks

Mike


>
> I am done reviewing this set.
>
> Thanks,
> Mathieu
>
> >
> > Changes since v2:
> > 1) Rebased & tested oo coresight/next - 5.18-rc2
> > 2) Moved coresight config generator and reader programs from samples to
> > tools/coresight. Docs updated to match. (suggested by Mathieu)
> > 3) userspace builds now use userspace headers from tools/...
> > 4) Other minor fixes from Mathieu's review.
> >
> > Changes since v1:
> > 1) Rebased to coresight/next - 5.16-rc1 with previous coresight config
> > set applied.
> > 2) Makefile.host fixed to default to all target.
> >
> > Mike Leach (5):
> >   coresight: configfs: Add in functionality for load via configfs
> >   coresight: configfs: Add in binary attributes to load files
> >   coresight: configfs: Modify config files to allow userspace use
> >   coresight: tools: Add config file write and reader tools
> >   Documentation: coresight: docs for config load via configfs
> >
> >  .../trace/coresight/coresight-config.rst      | 166 +++++-
> >  MAINTAINERS                                   |   2 +
> >  drivers/hwtracing/coresight/Makefile          |   2 +-
> >  .../coresight/coresight-config-file.c         | 475 ++++++++++++++++++
> >  .../coresight/coresight-config-file.h         | 126 +++++
> >  .../hwtracing/coresight/coresight-config.h    |  27 +
> >  .../coresight/coresight-syscfg-configfs.c     |  91 ++++
> >  .../hwtracing/coresight/coresight-syscfg.c    |  37 ++
> >  .../hwtracing/coresight/coresight-syscfg.h    |   2 +
> >  tools/coresight/Makefile                      |  51 ++
> >  tools/coresight/coresight-cfg-bufw.c          | 303 +++++++++++
> >  tools/coresight/coresight-cfg-bufw.h          |  26 +
> >  tools/coresight/coresight-cfg-example1.c      |  65 +++
> >  tools/coresight/coresight-cfg-examples.h      |  27 +
> >  tools/coresight/coresight-cfg-file-read.c     | 197 ++++++++
> >  tools/coresight/coresight-cfg-filegen.c       |  58 +++
> >  tools/include/uapi/coresight-config-uapi.h    |  76 +++
> >  17 files changed, 1724 insertions(+), 7 deletions(-)
> >  create mode 100644 drivers/hwtracing/coresight/coresight-config-file.c
> >  create mode 100644 drivers/hwtracing/coresight/coresight-config-file.h
> >  create mode 100644 tools/coresight/Makefile
> >  create mode 100644 tools/coresight/coresight-cfg-bufw.c
> >  create mode 100644 tools/coresight/coresight-cfg-bufw.h
> >  create mode 100644 tools/coresight/coresight-cfg-example1.c
> >  create mode 100644 tools/coresight/coresight-cfg-examples.h
> >  create mode 100644 tools/coresight/coresight-cfg-file-read.c
> >  create mode 100644 tools/coresight/coresight-cfg-filegen.c
> >  create mode 100644 tools/include/uapi/coresight-config-uapi.h
> >
> > --
> > 2.17.1
> >



--
Mike Leach
Principal Engineer, ARM Ltd.
Manchester Design Centre. UK