From: Punit Agrawal <punitagrawal@gmail.com>
To: jkacur@redhat.com
Cc: linux-rt-users@vger.kernel.org,
Punit Agrawal <punit1.agrawal@toshiba.co.jp>
Subject: Re: [PATCH v3 1/4] rteval: cyclictest.py Enable logging cyclictest output
Date: Tue, 09 Nov 2021 16:02:20 +0900 [thread overview]
Message-ID: <87v91195hf.fsf@stealth> (raw)
In-Reply-To: <20211018055736.412576-2-punitagrawal@gmail.com> (Punit Agrawal's message of "Mon, 18 Oct 2021 14:57:33 +0900")
Punit Agrawal <punitagrawal@gmail.com> writes:
> From: Punit Agrawal <punit1.agrawal@toshiba.co.jp>
>
> The cyclictest.py module uses a temporary file to store the output
> from "cyclictest" which is deleted at the end of the run. As the
> collected log contains information that can be useful for development
> or debugging, having the ability to persist the logs is useful.
>
> With this goal, introduce a configuration option for the cyclictest.py
> module, "savelogs", that can be used to enable persisting the
> cyclictest output to a logfile. As the logs an be quite large, the
> default is to not save them.
>
> Signed-off-by: Punit Agrawal <punit1.agrawal@toshiba.co.jp>
> ---
> rteval/modules/measurement/cyclictest.py | 9 ++++++++-
> 1 file changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/rteval/modules/measurement/cyclictest.py b/rteval/modules/measurement/cyclictest.py
> index b1755d4f4421..ee1de883d844 100644
> --- a/rteval/modules/measurement/cyclictest.py
> +++ b/rteval/modules/measurement/cyclictest.py
> @@ -197,6 +197,8 @@ class Cyclictest(rtevalModulePrototype):
> self.__numanodes = int(self.__cfg.setdefault('numanodes', 0))
> self.__priority = int(self.__cfg.setdefault('priority', 95))
> self.__buckets = int(self.__cfg.setdefault('buckets', 2000))
> + self.__reportdir = self.__cfg.setdefault('reportdir', os.getcwd())
> + self.__save_logs = self.__cfg.setdefault('savelogs', False)
> self.__numcores = 0
> self.__cpus = []
> self.__cyclicdata = {}
> @@ -255,6 +257,8 @@ class Cyclictest(rtevalModulePrototype):
> mounts.close()
> return ret
>
> + def _open_logfile(self, name):
> + return open(os.path.join(self.__reportdir, "logs", name), 'w+b')
>
> def _WorkloadSetup(self):
> self.__cyclicprocess = None
> @@ -288,7 +292,10 @@ class Cyclictest(rtevalModulePrototype):
> self.__cmd.append("--tracemark")
>
> # Buffer for cyclictest data written to stdout
> - self.__cyclicoutput = tempfile.SpooledTemporaryFile(mode='w+b')
> + if self.__save_logs:
> + self.__cyclicoutput = self._open_logfile('cyclictest.stdout')
> + else:
> + self.__cyclicoutput = tempfile.SpooledTemporaryFile(mode='w+b')
>
>
> def _WorkloadTask(self):
Ping!
This patch was missed when reviewing / merging the other patches in the
series. Please consider merging if there are no issues.
Thanks.
(and apologies for the extra messages)
next prev parent reply other threads:[~2021-11-09 7:02 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-18 5:57 [PATCH v3 0/4] rteval: Fix issues with cyclictest module Punit Agrawal
2021-10-18 5:57 ` [PATCH v3 1/4] rteval: cyclictest.py Enable logging cyclictest output Punit Agrawal
2021-11-09 7:02 ` Punit Agrawal [this message]
2021-10-18 5:57 ` [PATCH v3 2/4] rteval: cyclictest.py Parse max latencies from " Punit Agrawal
2021-10-27 23:28 ` John Kacur
2021-10-18 5:57 ` [PATCH v3 3/4] rteval: cyclictest.py: Sort the list of cpus Punit Agrawal
2021-10-27 23:28 ` John Kacur
2021-10-18 5:57 ` [PATCH v3 4/4] rteval: cyclictest.py: Skip statistics reporting in case of an overflow Punit Agrawal
2021-10-27 23:29 ` John Kacur
2021-11-01 7:40 ` Punit Agrawal
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87v91195hf.fsf@stealth \
--to=punitagrawal@gmail.com \
--cc=jkacur@redhat.com \
--cc=linux-rt-users@vger.kernel.org \
--cc=punit1.agrawal@toshiba.co.jp \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.