diff --git a/doc/lisa_shell/man/man.rst b/doc/lisa_shell/man/man.rst index d245c54ddcba31f7dfc9d15601b776e94ac4b36e..70a67e6600ca3730e63e701a040d946aa455788e 100644 --- a/doc/lisa_shell/man/man.rst +++ b/doc/lisa_shell/man/man.rst @@ -105,6 +105,7 @@ Buildroot commands Misc commands ------------- +* ``lisa-load-kmod`` - Build and load the LISA kernel module on a running target. * ``lisa-plot`` - Generate various plots from a ``trace.dat`` file. See ``lisa-plot -h`` for available plots. * ``lisa-platinfo-extract`` - Extract a platform information file diff --git a/doc/man1/bisector.1 b/doc/man1/bisector.1 index 95d59bfc931b05e4e7856cba219863c85a7d24db..92a1fedb95e662072613b71810f01bb6d29f6530 100644 --- a/doc/man1/bisector.1 +++ b/doc/man1/bisector.1 @@ -87,7 +87,7 @@ usage: bisector [\-h] [\-\-cli\-options CLI_OPTIONS] iterations to the report. The execution can later be resumed with \-\-resume. -optional arguments: +options: \-h, \-\-help show this help message and exit \-\-cli\-options CLI_OPTIONS YAML file containing command line option string in a @@ -119,7 +119,7 @@ Run the given steps in a loop and record the result in a report file. The report file can be inspected using the \(dqreport\(dq subcommand. The exit status is suitable for git bisect. -optional arguments: +options: \-h, \-\-help show this help message and exit \-\-cli\-options CLI_OPTIONS YAML file containing command line option string in a @@ -217,7 +217,7 @@ positional arguments: report Read back a previous session saved using \-\-report option of run subcommand. -optional arguments: +options: \-h, \-\-help show this help message and exit \-\-cli\-options CLI_OPTIONS YAML file containing command line option string in a @@ -800,7 +800,7 @@ positional arguments: PID Slave PID to act on or \(dqall\(dq. Start a monitor\-server before using \(dqall\(dq. -optional arguments: +options: \-h, \-\-help show this help message and exit \-\-cli\-options CLI_OPTIONS YAML file containing command line option string in a @@ -839,7 +839,7 @@ usage: bisector monitor\-server [\-h] [\-\-cli\-options CLI_OPTIONS] Start the DBus server to allow monitoring all running instances. Note that the server is not necessary to monitor a specific run instance. -optional arguments: +options: \-h, \-\-help show this help message and exit \-\-cli\-options CLI_OPTIONS YAML file containing command line option string in a @@ -869,7 +869,7 @@ Modify the properties of the steps in an existing report. positional arguments: report Report to edit. -optional arguments: +options: \-h, \-\-help show this help message and exit \-o OPTION, \-\-option OPTION Step\-specific options. Can be repeated. The format is diff --git a/doc/man1/exekall.1 b/doc/man1/exekall.1 index e02e1eef8f399786fb5bc54e85430713e089f1ce..be52fd0d1073f56bb6575281d8c8408acd54f14b 100644 --- a/doc/man1/exekall.1 +++ b/doc/man1/exekall.1 @@ -49,7 +49,7 @@ PATTERNS A pattern starting with \(dq!\(dq is used as a negative pattern. -optional arguments: +options: \-h, \-\-help show this help message and exit \-\-debug Show complete Python backtrace when exekall crashes. @@ -93,7 +93,7 @@ positional arguments: contained files recursively are selected. By default, the current directory is selected. -optional arguments: +options: \-h, \-\-help show this help message and exit \-\-dependency DEPENDENCY Same as specifying a module in PYTHON_MODULES but will only be used to @@ -200,7 +200,7 @@ arguments. positional arguments: db DBs created using exekall run to compare. -optional arguments: +options: \-h, \-\-help show this help message and exit .EE @@ -226,7 +226,7 @@ arguments. positional arguments: db DB created using exekall run to show. -optional arguments: +options: \-h, \-\-help show this help message and exit .EE @@ -250,7 +250,7 @@ positional arguments: artifact_dirs Artifact directories created using \(dqexekall run\(dq, or value databases to merge. -optional arguments: +options: \-h, \-\-help show this help message and exit \-o OUTPUT, \-\-output OUTPUT diff --git a/doc/man1/lisa.1 b/doc/man1/lisa.1 index 3e4b533b5df12257a9c07c78c8d3cd98d46158a8..47db233a3c5d2d26c1c4a8e8f9d2f068f9812682 100644 --- a/doc/man1/lisa.1 +++ b/doc/man1/lisa.1 @@ -158,6 +158,8 @@ buildroot initramfs into the kernel. .SS Misc commands .INDENT 0.0 .IP \(bu 2 +\fBlisa\-load\-kmod\fP \- Build and load the LISA kernel module on a running target. +.IP \(bu 2 \fBlisa\-plot\fP \- Generate various plots from a \fBtrace.dat\fP file. See \fBlisa\-plot \-h\fP for available plots. .IP \(bu 2 diff --git a/lisa/utils.py b/lisa/utils.py index ce34383e394e943ea303f999913c6d58a7dad47f..3ffd9cafaa42eaae45309eded5b13005e835be63 100644 --- a/lisa/utils.py +++ b/lisa/utils.py @@ -1033,12 +1033,15 @@ class Serializable( # really should be instance-related. class _YAML(YAML): @property - @memoized def constructor(self): + ctor = super().constructor # This will rightfully raise in case constructor() is called # from YAML.__init__(), so that we do not accidentally memoized - # an instance of the wrong type. - return _Constructor() + # an instance of the wrong type. Doing so would circumvent our + # attempt at making the configuration local to the YAML + # instance we create here. + assert isinstance(ctor, _Constructor) + return ctor # If the user requested an unsafe instance, we provide a safe instance # with a re-implementation of some unsafe bits. This is because @@ -3595,7 +3598,7 @@ def get_sphinx_role(obj, name=None): return role -def newtype(cls, name, doc=None, module=None): +def newtype(cls, name, doc=None, module=None, stacklevel=1): """ Make a new class inheriting from ``cls`` with the given ``name``. @@ -3622,6 +3625,11 @@ def newtype(cls, name, doc=None, module=None): class New(cls, metaclass=Meta): # pylint: disable=invalid-metaclass pass + # Set the __firstlineno__ attribute for Python 3.13 inspect.getsource(). + # Otherwise we get the line number of the "class New" definition, which is + # right here and not matching where the newtype is logically defined + stack = inspect.stack() + New.__firstlineno__ = stack[stacklevel].lineno New.__name__ = name.split('.')[-1] New.__qualname__ = name diff --git a/tools/lisa-doc-build b/tools/lisa-doc-build index ba795aa6717e97a448f061c514e8fd41181c66c4..81e57c99406cc3be1f7b3f643fdd1bf6327beb17 100755 --- a/tools/lisa-doc-build +++ b/tools/lisa-doc-build @@ -43,11 +43,6 @@ docs=( for doc in "${docs[@]}"; do sphinx-build "$LISA_HOME/$doc" "$LISA_HOME/doc/man1" -Enab man || ret=2 done -# In Python >= 3.10, argparse's --help uses "options:" group instead of -# "optional arguments:", so we convert it back to the old form so that git diff -# will not find a difference if the doc is up to date, regardless of the version -# used to build the doc. -sed -i 's/^options:$/optional arguments:/' "$LISA_HOME"/doc/man1/*.1 echo "Man pages have been updated and the main documentation can be found under: $LISA_HOME/doc/_build/html/index.html" diff --git a/tools/tests.sh b/tools/tests.sh index 4a906e4efa15fe84696c2807c4eee9200b000628..20908e07abf6b705dfed4922adba42deea724a11 100755 --- a/tools/tests.sh +++ b/tools/tests.sh @@ -38,10 +38,16 @@ exekall run "$LISA_HOME/tools/exekall/src/exekall/_tests" echo "Starting documentation pedantic build ..." lisa-doc-build +MANPAGE_PYTHON_VERSION="3.11" + echo "Checking that the man pages are up to date ..." -if ! git diff --exit-code doc/man1/; then - echo "Please regenerate man pages in doc/man1 and commit them" - exit 1 +if python3 --version | grep -F "$MANPAGE_PYTHON_VERSION" ; then + if ! git diff --exit-code doc/man1/; then + echo "Please regenerate man pages in doc/man1 and commit them" + exit 1 + fi +else + echo "Skipped man page check as it only runs for $MANPAGE_PYTHON_VERSION" fi # FIXME: cbindgen does not work on our source anymore due to that issue: