Commit fbe31388 authored by Doug Smythies's avatar Doug Smythies Committed by Rafael J. Wysocki

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: default avatarDoug Smythies <dsmythies@telus.net>
Acked-by: default avatarSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent cc85a6e2
......@@ -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('../../')
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment