[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 00/12] simpletrace: refactor and general improvements
|
From: |
John Snow |
|
Subject: |
Re: [PATCH v2 00/12] simpletrace: refactor and general improvements |
|
Date: |
Wed, 10 May 2023 15:14:23 -0400 |
On Mon, May 8, 2023 at 11:16 AM Stefan Hajnoczi <stefanha@redhat.com> wrote:
>
> On Mon, May 08, 2023 at 03:28:04PM +0200, Mads Ynddal wrote:
> >
> > > A question for you: do you think it's possible to move simpletrace into
> > > qemu/python/utils? This requires cleaning up the code to some fairly
> > > pedantic standards, but helps protect it against rot as we change target
> > > python versions.
> > >
> > > No problem if that's too much to ask. just want to know if you had looked
> > > into it.
> >
> > Potentially, this would be possible. But `simpletrace.py` imports
> > `qemu/scripts/tracetool/`, so that would have to be moved as well, or
> > installed
> > as a package. I haven't touched the `tracetool` code itself, so I'm not
> > sure how
> > feasible it is (i.e. how many other places use `tracetool`).
>
> tracetool is only used by QEMU's build system to generate code from the
> trace-events files. In theory it's possible to move it.
>
> I'm not sure I understand the purpose of moving it to python/. What
> infrastructure does python/ provide that's not available to
> simpletrace.py in its current location?
>
> Stefan
It's just directory-based:
python/qemu/ are formatted as packages, with python/qemu/util/ serving
as a package that houses a bag of scripts. You can install these
things as a package into a venv and use them anywhere.
code in python/ is checked with a linter, type checker, etc while code
in scripts/ is not. It isn't installed anywhere and you may or may not
have to carefully set up PYTHONPATH= or choose your CWD carefully to
get the imports correct.
Over time I want to move more python code over under python/ so it
gets checked with the robots. The best stuff to move is stuff with
imports and dependencies. Truly standalone scripts aren't as important
to move.
It's not important for today, so let's not worry about it for this series.
--js
- Re: [PATCH v2 06/12] simpletrace: Simplify construction of tracing methods, (continued)
- [PATCH v2 07/12] simpletrace: Improved error handling on struct unpack, Mads Ynddal, 2023/05/02
- [PATCH v2 08/12] simpletrace: define exception and add handling, Mads Ynddal, 2023/05/02
- [PATCH v2 09/12] simpletrace: Refactor to separate responsibilities, Mads Ynddal, 2023/05/02
- [PATCH v2 10/12] MAINTAINERS: add maintainer of simpletrace.py, Mads Ynddal, 2023/05/02
- [PATCH v2 11/12] scripts/analyse-locks-simpletrace.py: changed iteritems() to items(), Mads Ynddal, 2023/05/02
- [PATCH v2 12/12] scripts/analyse-locks-simpletrace.py: reflect changes to process in simpletrace.py, Mads Ynddal, 2023/05/02
- Re: [PATCH v2 00/12] simpletrace: refactor and general improvements, John Snow, 2023/05/03
- Re: [PATCH v2 00/12] simpletrace: refactor and general improvements, Stefan Hajnoczi, 2023/05/04