All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [Powertop] [PATCH 19/29] report: redesign System Information csv and html
@ 2013-10-31  7:35 Igor Zhbanov
  0 siblings, 0 replies; 3+ messages in thread
From: Igor Zhbanov @ 2013-10-31  7:35 UTC (permalink / raw)
  To: powertop

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

Hi Alexandra,

Alexandra Yates wrote:
> Enabled "System Information" section for csv and html report design.
>
> Signed-off-by: Alexandra Yates <alexandra.yates(a)linux.intel.com>
> ---
>   src/process/do_process.cpp      |  113 ++++++++++++++++++++++-----------------
>   src/report/report-data-html.cpp |   11 +++-
>   src/report/report-data-html.h   |    2 +
>   3 files changed, 77 insertions(+), 49 deletions(-)
>
> diff --git a/src/process/do_process.cpp b/src/process/do_process.cpp
> index 6708f12..c50fdd3 100644
> --- a/src/process/do_process.cpp
> +++ b/src/process/do_process.cpp
> @@ -889,42 +889,48 @@ void report_process_update_display(void)
...
>   
> -	report.begin_section(SECTION_SOFTWARE);
> -	report.add_header(__("Overview of Software Power Consumers"));
> -	report.begin_table(TABLE_WIDE);
> -	report.begin_row();
> -	if (show_power) {
> -		report.begin_cell(CELL_SOFTWARE_HEADER);
> -		report.add(__("Power est."));
> -	}
> +	/* Set Table attributes, rows, and cols */
> +	cols=7;
> +	if (show_power)
> +		cols=8;
>   
> -	report.begin_cell(CELL_SOFTWARE_HEADER);
> -	report.add(__("Usage"));
> -	report.begin_cell(CELL_SOFTWARE_HEADER);
> -	report.add(__("Wakeups/s"));
> -	report.begin_cell(CELL_SOFTWARE_HEADER);
> -	report.add(__("GPU ops/s"));
> -	report.begin_cell(CELL_SOFTWARE_HEADER);
> -	report.add(__("Disk IO/s"));
> -	report.begin_cell(CELL_SOFTWARE_HEADER);
> -	report.add(__("GFX Wakeups/s"));
> -	report.begin_cell(CELL_SOFTWARE_PROCESS);
> -	report.add(__("Category"));
> -	report.begin_cell(CELL_SOFTWARE_DESCRIPTION);
> -	report.add(__("Description"));
...
> +	/* Set array of data in row Major order */
> +	string  software_data[cols * rows];
> +	software_data[0]="Usage";
> +	software_data[1]="Wakeups/s";
> +	software_data[2]="GPU ops/s";
> +	software_data[3]="Disk IO/s";
> +	software_data[4]="GFX Wakeups/s";
> +	software_data[5]="Category";
> +	software_data[6]="Description";
> +
> +	if (show_power)
> +		software_data[7]="PW Estimate";
>
Didn't you miss the __(...) macro here? This macro is used for localizing
strings to produce reports on another languages too.

Thank you.

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

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


^ permalink raw reply	[flat|nested] 3+ messages in thread
* Re: [Powertop] [PATCH 19/29] report: redesign System Information csv and html
@ 2013-10-31 20:27 Alexandra Yates
  0 siblings, 0 replies; 3+ messages in thread
From: Alexandra Yates @ 2013-10-31 20:27 UTC (permalink / raw)
  To: powertop

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


> Hi Alexandra,
>
> Alexandra Yates wrote:
>> Enabled "System Information" section for csv and html report design.
>>
>> Signed-off-by: Alexandra Yates <alexandra.yates(a)linux.intel.com>
>> ---
>>   src/process/do_process.cpp      |  113
>> ++++++++++++++++++++++-----------------
>>   src/report/report-data-html.cpp |   11 +++-
>>   src/report/report-data-html.h   |    2 +
>>   3 files changed, 77 insertions(+), 49 deletions(-)
>>
>> diff --git a/src/process/do_process.cpp b/src/process/do_process.cpp
>> index 6708f12..c50fdd3 100644
>> --- a/src/process/do_process.cpp
>> +++ b/src/process/do_process.cpp
>> @@ -889,42 +889,48 @@ void report_process_update_display(void)
> ...
>>
>> -	report.begin_section(SECTION_SOFTWARE);
>> -	report.add_header(__("Overview of Software Power Consumers"));
>> -	report.begin_table(TABLE_WIDE);
>> -	report.begin_row();
>> -	if (show_power) {
>> -		report.begin_cell(CELL_SOFTWARE_HEADER);
>> -		report.add(__("Power est."));
>> -	}
>> +	/* Set Table attributes, rows, and cols */
>> +	cols=7;
>> +	if (show_power)
>> +		cols=8;
>>
>> -	report.begin_cell(CELL_SOFTWARE_HEADER);
>> -	report.add(__("Usage"));
>> -	report.begin_cell(CELL_SOFTWARE_HEADER);
>> -	report.add(__("Wakeups/s"));
>> -	report.begin_cell(CELL_SOFTWARE_HEADER);
>> -	report.add(__("GPU ops/s"));
>> -	report.begin_cell(CELL_SOFTWARE_HEADER);
>> -	report.add(__("Disk IO/s"));
>> -	report.begin_cell(CELL_SOFTWARE_HEADER);
>> -	report.add(__("GFX Wakeups/s"));
>> -	report.begin_cell(CELL_SOFTWARE_PROCESS);
>> -	report.add(__("Category"));
>> -	report.begin_cell(CELL_SOFTWARE_DESCRIPTION);
>> -	report.add(__("Description"));
> ...
>> +	/* Set array of data in row Major order */
>> +	string  software_data[cols * rows];
>> +	software_data[0]="Usage";
>> +	software_data[1]="Wakeups/s";
>> +	software_data[2]="GPU ops/s";
>> +	software_data[3]="Disk IO/s";
>> +	software_data[4]="GFX Wakeups/s";
>> +	software_data[5]="Category";
>> +	software_data[6]="Description";
>> +
>> +	if (show_power)
>> +		software_data[7]="PW Estimate";
>>
> Didn't you miss the __(...) macro here? This macro is used for localizing
> strings to produce reports on another languages too.
>
> Thank you.
>
> --
> Best regards,
> Igor Zhbanov,
> Expert Software Engineer,
> phone: +7 (495) 797 25 00 ext 3981
> e-mail: i.zhbanov(a)samsung.com
>
> Mobile group, 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
>

Hi Igor,

I totally missed that macro, I will correct and recheck all the other
patches to ensure they all meet the requirement.

Thank you,
Alexandra.

^ permalink raw reply	[flat|nested] 3+ messages in thread
* [Powertop] [PATCH 19/29] report: redesign System Information csv and html
@ 2013-10-30 21:21 Alexandra Yates
  0 siblings, 0 replies; 3+ messages in thread
From: Alexandra Yates @ 2013-10-30 21:21 UTC (permalink / raw)
  To: powertop

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

Enabled "System Information" section for csv and html report design.

Signed-off-by: Alexandra Yates <alexandra.yates(a)linux.intel.com>
---
 src/process/do_process.cpp      |  113 ++++++++++++++++++++++-----------------
 src/report/report-data-html.cpp |   11 +++-
 src/report/report-data-html.h   |    2 +
 3 files changed, 77 insertions(+), 49 deletions(-)

diff --git a/src/process/do_process.cpp b/src/process/do_process.cpp
index 6708f12..c50fdd3 100644
--- a/src/process/do_process.cpp
+++ b/src/process/do_process.cpp
@@ -889,42 +889,48 @@ void report_process_update_display(void)
 {
 	unsigned int i;
 	unsigned int total;
+	int show_power, cols, rows, idx;
 
-	int show_power;
-
-	sort(all_power.begin(), all_power.end(), power_cpu_sort);
-
-	show_power = global_power_valid();
+	/* div attr css_class and css_id */
+	tag_attr div_attr;
+	init_div(&div_attr, "clear_block", "software");
 
-	report.begin_section(SECTION_SOFTWARE);
-	report.add_header(__("Overview of Software Power Consumers"));
-	report.begin_table(TABLE_WIDE);
-	report.begin_row();
-	if (show_power) {
-		report.begin_cell(CELL_SOFTWARE_HEADER);
-		report.add(__("Power est."));
-	}
+	/* Set Table attributes, rows, and cols */
+	cols=7;
+	if (show_power)
+		cols=8;
 
-	report.begin_cell(CELL_SOFTWARE_HEADER);
-	report.add(__("Usage"));
-	report.begin_cell(CELL_SOFTWARE_HEADER);
-	report.add(__("Wakeups/s"));
-	report.begin_cell(CELL_SOFTWARE_HEADER);
-	report.add(__("GPU ops/s"));
-	report.begin_cell(CELL_SOFTWARE_HEADER);
-	report.add(__("Disk IO/s"));
-	report.begin_cell(CELL_SOFTWARE_HEADER);
-	report.add(__("GFX Wakeups/s"));
-	report.begin_cell(CELL_SOFTWARE_PROCESS);
-	report.add(__("Category"));
-	report.begin_cell(CELL_SOFTWARE_DESCRIPTION);
-	report.add(__("Description"));
+	idx=cols;
 
 	total = all_power.size();
-
 	if (total > 100)
 		total = 100;
 
+	rows=total+1;
+	table_attributes std_table_css;
+	init_nowarp_table_attr(&std_table_css, rows, cols);
+
+
+	/* Set Title attributes */
+	tag_attr title_attr;
+	init_title_attr(&title_attr);
+
+	/* Set array of data in row Major order */
+	string  software_data[cols * rows];
+	software_data[0]="Usage";
+	software_data[1]="Wakeups/s";
+	software_data[2]="GPU ops/s";
+	software_data[3]="Disk IO/s";
+	software_data[4]="GFX Wakeups/s";
+	software_data[5]="Category";
+	software_data[6]="Description";
+
+	if (show_power)
+		software_data[7]="PW Estimate";
+
+	sort(all_power.begin(), all_power.end(), power_cpu_sort);
+	show_power = global_power_valid();
+
 	for (i = 0; i < total; i++) {
 		char power[16];
 		char name[20];
@@ -943,7 +949,8 @@ void report_process_update_display(void)
 		if (strcmp(name, "Device") == 0)
 			continue;
 
-		if (all_power[i]->events() == 0 && all_power[i]->usage() == 0 && all_power[i]->Witts() == 0)
+		if (all_power[i]->events() == 0 && all_power[i]->usage() == 0
+				&& all_power[i]->Witts() == 0)
 			break;
 
 		usage[0] = 0;
@@ -958,7 +965,7 @@ void report_process_update_display(void)
 			sprintf(wakes, "%5.2f", all_power[i]->wake_ups / measurement_time);
 		sprintf(gpus, "%5.1f", all_power[i]->gpu_ops / measurement_time);
 		sprintf(disks, "%5.1f (%5.1f)", all_power[i]->hard_disk_hits / measurement_time,
-			all_power[i]->disk_hits / measurement_time);
+				all_power[i]->disk_hits / measurement_time);
 		sprintf(xwakes, "%5.1f", all_power[i]->xwakes / measurement_time);
 		if (!all_power[i]->show_events()) {
 			wakes[0] = 0;
@@ -975,27 +982,37 @@ void report_process_update_display(void)
 		if (all_power[i]->xwakes == 0)
 			xwakes[0] = 0;
 
-		report.begin_row(ROW_SOFTWARE);
+		software_data[idx]=string(usage);
+		idx+=1;
+
+		software_data[idx]=string(wakes);
+		idx+=1;
+
+		software_data[idx]=string(gpus);
+		idx+=1;
+
+		software_data[idx]=string(disks);
+		idx+=1;
+
+		software_data[idx]=string(xwakes);
+		idx+=1;
+
+		software_data[idx]=string(name);
+		idx+=1;
+
+		software_data[idx]=string(pretty_print(all_power[i]->description(), descr, 128));
+		idx+=1;
 		if (show_power) {
-			report.begin_cell(CELL_SOFTWARE_POWER);
-			report.add(power);
+			software_data[idx]=string(power);
+			idx+=1;
 		}
-
-		report.begin_cell(CELL_SOFTWARE_POWER);
-		report.add(usage);
-		report.begin_cell(CELL_SOFTWARE_POWER);
-		report.add(wakes);
-		report.begin_cell(CELL_SOFTWARE_POWER);
-		report.add(gpus);
-		report.begin_cell(CELL_SOFTWARE_POWER);
-		report.add(disks);
-		report.begin_cell(CELL_SOFTWARE_POWER);
-		report.add(xwakes);
-		report.begin_cell();
-		report.add(name);
-		report.begin_cell();
-		report.add(pretty_print(all_power[i]->description(), descr, 128));
 	}
+
+	/* Report Output */
+	report.add_div(&div_attr);
+	report.add_title(&title_attr, "Overview of Software Power Consumers");
+	report.add_table(software_data, &std_table_css);
+        report.end_div();
 }
 
 void report_summary(void)
diff --git a/src/report/report-data-html.cpp b/src/report/report-data-html.cpp
index 28732c9..f0d536d 100644
--- a/src/report/report-data-html.cpp
+++ b/src/report/report-data-html.cpp
@@ -71,7 +71,16 @@ void init_cpu_table_attr(struct table_attributes *table_css, int title_mod,
 }
 
 
-
+void init_nowarp_table_attr(struct table_attributes *table_css, int rows, int cols){
+	table_css->table_class="emphasis2";
+	table_css->tr_class="emph1";
+	table_css->th_class="emph_title";
+	table_css->td_class="no_wrap";
+	table_css->pos_table_title=T;
+	table_css->title_mod=0;
+	table_css->rows=rows;
+	table_css->cols=cols;
+}
 
 
 /* Other Helper Functions */
diff --git a/src/report/report-data-html.h b/src/report/report-data-html.h
index 61e75c0..d2d782b 100644
--- a/src/report/report-data-html.h
+++ b/src/report/report-data-html.h
@@ -53,6 +53,8 @@ init_core_table_attr(struct table_attributes *table_css, int title_mod,
 void
 init_cpu_table_attr(struct table_attributes *table_css, int title_mod,
 		int rows, int cols);
+void
+init_nowarp_table_attr(struct table_attributes *table_css, int rows, int cols);
 
 
 /* Other helper functions */
-- 
1.7.9.5


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

end of thread, other threads:[~2013-10-31 20:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-31  7:35 [Powertop] [PATCH 19/29] report: redesign System Information csv and html Igor Zhbanov
  -- strict thread matches above, loose matches on Subject: below --
2013-10-31 20:27 Alexandra Yates
2013-10-30 21:21 Alexandra Yates

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.