gpt4 book ai didi

linux - time -v 的 "file system outputs"是什么意思?

转载 作者:IT王子 更新时间:2023-10-29 01:07:35 24 4
gpt4 key购买 nike

将 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

最佳答案

命令 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

关于linux - time -v 的 "file system outputs"是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42126913/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com