我从Mac OS X Terminal运行git。在长时间运行的“ git push”过程中,我不小心按下了ctrl-t,出现了一些“ load”信息。我想这是有关进程运行的某种信息,但是我找不到有关它的文档。
这些信息是什么意思?
示例运行:
danbj$ git push
Counting objects: 5, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (4/4), done.
Writing objects: 100% (5/5), 503 bytes | 0 bytes/s, done.
Total 5 (delta 2), reused 0 (delta 0)
remote: Resolving deltas: 100% (2/2), completed with 2 local objects.
**load: 1.94 cmd: ssh 30002 waiting 0.01u 0.01s**
load: 2.11 cmd: ssh 30002 waiting 0.01u 0.01s
load: 2.11 cmd: ssh 30002 waiting 0.01u 0.01s
load: 2.10 cmd: ssh 30002 waiting 0.01u 0.01s
load: 2.10 cmd: ssh 30002 waiting 0.01u 0.01s
load: 2.09 cmd: ssh 30002 waiting 0.01u 0.01s
load: 2.09 cmd: ssh 30002 waiting 0.01u 0.01s
load: 2.08 cmd: ssh 30002 waiting 0.01u 0.01s
Run Code Online (Sandbox Code Playgroud)
MacOS上的Control-T来自BSD。这是设置中的status字符stty:
$ stty -a
[snip]
cchars: discard = ^O; dsusp = ^Y; eof = ^D; eol = <undef>;
eol2 = <undef>; erase = ^H; intr = ^C; kill = ^X; lnext = ^V;
min = 1; quit = ^\; reprint = ^R; start = ^Q; status = ^T;
stop = ^S; susp = ^Z; time = 0; werase = ^W;
Run Code Online (Sandbox Code Playgroud)
并记录在termios(4)中:
Run Code Online (Sandbox Code Playgroud)STATUS Special character on input and is recognized if the ICANON flag is set. Receipt of this character causes a SIGINFO signal to be sent to the foreground process group of the terminal. Also, if the NOKERNINFO flag is not set, it causes the kernel to write a status message to the terminal that displays the current load average, the name of the command in the foreground, its process ID, the symbolic wait channel, the number of user and system sec- onds used, the percentage of cpu the process is getting, and the resident set size of the process.
这种状态打印以及状态字符本身的存在,是由我本人和Rehmi Post编写的代码衍生而来的(来自其他人的输入; Fred Blonder很有可能参与其中,当然还有我们所拥有的研究生)来自斯坦福大学和麻省理工学院)早在1980年代中后期我在马里兰大学时。的SIGINFO信号和NOKERNINFO控制标志是后来添加,在20世纪90年代(或者甚至一个位以后)。
(据我所知,ITS,TOPS-10,TOPS-20和/或TENEX / TWENEX都具有类似的东西。我本人从未使用过这些东西,但这就是这个主意。)