lkml.org 
[lkml]   [2016]   [Apr]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH V2 07/15] coresight: tmc: allocating memory when needed
From
Date
On 19/04/16 13:55, Suzuki K Poulose wrote:
> On 12/04/16 18:54, Mathieu Poirier wrote:
>> 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.
>>

>> /* Wait for TMCSReady bit to be set */
>> @@ -110,19 +108,68 @@ static void tmc_etf_disable_hw(struct tmc_drvdata *drvdata)
>>
>> static int tmc_enable_etf_sink(struct coresight_device *csdev, u32 mode)
>> {
>> + bool allocated = false;
>
> nit: does "used" or buf_used sound more suitable than allocated ?
>
>> + char *buf = NULL;
>> unsigned long flags;
>> struct tmc_drvdata *drvdata = dev_get_drvdata(csdev->dev.parent);
>>
>> + /* This shouldn't be happening */
>> + WARN_ON(mode != CS_MODE_SYSFS);

And we should proceed no further. Return immediately.


\
 
 \ /
  Last update: 2016-04-19 15:41    [W:0.066 / U:0.052 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site