[PATCH 3/3] Remove --cyclic-buffer option.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The size of cyclic buffer will be calculated automatically with
[PATCH 2/3], so users don't have to specify the size manually.

Signed-off-by: Atsushi Kumagai <kumagai-atsushi at mxc.nes.nec.co.jp>
---
 makedumpfile.8 | 16 ----------------
 makedumpfile.c | 31 ++++++-------------------------
 print_info.c   | 11 -----------
 3 files changed, 6 insertions(+), 52 deletions(-)

diff --git a/makedumpfile.8 b/makedumpfile.8
index 9f394f0..41d5822 100644
--- a/makedumpfile.8
+++ b/makedumpfile.8
@@ -348,22 +348,6 @@ on the following example.
 # makedumpfile \-\-reassemble dumpfile1 dumpfile2 dumpfile
 
 .TP
-\fB\-\-cyclic\-buffer\fR \fIbuffer_size\fR
-Specify the buffer size in kilo bytes for analysis in the cyclic mode.
-Actually, the double of \fIbuffer_size\fR kilo bytes will be allocated in memory.
-In the cyclic mode, the number of cycles is represented as:
-
-    num_of_cycles = system_memory / (\fIbuffer_size\fR * 1024 * bit_per_bytes * page_size )
-
-The lesser number of cycles, the faster working speed is expected.
-Default \fIbuffer_size\fR is 1024.
-
-.br
-.B Example:
-.br
-# makedumpfile \-\-cyclic\-buffer 1024 \-d 31 \-x vmlinux /proc/vmcore dumpfile
-
-.TP
 \fB\-\-non\-cyclic\fR
 Running in the non-cyclic mode, this mode uses the old filtering logic same as v1.4.4 or before.
 If you feel the cyclic mode is too slow, please try this mode.
diff --git a/makedumpfile.c b/makedumpfile.c
index f784400..ac05a87 100644
--- a/makedumpfile.c
+++ b/makedumpfile.c
@@ -2715,27 +2715,8 @@ out:
 		return FALSE;
 
 	if (info->flag_cyclic) {
-		/*
-		 * buffer size is specified as Kbyte
-		 */
-		if (info->bufsize_cyclic == 0) {
-			if (!calculate_cyclic_buffer_size())
-				return FALSE;
-		} else
-			info->bufsize_cyclic <<= 10;
-
-		/*
-		 * Max buffer size is 100 MB
-		 */
-		if (info->bufsize_cyclic > (100 << 20)) {
-			MSG("Specified buffer size is too large, ");
-			MSG("The buffer size for the cyclic mode will be truncated to 100 MB.\n");
-			info->bufsize_cyclic = (100 << 20);
-		}
-		info->pfn_cyclic = info->bufsize_cyclic * BITPERBYTE;
-
-		DEBUG_MSG("\n");
-		DEBUG_MSG("Buffer size for the cyclic mode: %ld\n", info->bufsize_cyclic);
+		if (!calculate_cyclic_buffer_size())
+			return FALSE;
 	}
 
 	if (debug_info) {
@@ -8026,6 +8007,10 @@ calculate_cyclic_buffer_size(void) {
 	needed_size = (info->max_mapnr * 2) / BITPERBYTE;
 
 	info->bufsize_cyclic = (free_size <= needed_size) ? free_size : needed_size;
+	info->pfn_cyclic = info->bufsize_cyclic * BITPERBYTE;
+
+	DEBUG_MSG("\n");
+	DEBUG_MSG("Buffer size for the cyclic mode: %ld\n", info->bufsize_cyclic);
 
 	return TRUE;
 }
@@ -8043,7 +8028,6 @@ static struct option longopts[] = {
 	{"help", no_argument, NULL, 'h'},
 	{"diskset", required_argument, NULL, 'k'},
 	{"non-cyclic", no_argument, NULL, 'Y'},
-	{"cyclic-buffer", required_argument, NULL, 'Z'},
 	{0, 0, 0, 0}
 };
 
@@ -8167,9 +8151,6 @@ main(int argc, char *argv[])
 			info->flag_read_vmcoreinfo = 1;
 			info->name_vmcoreinfo = optarg;
 			break;
-		case 'Z':
-			info->bufsize_cyclic = atoi(optarg);
-			break;
 		case '?':
 			MSG("Commandline parameter is invalid.\n");
 			MSG("Try `makedumpfile --help' for more information.\n");
diff --git a/print_info.c b/print_info.c
index f3ee43a..ac96448 100644
--- a/print_info.c
+++ b/print_info.c
@@ -168,17 +168,6 @@ print_usage(void)
 	MSG("      Reassemble multiple DUMPFILEs, which are created by --split option,\n");
 	MSG("      into one DUMPFILE. dumpfile1 and dumpfile2 are reassembled into dumpfile.\n");
 	MSG("\n");
-	MSG("  [--cyclic-buffer BUFFER_SIZE]:\n");
-	MSG("      Specify the buffer size in kilo bytes for analysis in the cyclic mode.\n");
-	MSG("      Actually, the double of BUFFER_SIZE kilo bytes will be allocated in memory.\n");
-	MSG("      In the cyclic mode, the number of cycles is represented as:\n");
-	MSG("\n");
-	MSG("          num_of_cycles = system_memory / \n");
-	MSG("                          (BUFFER_SIZE * 1024 * bit_per_bytes * page_size)\n");
-	MSG("\n");
-	MSG("      The lesser number of cycles, the faster working speed is expected.\n");
-	MSG("      Default BUFFER_SIZE is 1024.\n");
-	MSG("\n");
 	MSG("  [--non-cyclic]:\n");
 	MSG("      Running in the non-cyclic mode, this mode uses the old filtering logic\n");
 	MSG("      same as v1.4.4 or before.\n");
-- 
1.7.11



[Index of Archives]     [LM Sensors]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [Kernel]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux