aboutsummaryrefslogtreecommitdiffstats
path: root/package/compcache/patches/200-av_compress_ratio.patch
blob: 82a1ecce84d1e24ac08f51b65d77c2f80a6283c2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
diff -uNr compcache-0.5.4-old/ramzswap.c compcache-0.5.4/ramzswap.c
--- compcache-0.5.4-old/ramzswap.c	2009-10-18 09:14:53.000000000 +0200
+++ compcache-0.5.4/ramzswap.c	2009-10-18 09:12:08.000000000 +0200
@@ -126,7 +126,9 @@
 {
 	int len;
 	size_t succ_writes, mem_used;
-	unsigned int good_compress_perc = 0, no_compress_perc = 0;
+	unsigned int good_compress_perc = 0, 
+		     av_compression_perc = 0,
+		     no_compress_perc = 0;
 
 	mem_used = xv_get_total_size_bytes(rzs.mem_pool)
 			+ (stats.pages_expand << PAGE_SHIFT);
@@ -154,6 +156,8 @@
 	if (succ_writes && stats.pages_stored) {
 		good_compress_perc = stats.good_compress * 100
 					/ stats.pages_stored;
+		av_compression_perc = stats.compr_size * 100
+					/ (stats.good_compress << PAGE_SHIFT);
 		no_compress_perc = stats.pages_expand * 100
 					/ stats.pages_stored;
 	}
@@ -168,6 +172,7 @@
 		"NotifyFree:	%8llu\n"
 		"ZeroPages:	%8u\n"
 		"GoodCompress:	%8u %%\n"
+		"AvCompression:	%8u %%\n"
 		"NoCompress:	%8u %%\n"
 		"PagesStored:	%8u\n"
 		"PagesUsed:	%8zu\n"
@@ -182,6 +187,7 @@
 		stats.notify_free,
 		stats.pages_zero,
 		good_compress_perc,
+		av_compression_perc,
 		no_compress_perc,
 		stats.pages_stored,
 		mem_used >> PAGE_SHIFT,