All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [Powertop] Support for printing report in text format in powertop2.x
@ 2012-08-29  7:09 Bram Bouwens
  0 siblings, 0 replies; 8+ messages in thread
From: Bram Bouwens @ 2012-08-29  7:09 UTC (permalink / raw)
  To: powertop

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

On 08/29/2012 08:59 AM, Igor Zhbanov wrote:
>
> I think that we could design generalized reporting system that could
> output data in any desired format (HTML, CSV and probably TXT).
>

Another suggestion would be XML, which could be transformed automatically
into HTML, or CSV, or imported into databases/spreadsheets directly
(depending on the schema probably).


Bram

^ permalink raw reply	[flat|nested] 8+ messages in thread
* Re: [Powertop] Support for printing report in text format in powertop2.x
@ 2012-08-30 16:12 Sergey Senozhatsky
  0 siblings, 0 replies; 8+ messages in thread
From: Sergey Senozhatsky @ 2012-08-30 16:12 UTC (permalink / raw)
  To: powertop

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

On (08/30/12 10:40), Igor Zhbanov wrote:
> Hi Sergey.
>

Hello Igor,
 
> Sergey Senozhatsky wrote:
> 
> >no offense, but do we actually need that kind of flexibility?
> I don't know whether the project needs that kind of flexibility but I suppose
> that some general framework could lead to two things:
> 1) Avoid doubling the code for printing in CSV and HTML lines.
> 2) Allows to easily produce correct CSV and HTML files that can be successfully validated.
> 

yes, good points.

so, now we have two proposals for reworks:
UI rework and generalization (scaling, scrolilng, etc.) and proposal for reporting
system generalization and rework, and the latter one is priority (if we stick to
it) --  it's rather hard to depend on UI and pretty easy on output file format, thus
format changes should be done as soon as possible.


	-ss

^ permalink raw reply	[flat|nested] 8+ messages in thread
* Re: [Powertop] Support for printing report in text format in powertop2.x
@ 2012-08-30  6:40 Igor Zhbanov
  0 siblings, 0 replies; 8+ messages in thread
From: Igor Zhbanov @ 2012-08-30  6:40 UTC (permalink / raw)
  To: powertop

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

Hi Sergey.

Sergey Senozhatsky wrote:

> no offense, but do we actually need that kind of flexibility?
I don't know whether the project needs that kind of flexibility but I suppose
that some general framework could lead to two things:
1) Avoid doubling the code for printing in CSV and HTML lines.
2) Allows to easily produce correct CSV and HTML files that can be successfully validated.

Thank you.

-- 
Best regards,
Igor Zhbanov,
Expert Software Engineer,
phone: +7 (495) 797 25 00 ext 3806
e-mail: i.zhbanov(a)samsung.com

ASWG, Moscow R&D center, Samsung Electronics
12 Dvintsev street, building 1
127018, Moscow, Russian Federation


^ permalink raw reply	[flat|nested] 8+ messages in thread
* Re: [Powertop] Support for printing report in text format in powertop2.x
@ 2012-08-29 21:15 Sergey Senozhatsky
  0 siblings, 0 replies; 8+ messages in thread
From: Sergey Senozhatsky @ 2012-08-29 21:15 UTC (permalink / raw)
  To: powertop

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

On (08/29/12 10:59), Igor Zhbanov wrote:
> Hi everyone!
> 
> Viresh Kumar wrote:
> 
> >I have following test case, i need to capture data using powertop
> >for some time and then analyse it.
> >
> >There are two formats in which this is done as of today
> >- html
> >- csv
> >
> >I believe we must also have a plain text version for it. Any cons
> >of that?
> 
> I agree with that. Also I think that report system with many places like:
> 
> if (html)
> 	printf(something);
> else
> 	printf(nearly-the-same);
> 
> that needs to be redesigned. I use something like CSV-generator in my
> yet to be merged MALI GPU support patch because generated CVS's doesn't
> conform to any CSV standards: there are no quotes for empty values,
> also quote symbols are not escaped inside the values. Commas are not escaped too. So it is impossible to parse generated CSV's with
> traditional parsers.
>

