All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [Powertop] [PATCH v2 25/31] report: fixed empty SW settings in need of tunning
@ 2013-11-18 15:06 Igor Zhbanov
  0 siblings, 0 replies; 2+ messages in thread
From: Igor Zhbanov @ 2013-11-18 15:06 UTC (permalink / raw)
  To: powertop

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

Hi Alexandra,


Alexandra Yates wrote:
> After tunning the sistem the Software Setings in Need of Tunning table
> appreared empty. Added a conditional statement to print the table only
> when there are software settings  in need of tunning.
>
> Signed-off-by: Alexandra Yates <alexandra.yates(a)linux.intel.com>
> ---
>   src/tuning/tuning.cpp |   65 ++++++++++++++++++++++++++-----------------------
>   1 file changed, 35 insertions(+), 30 deletions(-)
>
> diff --git a/src/tuning/tuning.cpp b/src/tuning/tuning.cpp
> index ac479a2..67d604f 100644
> --- a/src/tuning/tuning.cpp
> +++ b/src/tuning/tuning.cpp
...
> @@ -257,12 +267,7 @@ void report_show_tunables(void)
>   		untunable_data[i+1]= string(all_untunables[i]->description());
>   
>   	/* Report Output */
> -<<<<<<< HEAD
> -	report.add_div(&div_attr);
>   	report.add_title(&title_attr,__("Untunable Software Issues"));
> -=======
> -	report.add_title(&title_attr,"Untunable Software Issues");
> ->>>>>>> 4d9b82e... report-html: fixed not hidding sections errors
>   	report.add_table(untunable_data, &tune_table_css);

Here is some garbage after merge.

>   
>   	/* Third Table */

-- 
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] 2+ messages in thread
* [Powertop] [PATCH v2 25/31] report: fixed empty SW settings in need of tunning
@ 2013-11-16  0:29 Alexandra Yates
  0 siblings, 0 replies; 2+ messages in thread
From: Alexandra Yates @ 2013-11-16  0:29 UTC (permalink / raw)
  To: powertop

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

After tunning the sistem the Software Setings in Need of Tunning table
appreared empty. Added a conditional statement to print the table only
when there are software settings  in need of tunning.

Signed-off-by: Alexandra Yates <alexandra.yates(a)linux.intel.com>
---
 src/tuning/tuning.cpp |   65 ++++++++++++++++++++++++++-----------------------
 1 file changed, 35 insertions(+), 30 deletions(-)

diff --git a/src/tuning/tuning.cpp b/src/tuning/tuning.cpp
index ac479a2..67d604f 100644
--- a/src/tuning/tuning.cpp
+++ b/src/tuning/tuning.cpp
@@ -209,39 +209,49 @@ void report_show_tunables(void)
         tag_attr div_attr;
         init_div(&div_attr, "clear_block", "tuning");
 
+	/* Set Title attributes */
+       	tag_attr title_attr;
+        init_title_attr(&title_attr);
+
 	/* Set Table attributes, rows, and cols */
 	table_attributes tune_table_css;
 	cols=2;
 	idx = cols;
-	rows= all_tunables.size() + 1;
-	init_tune_table_attr(&tune_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 tunable_data[cols * rows];
-
-	tunable_data[0]=__("Description");
-	tunable_data[1]=__("Script");
-
 
 	for (i = 0; i < all_tunables.size(); i++) {
-		int gb;
-		gb = all_tunables[i]->good_bad();
-		if (gb != TUNE_BAD)
-			continue;
-		tunable_data[idx]=string(all_tunables[i]->description());
-		idx+=1;
-		tunable_data[idx]=string(all_tunables[i]->toggle_script());
-		idx+=1;
+		int tgb;
+		tgb = all_tunables[i]->good_bad();
+		if (tgb == TUNE_BAD)
+			rows+=1;
 	}
-
-	/* Report Output */
+	/* add section */
 	report.add_div(&div_attr);
-	report.add_title(&title_attr,__("Software Settings in Need of Tuning"));
-	report.add_table(tunable_data, &tune_table_css);
+
+	if (rows > 0){
+		rows= rows + 1;
+		init_tune_table_attr(&tune_table_css, rows, cols);
+
+		/* Set array of data in row Major order */
+		string tunable_data[cols * rows];
+
+		tunable_data[0]=__("Description");
+		tunable_data[1]=__("Script");
+
+		for (i = 0; i < all_tunables.size(); i++) {
+			int gb;
+			gb = all_tunables[i]->good_bad();
+			if (gb != TUNE_BAD)
+				continue;
+			tunable_data[idx]=string(all_tunables[i]->description());
+			idx+=1;
+			tunable_data[idx]=string(all_tunables[i]->toggle_script());
+			idx+=1;
+		}
+
+		/* Report Output */
+		report.add_title(&title_attr,__("Software Settings in Need of Tuning"));
+		report.add_table(tunable_data, &tune_table_css);
+	}
 
 	/* Second Table */
 	/* Set Table attributes, rows, and cols */
@@ -257,12 +267,7 @@ void report_show_tunables(void)
 		untunable_data[i+1]= string(all_untunables[i]->description());
 
 	/* Report Output */
-<<<<<<< HEAD
-	report.add_div(&div_attr);
 	report.add_title(&title_attr,__("Untunable Software Issues"));
-=======
-	report.add_title(&title_attr,"Untunable Software Issues");
->>>>>>> 4d9b82e... report-html: fixed not hidding sections errors
 	report.add_table(untunable_data, &tune_table_css);
 
 	/* Third Table */
-- 
1.7.9.5


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

end of thread, other threads:[~2013-11-18 15:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-18 15:06 [Powertop] [PATCH v2 25/31] report: fixed empty SW settings in need of tunning Igor Zhbanov
  -- strict thread matches above, loose matches on Subject: below --
2013-11-16  0:29 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.