From: Punit Agrawal <punitagrawal@gmail.com>
To: jkacur@redhat.com
Cc: linux-rt-users@vger.kernel.org, punit1.agrawal@toshiba.co.jp
Subject: Re: [PATCH v2 1/3] rteval: cyclictest.py Enable logging cyclictest output
Date: Tue, 09 Nov 2021 16:00:43 +0900 [thread overview]
Message-ID: <871r3pak4k.fsf@stealth> (raw)
In-Reply-To: <87a6idak7b.fsf@stealth> (Punit Agrawal's message of "Tue, 09 Nov 2021 15:59:04 +0900")
Punit Agrawal <punitagrawal@gmail.com> writes:
> 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.
*Argh* - this is an older version. Please ignore.
I'll highlight the correct version in a separate message.
next prev parent reply other threads:[~2021-11-09 7:00 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-17 8:53 [PATCH v2 0/3] rteval: Fix issues with cyclictest.py module Punit Agrawal
2021-09-17 8:53 ` [PATCH v2 1/3] rteval: cyclictest.py Enable logging cyclictest output Punit Agrawal
2021-11-09 6:59 ` Punit Agrawal
2021-11-09 7:00 ` Punit Agrawal [this message]
2021-09-17 8:53 ` [PATCH v2 2/3] rteval: cyclictest.py Parse max latencies from " Punit Agrawal
2021-09-17 8:53 ` [PATCH v2 3/3] rteval: cyclictest.py: Sort the list of cpus Punit Agrawal
2021-09-28 1:36 ` [PATCH v2 0/3] rteval: Fix issues with cyclictest.py module Punit Agrawal
2021-09-28 1:47 ` John Kacur
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=871r3pak4k.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox