Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1382496

Re: [PATCH V2 07/15] coresight: tmc: allocating memory when needed

From Suzuki K Poulose <Suzuki.Poulose@arm.com>
Newsgroups linux.kernel
Subject Re: [PATCH V2 07/15] coresight: tmc: allocating memory when needed
Date 2016-04-19 15:20 +0200
Message-ID <rpDJn-7sx-9@gated-at.bofh.it> (permalink)
References <rnaLv-2Vr-3@gated-at.bofh.it> <rnaLw-2Vr-15@gated-at.bofh.it> <rpDq2-71o-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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.

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [PATCH V2 07/15] coresight: tmc: allocating memory when needed Suzuki K Poulose <Suzuki.Poulose@arm.com> - 2016-04-19 15:00 +0200
  Re: [PATCH V2 07/15] coresight: tmc: allocating memory when needed Suzuki K Poulose <Suzuki.Poulose@arm.com> - 2016-04-19 15:20 +0200
  Re: [PATCH V2 07/15] coresight: tmc: allocating memory when needed Mathieu Poirier <mathieu.poirier@linaro.org> - 2016-04-19 17:40 +0200

csiph-web