术语“仪器化”是什么意思?
正如标题所示。很多解释确实很模糊,谁能提供更可靠的定义?
该术语在 Android 测试中被大量使用,但我认为它不仅限于该平台。
As the title suggests. Many explanations are really vague, can anyone provide a more solid definition?
The term is used a lot in Android testing, but I don't think it's restricted to that platform.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
一些性能测量工具向代码中添加了检测。例如,它们可以进行二进制翻译,并添加指令以在函数的开头和结尾处读取计时器。或者,可以通过自动化工具或程序员将这种仪器、计时器的读取添加到汇编或C代码中。
其他性能测量工具不会更改正在测量的代码。例如,UNIX prof 采样运行在定时器中断处调用的特殊代码,该代码生成接收中断的指令的直方图。
有些工具是混合的:例如,UNIX gprof 将 prof 风格的中断采样与编译器 -pg 选项添加的 mcount 检测相结合,以计算哪些函数相互调用。
所有性能测量都有开销,但仪器往往比基于中断的采样具有更多开销。另一方面,仪器仪表可以测量更多的东西。
Some performance measurement tools add instrumentation to the code. E.g. they may binary translate, and add instructions to read the timers at the beginning and end of functions. Or this instrumentation, this reading of the timers, may be added to assembly, or C code, by an automated tool, or a programmer.
Other performance measurement tools do not change the code that is being measured. E.g. UNIX prof sampling runs special code that is invoked at the timer interrupt, which generates a histogram of the instruction at which the interrupt is received.
Some tools are hybrid: e.g. UNIX gprof combines prof-style interrupt sampling with mcount instrumentation added by the compiler -pg option to count which functions call each other.
All performance measurement has overhead, but instrumentation tends to have more overhead than interrupt based sampling. On the other hand, instrumentation can measure more stuff.
好吧,我访问了此链接,它说:
快乐编码
Well, I visited this link and it said:
Happy coding
根据 Oracle:
According to Oracle:
Instrumentation 通常用于动态代码分析。
它与日志记录不同,因为检测通常由软件自动完成,而日志记录需要人类智能来插入日志记录代码。
来源
Instrumentation is usually used in dynamic code analysis.
It differs from logging as instrumentation is usually done automatically by software, while logging needs human intelligence to insert the logging code.
Source