2017-02-09 1 views
2

ddでLinuxの 'time'コマンドを使用しているときに、「ファイルシステム出力」のカウントとは何ですか?"ファイルシステムの出力"とは時間-vの意味は何ですか?

dd 'count'(おそらくfwriteへの呼び出し回数)と4096バイトページ(この例では1024000)の出力サイズとは等しくありません。

例:

> /usr/bin/time -v dd if=/dev/zero of=/tmp/dd.test bs=4M count=1000 
1000+0 records in 
1000+0 records out 
4194304000 bytes (4.2 GB) copied, 4.94305 s, 849 MB/s 
Command being timed: "dd if=/dev/zero of=/tmp/dd.test bs=4M count=1000" 
User time (seconds): 0.00 
System time (seconds): 4.72 
Percent of CPU this job got: 95% 
Elapsed (wall clock) time (h:mm:ss or m:ss): 0:04.94 
Average shared text size (kbytes): 0 
Average unshared data size (kbytes): 0 
Average stack size (kbytes): 0 
Average total size (kbytes): 0 
Maximum resident set size (kbytes): 5040 
Average resident set size (kbytes): 0 
Major (requiring I/O) page faults: 0 
Minor (reclaiming a frame) page faults: 1322 
Voluntary context switches: 32 
Involuntary context switches: 15 
Swaps: 0 
File system inputs: 240 
File system outputs: 8192000 
Socket messages sent: 0 
Socket messages received: 0 
Signals delivered: 0 
Page size (bytes): 4096 
Exit status: 0 

答えて

3

コマンドtimeは(getrusage(2)参照)rusage構造体から値をプリントアウトされます。

そして記載the source

/* 
* We approximate number of blocks, because we account bytes only. 
* A 'block' is 512 bytes 
*/ 
static inline unsigned long task_io_get_oublock(const struct task_struct *p) 
{ 
    return p->ioac.write_bytes >> 9; 
} 

だから "ファイルシステム出力"(少なくともLinuxの)出力timeである/512書き込まれたバイトの総数。

+0

偉大な答え。私は、なぜ 'ブロック'がページサイズではなく512バイトであるのか、なぜ 'rusage'にバイト数がないのかを理解することはできません。 Linuxの謎... – freddofrog

関連する問題