lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 5 Jan 2018 23:54:24 +0100
From:   "Rafael J. Wysocki" <rafael@...nel.org>
To:     Doug Smythies <doug.smythies@...il.com>,
        Srinivas Pandruvada <srinivas.pandruvada@...ux.intel.com>
Cc:     Doug Smythies <dsmythies@...us.net>,
        "Rafael J. Wysocki" <rjw@...ysocki.net>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Linux PM <linux-pm@...r.kernel.org>
Subject: Re: [PATCH] tools/power/x86/intel_pstate_tracer: Free the trace
 buffer memory

On Fri, Jan 5, 2018 at 11:31 PM, Doug Smythies <doug.smythies@...il.com> 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@...us.net>

Looks OK to me.  Srinivas?

> ---
>  .../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
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