thanks a lot for reporting.


> I think that we could design generalized reporting system that could
> output data in any desired format (HTML, CSV and probably TXT).
>


no offense, but do we actually need that kind of flexibility?


	-ss

 
> Since all results are contained inside the tables, that system could have interface like
> create_report(type);
> report.add_table(...);
> report.add_column_name(const char *name, bool last_in_line = false);
> report.add_column_val(const char *value, bool last_in_line = false);
> report.get_result();
> 
> Now there are a lots of code like that:
> 
> if (reporttype)
> 	fprintf(reportout.http_report,
> 		"<tr class=\"%s\"><td class=\"process_power\">%s</td><td class=\"process_power\">%s</td><td class=\"process_power\">%s</td><td>%s</td><td>%s</td></tr>\n",
> 		process_class(lines), power, usage, events, name, pretty_print(all_power[i]->description(), descr, 128));
> else
> 	fprintf(reportout.csv_report,
> 		"%s,%s,%s,%s,%s \n",
> 		power, usage, events, name, pretty_print(all_power[i]->description(), descr, 128));
> 
> I think that we could separate CSV/HTML generation code from processing logic. What you think?
> 
> -- 
> Best regards,
> Igor Zhbanov,
> Expert Software Engineer,
> phone: +7 (495) 797 25 00 ext 3806
> e-mail: i.zhbanov(a)samsung.com
> 
> ASWG, Moscow R&D center, Samsung Electronics
> 12 Dvintsev street, building 1
> 127018, Moscow, Russian Federation
> 
> _______________________________________________
> PowerTop mailing list
> PowerTop(a)lists.01.org
> https://lists.01.org/mailman/listinfo/powertop
> 

^ permalink raw reply	[flat|nested] 8+ messages in thread
* Re: [Powertop] Support for printing report in text format in powertop2.x
@ 2012-08-29 14:40 Igor Zhbanov
  0 siblings, 0 replies; 8+ messages in thread
From: Igor Zhbanov @ 2012-08-29 14:40 UTC (permalink / raw)
  To: powertop

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

Arjan van de Ven wrote:
> On 8/28/2012 11:16 PM, Viresh Kumar wrote:
>> Hi Guys,
>>
>> I have following test case, i need to capture data using powertop
>> for some time and then analyse it.
>>
>> There are two formats in which this is done as of today
>> - html
>> - csv
> the CSV format is there for automatic (machine) analysis
>
> is that not good enough for some reason ?
It is good. But it is bad-formatted, so no one standard parser could parse it.
It contains unquoted empty values like , , ,
Also it doesn't escape double quote symbols inside the values.

It doesn't escape commas inside the values. This is especially important for some locales
where comma is used as decimal separator in floating-point numbers. So I prefer to run PowerTOP
like this:
LC_NUMERIC=en ./powertop ...

It doesn't escape space characters inside the values.
It lefts hanging commas in the end of the string.
Etc.

So the CSV-report of the PowerTOP doesn't conform to any CSV standards.

-- 
Best regards,
Igor Zhbanov,
Expert Software Engineer,
phone: +7 (495) 797 25 00 ext 3806
e-mail: i.zhbanov(a)samsung.com

ASWG, Moscow R&D center, Samsung Electronics
12 Dvintsev street, building 1
127018, Moscow, Russian Federation


^ permalink raw reply	[flat|nested] 8+ messages in thread
* Re: [Powertop] Support for printing report in text format in powertop2.x
@ 2012-08-29 14:28 Arjan van de Ven
  0 siblings, 0 replies; 8+ messages in thread
From: Arjan van de Ven @ 2012-08-29 14:28 UTC (permalink / raw)
  To: powertop

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

