From: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
To: "Rafael J. Wysocki" <rafael@kernel.org>,
Doug Smythies <doug.smythies@gmail.com>
Cc: Doug Smythies <dsmythies@telus.net>,
"Rafael J. Wysocki" <rjw@rjwysocki.net>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Linux PM <linux-pm@vger.kernel.org>
Subject: Re: [PATCH] tools/power/x86/intel_pstate_tracer: Free the trace buffer memory
Date: Fri, 05 Jan 2018 15:46:52 -0800 [thread overview]
Message-ID: <1515196012.26317.52.camel@linux.intel.com> (raw)
In-Reply-To: <CAJZ5v0hvFrfRR8PEQgUgEh3r1NnH5r26fxzc=Kc+k9D8rDp+Lw@mail.gmail.com>
On Fri, 2018-01-05 at 23:54 +0100, Rafael J. Wysocki wrote:
> On Fri, Jan 5, 2018 at 11:31 PM, Doug Smythies <doug.smythies@gmail.c
> om> wrote:
> >
> > The trace buffer memory should be, mostly, freed after
> > the buffer has been output.
> >
> > This patch is required before a future patch that will allow
> > the user to override the default, and specify the trace buffer
> > memory allocation as a command line option.
> >
> > Signed-off-by: Doug Smythies <dsmythies@telus.net>
> Looks OK to me. Srinivas?
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
>
> >
> > ---
> > .../power/x86/intel_pstate_tracer/intel_pstate_tracer.py | 15
> > +++++++++++++++
> > 1 file changed, 15 insertions(+)
> >
> > diff --git
> > a/tools/power/x86/intel_pstate_tracer/intel_pstate_tracer.py
> > b/tools/power/x86/intel_pstate_tracer/intel_pstate_tracer.py
> > index 0b24dd9..29f50d4 100755
> > --- a/tools/power/x86/intel_pstate_tracer/intel_pstate_tracer.py
> > +++ b/tools/power/x86/intel_pstate_tracer/intel_pstate_tracer.py
> > @@ -411,6 +411,16 @@ def set_trace_buffer_size():
> > print('IO error setting trace buffer size ')
> > quit()
> >
> > +def free_trace_buffer():
> > + """ Free the trace buffer memory """
> > +
> > + try:
> > + open('/sys/kernel/debug/tracing/buffer_size_kb'
> > + , 'w').write("1")
> > + except:
> > + print('IO error setting trace buffer size ')
> > + quit()
> > +
> > def read_trace_data(filename):
> > """ Read and parse trace data """
> >
> > @@ -583,4 +593,9 @@ for root, dirs, files in os.walk('.'):
> > for f in files:
> > fix_ownership(f)
> >
> > +clear_trace_file()
> > +# Free the memory
> > +if interval:
> > + free_trace_buffer()
> > +
> > os.chdir('../../')
> > --
> > 2.7.4
> >
prev parent reply other threads:[~2018-01-05 23:46 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-05 22:31 [PATCH] tools/power/x86/intel_pstate_tracer: Free the trace buffer memory Doug Smythies
2018-01-05 22:54 ` Rafael J. Wysocki
2018-01-05 23:46 ` Srinivas Pandruvada [this message]
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=1515196012.26317.52.camel@linux.intel.com \
--to=srinivas.pandruvada@linux.intel.com \
--cc=doug.smythies@gmail.com \
--cc=dsmythies@telus.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=rafael@kernel.org \
--cc=rjw@rjwysocki.net \
/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;
as well as URLs for NNTP newsgroup(s).