什么"文件系统输出"用时间表示-v?

时间:2017-02-09 01:53:45

标签: linux

什么是文件系统输出'使用Linux' time'用dd命令?

它并不等于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

1 个答案:

答案 0 :(得分:4)

命令time正在打印rusage结构中的值(请参阅getrusage(2))。

根据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