diff options
author | Doug Smythies <doug.smythies@gmail.com> | 2018-01-06 01:31:16 +0300 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2018-01-10 03:12:04 +0300 |
commit | fbe313884d7ddd73ce457473cbdf3763f5b1d3da (patch) | |
tree | fefff741d584084e6984863c13532bca8e2043ac /tools/power | |
parent | cc85a6e2d097506dba2c5b8044884a3d22cc4a6e (diff) | |
download | linux-fbe313884d7ddd73ce457473cbdf3763f5b1d3da.tar.xz |
tools/power/x86/intel_pstate_tracer: Free the trace buffer memory
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>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'tools/power')
-rwxr-xr-x | tools/power/x86/intel_pstate_tracer/intel_pstate_tracer.py | 15 |
1 files changed, 15 insertions, 0 deletions
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 0b24dd9d01ff..29f50d4cfea0 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('../../') |