On 8/28/2012 11:16 PM, Viresh Kumar wrote:
> Hi Guys,
> 
> I have following test case, i need to capture data using powertop
> for some time and then analyse it.
> 
> There are two formats in which this is done as of today
> - html
> - csv

the CSV format is there for automatic (machine) analysis

is that not good enough for some reason ?


^ permalink raw reply	[flat|nested] 8+ messages in thread
* Re: [Powertop] Support for printing report in text format in powertop2.x
@ 2012-08-29  6:59 Igor Zhbanov
  0 siblings, 0 replies; 8+ messages in thread
From: Igor Zhbanov @ 2012-08-29  6:59 UTC (permalink / raw)
  To: powertop

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

Hi everyone!

Viresh Kumar wrote:

> I have following test case, i need to capture data using powertop
> for some time and then analyse it.
>
> There are two formats in which this is done as of today
> - html
> - csv
>
> I believe we must also have a plain text version for it. Any cons
> of that?

I agree with that. Also I think that report system with many places like:

if (html)
	printf(something);
else
	printf(nearly-the-same);

that needs to be redesigned. I use something like CSV-generator in my
yet to be merged MALI GPU support patch because generated CVS's doesn't
conform to any CSV standards: there are no quotes for empty values,
also quote symbols are not escaped inside the values. Commas are not escaped too. So it is impossible to parse generated CSV's with
traditional parsers.

I think that we could design generalized reporting system that could
output data in any desired format (HTML, CSV and probably TXT).

Since all results are contained inside the tables, that system could have interface like
create_report(type);
report.add_table(...);
report.add_column_name(const char *name, bool last_in_line = false);
report.add_column_val(const char *value, bool last_in_line = false);
report.get_result();

Now there are a lots of code like that:

if (reporttype)
	fprintf(reportout.http_report,
		"<tr class=\"%s\"><td class=\"process_power\">%s</td><td class=\"process_power\">%s</td><td class=\"process_power\">%s</td><td>%s</td><td>%s</td></tr>\n",
		process_class(lines), power, usage, events, name, pretty_print(all_power[i]->description(), descr, 128));
else
	fprintf(reportout.csv_report,
		"%s,%s,%s,%s,%s \n",
		power, usage, events, name, pretty_print(all_power[i]->description(), descr, 128));

I think that we could separate CSV/HTML generation code from processing logic. What you think?

-- 
Best regards,
Igor Zhbanov,
Expert Software Engineer,
phone: +7 (495) 797 25 00 ext 3806
e-mail: i.zhbanov(a)samsung.com

ASWG, Moscow R&D center, Samsung Electronics
12 Dvintsev street, building 1
127018, Moscow, Russian Federation


^ permalink raw reply	[flat|nested] 8+ messages in thread
* [Powertop] Support for printing report in text format in powertop2.x
@ 2012-08-29  6:16 Viresh Kumar
  0 siblings, 0 replies; 8+ messages in thread
From: Viresh Kumar @ 2012-08-29  6:16 UTC (permalink / raw)
  To: powertop

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

Hi Guys,

I have following test case, i need to capture data using powertop
for some time and then analyse it.

There are two formats in which this is done as of today
- html
- csv

I believe we must also have a plain text version for it. Any cons
of that?

Without changing much of code, we can simply use html2text
at the end of program to create default file Powertop.txt.

Thanks for your inputs.

--
viresh

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2012-08-30 16:12 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-29  7:09 [Powertop] Support for printing report in text format in powertop2.x Bram Bouwens
  -- strict thread matches above, loose matches on Subject: below --
2012-08-30 16:12 Sergey Senozhatsky
2012-08-30  6:40 Igor Zhbanov
2012-08-29 21:15 Sergey Senozhatsky
2012-08-29 14:40 Igor Zhbanov
2012-08-29 14:28 Arjan van de Ven
2012-08-29  6:59 Igor Zhbanov
2012-08-29  6:16 Viresh Kumar

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.