[lc-checkins] CVS: linux/mm/comp_cache proc.c,1.24,1.25
Status: Beta
Brought to you by:
nitin_sf
From: Rodrigo S. de C. <rc...@us...> - 2002-08-13 14:15:22
|
Update of /cvsroot/linuxcompressed/linux/mm/comp_cache In directory usw-pr-cvs1:/tmp/cvs-serv30160/mm/comp_cache Modified Files: proc.c Log Message: Other o Added the ratio of decompressed/read/written pages to the number of compressed pages Index: proc.c =================================================================== RCS file: /cvsroot/linuxcompressed/linux/mm/comp_cache/proc.c,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -r1.24 -r1.25 *** proc.c 7 Aug 2002 18:30:58 -0000 1.24 --- proc.c 13 Aug 2002 14:15:20 -0000 1.25 *************** *** 2,6 **** * linux/mm/comp_cache/proc.c * ! * Time-stamp: <2002-08-07 14:43:55 rcastro> * * Linux Virtual Memory Compressed Cache --- 2,6 ---- * linux/mm/comp_cache/proc.c * ! * Time-stamp: <2002-08-12 19:19:39 rcastro> * * Linux Virtual Memory Compressed Cache *************** *** 290,300 **** #define current_msg ((algorithm == &compression_algorithms[current_algorithm])?"*":"") ! #define proportion(part, total) (total?(int) ((part * 100)/(total)):0) void print_comp_cache_stats(unsigned short alg_idx, char * page, int * length) { ! unsigned int compression_ratio_swap, compression_ratio_page, compression_ratio_total; ! unsigned long total_comp_pages, total_sum_comp_pages; struct comp_alg * algorithm = &compression_algorithms[alg_idx]; struct stats_summary * stats = &algorithm->stats; --- 290,301 ---- #define current_msg ((algorithm == &compression_algorithms[current_algorithm])?"*":"") ! #define proportion(part, total) (total?((unsigned int) ((part * 100)/(total))):0) void print_comp_cache_stats(unsigned short alg_idx, char * page, int * length) { ! unsigned int compression_ratio_swap, compression_ratio_page, compression_ratio_total; ! unsigned long long total_sum_comp_pages; ! unsigned long total_comp_pages; struct comp_alg * algorithm = &compression_algorithms[alg_idx]; struct stats_summary * stats = &algorithm->stats; *************** *** 324,334 **** *length += sprintf(page + *length, " algorithm %s%s\n" ! " - compressed pages: %8lu (S: %3d%% P: %3d%%)\n" ! " - decompressed pages: %8lu (S: %3d%% P: %3d%%)\n" ! " - read pages: %8lu (S: %3d%% P: %3d%%)\n" ! " - written pages: %8lu (S: %3d%% P: %3d%%)\n" ! " - compression ratio: %8d%% (S: %3d%% P: %3d%%)\n", algorithm->name, current_msg, ! stats->comp_swap + stats->comp_page, proportion(stats->comp_swap, total_comp_pages), proportion(stats->comp_page, total_comp_pages), --- 325,335 ---- *length += sprintf(page + *length, " algorithm %s%s\n" ! " - (C) compressed pages: %8lu (S: %3d%% P: %3d%%)\n" ! " - (D) decompressed pages: %8lu (S: %3d%% P: %3d%%) D/C %3u%%\n" ! " - (R) read pages: %8lu (S: %3d%% P: %3d%%) R/C: %3u%%\n" ! " - (W) written pages: %8lu (S: %3d%% P: %3d%%) W/C: %3u%% \n" ! " compression ratio: %8u%% (S: %3u%% P: %3u%%)\n", algorithm->name, current_msg, ! total_comp_pages, proportion(stats->comp_swap, total_comp_pages), proportion(stats->comp_page, total_comp_pages), *************** *** 336,345 **** --- 337,349 ---- proportion(stats->decomp_swap, stats->decomp_swap + stats->decomp_page), proportion(stats->decomp_page, stats->decomp_swap + stats->decomp_page), + (unsigned int) (((stats->decomp_swap + stats->decomp_page) * 100)/total_comp_pages), stats->read_swap + stats->read_page, proportion(stats->read_swap, stats->read_swap + stats->read_page), proportion(stats->read_page, stats->read_swap + stats->read_page), + (unsigned int) (((stats->read_swap + stats->read_page) * 100)/total_comp_pages), stats->written_swap + stats->written_page, proportion(stats->written_swap, stats->written_swap + stats->written_page), proportion(stats->written_page, stats->written_swap + stats->written_page), + (unsigned int) (((stats->written_swap + stats->written_page) * 100)/total_comp_pages), compression_ratio_total, compression_ratio_swap, *************** *** 455,462 **** "compressed cache - statistics\n" " general\n" #ifdef CONFIG_COMP_PAGE_CACHE ! " - swap (S) and page (P) cache support\n" #else ! " - swap (S) cache support only\n" #endif " - maximum used size: %6lu KiB\n" --- 459,468 ---- "compressed cache - statistics\n" " general\n" + " - (S) swap cache support enabled\n" + #ifdef CONFIG_COMP_PAGE_CACHE ! " - (P) page cache support enabled\n" #else ! " - (P) page cache support disabled\n" #endif " - maximum used size: %6lu KiB\n" |