coresight: tmc: allocating memory when needed
authorMathieu Poirier <mathieu.poirier@linaro.org>
Tue, 3 May 2016 17:33:52 +0000 (11:33 -0600)
committerMathieu Poirier <mathieu.poirier@linaro.org>
Wed, 1 Jun 2016 21:46:36 +0000 (15:46 -0600)
commit17c61c32ab5a2e0ff67e00e4d562ba0a97b999f2
treea7b17098b19440e060e36986e3da9b9220c13384
parent5e0bd5f02c29e095fbd68b3732e6ee83f1c941ad
coresight: tmc: allocating memory when needed

In it's current form the TMC probe() function allocates
trace buffer memory at boot time, event if coresight isn't
used.  This is highly inefficient since trace buffers can
occupy a lot of memory that could be used otherwised.

This patch allocates trace buffers on the fly, when the
coresight subsystem is solicited.  Allocated buffers are
released when traces are read using the device descriptors
under /dev.

Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Reviewed-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit de5461970b3e9e19470b821f5feaa3235ceb35f5)
drivers/hwtracing/coresight/coresight-tmc-etf.c
drivers/hwtracing/coresight/coresight-tmc-etr.c
drivers/hwtracing/coresight/coresight-tmc.c