All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sanjay Singh Rawat <sanjay.rawat at linaro.org>
To: powertop@lists.01.org
Subject: Re: [Powertop] [PATCH] devfreq: add devfreq devices stats support
Date: Fri, 10 Oct 2014 15:12:36 +0530	[thread overview]
Message-ID: <5437AA0C.5000506@linaro.org> (raw)
In-Reply-To: 20141001151216.GB946@swordfish

[-- Attachment #1: Type: text/plain, Size: 1876 bytes --]

thanks for the review Sergey

On Wednesday 01 October 2014 08:42 PM, Sergey Senozhatsky wrote:
> On (09/30/14 12:04), Sanjay Singh Rawat wrote:
>> add window to show frequency stats for devfreq devices
>>
>> Signed-off-by: Rajagopal Venkat <rajagopal.venkat(a)gmail.com>
>> Signed-off-by: Sanjay Singh Rawat <sanjay.rawat(a)linaro.org>
>> ---
>>
>> v2 - Show devfreq window on support basis. Check for empty devfreq
>>       directory.
>>     - Free the open dirp while exiting.
>> ---
>>   src/Makefile.am           |   1 +
>>   src/devices/devfreq.cpp   | 367 ++++++++++++++++++++++++++++++++++++++++++++++
>>   src/devices/devfreq.h     |  75 ++++++++++
>>   src/main.cpp              |   9 ++
[...]
>> +	file.close();
>> +}
>> +
>> +void devfreq::start_measurement(void)
>> +{
>> +	unsigned int i;
>> +	ifstream file;
> not needed.

ack
>
[...]
>> +		is_enabled = false;
>> +		closedir(dir);
>> +		return;
>> +	}
> who close the dir if `num != 2'?

the dir is closed in the clear_all_devfreq() function while exiting
>
>> +	callback fn = &devfreq_dev_callback;
>> +	process_directory(p.c_str(), fn);
>> +}
>> +
>> +void initialize_devfreq(void)
[...]
>> +
>> +void clear_all_devfreq()
>> +{
>> +	unsigned int i, j;
>> +
>> +	for (i=0; i < all_devfreq.size(); i++) {
>> +		class devfreq *df = all_devfreq[i];
>> +
>> +		for(j=0; j < df->dstates.size(); j++)
>> +			delete df->dstates[j];
>> +
>> +		df->dstates.resize(0);
> resize not needed, I think

ack
>
>> +		delete df;
>> +	}
>> +	all_devfreq.clear();
>> +	/* close /sys/class/devfreq */
[...]
>> +
>> +class devfreq: public device {
>> +	char dir_name[4096];
> hm. so this is 2 pages for each class instance.
> can you

will resize to 128 bytes
> 	const char *dir_name;
> 	
> and then
> 	dir_name = strdup(dname); ?
>
>

-- 
sanjay


[-- Attachment #2: attachment.html --]
[-- Type: text/html, Size: 3818 bytes --]

             reply	other threads:[~2014-10-10  9:42 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-10  9:42 Sanjay Singh Rawat [this message]
  -- strict thread matches above, loose matches on Subject: below --
2014-10-10  9:43 [Powertop] [PATCH] devfreq: add devfreq devices stats support Sanjay Singh Rawat
2014-10-01 20:22 Magnus Fromreide
2014-10-01 15:12 Sergey Senozhatsky
2014-10-01 14:52 Sergey Senozhatsky
2014-09-30  6:34 Sanjay Singh Rawat
2014-09-30  4:21 Sanjay Singh Rawat
2014-09-29 23:04 Alexandra Yates
2014-09-29 22:46 Alexandra Yates
2014-09-17  4:16 Sanjay Singh Rawat
2014-08-25  6:58 Sanjay Singh Rawat
2014-08-25  6:55 Sanjay Singh Rawat
2014-08-25  6:24 Sanjay Singh Rawat

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5437AA0C.5000506@linaro.org \
    --to=powertop@lists.01.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.