[Dle-discus] [PATCH 2/2] crash連携機能パッチレビューのお願い

Back to archive index

Satoru MORIYA sator****@hitac*****
2007年 10月 11日 (木) 18:53:28 JST


平松さま

守屋@日立です。
レビューありがとうございます。

>>+static void print_rchan_info(size_t start, size_t end, size_t ready,
>>+			     size_t offset, char *postfix, int cpu)
>
>
> postfixには".may_broken"しか入らないし、そもそも
> ・グローバルかローカル(per-cpu)か
> ・書き込み済みのバッファ全部か、書き込み途中のバッファか
> という作り分けをしているだけなので、postfixとして渡すよりは、is_brokenと
> いうフラグで渡すだけでもいいのではないでしょうか。

is_brokenフラグを利用して簡潔になるよう修正します。

>>+	if (postfix) {
>>+		fprintf(fp, "  read subbuf %ld(%ld) (offset:%ld-%ld)\n",
>>+			(long)end_subbuf - chan.n_subbufs,
>>+			(long)(end_subbuf % chan.n_subbufs),
>>+			(long)offset,
>>+			(long)chan.subbuf_size);
>>+
>
>
> ここの空行はあまり意味が無いのではないでしょうか。

削除いたします。

>>@@ -271,7 +333,6 @@ static void output_cpu_logs(char *dirnam
>> 		error(FATAL, "cannot allocate memory\n");
>> 	}
>>
>>-	fname[max] = '\0';
>> 	for (i = 0; i < kt->cpus; i++) {
>> 		pcd = &per_cpu[i];
>>
>>@@ -298,28 +359,12 @@ static void output_cpu_logs(char *dirnam
>> 			start = 0;
>> 			end = ready;
>> 		}
>>-		/* print information */
>>-		if (is_global == 1) {
>>-			fprintf(fp, "--- generating 'global' ---\n");
>>-		} else {
>>-			fprintf(fp, "--- generating 'cpu%d' ---\n", i);
>>-		}
>>-		fprintf(fp, "  subbufs ready on relayfs:%ld\n", (long)ready);
>>-		fprintf(fp, "  n_subbufs:%ld, read from:%ld to:%ld (offset:%ld)\n\n",
>>-			(long)chan.n_subbufs, (long)(start ? start - chan.n_subbufs : start),
>>-			(long)(start ? end - 1 - chan.n_subbufs : end - 1), (long)pcd->buf.offset);
>>+
>>+		print_rchan_info(start, end, ready, pcd->buf.offset, NULL, i);
>>
>> 		create_output_dir(dirname);
>>+		outfp = open_output_file(dirname, NULL, i);
>
>
> ここともう一ヶ所のロジックを変更して、
> 1.ディレクトリとファイル名の決定(open_output_fileで、実際のファイル名を返す)
> 2.ファイル名をprint_rchan_infoに渡して表示
> 3.実際にファイルに書き出す
> という形にしたらどうでしょうか。そうしたら、何度も"global"とか"may_break"を
> 書く必要がなくなります。

了解です。
アドバイスに基づき修正を行なってみます。
-- 
---
Satoru MORIYA
Linux Technology Center
Hitachi, Ltd., Systems Development Laboratory
E-mail: sator****@hitac*****




Dle-discus メーリングリストの案内
Back to archive index