文章还介绍了一些新的跟踪结构,我将在源代码插装的上下文中阐明它们的操作和它们的插装模式。
It also introduces some new tracing constructs that I'll detail in the context of source code instrumentation to clarify their actions and their implementation patterns.
源代码插装:最基本的技巧是在源代码阶段添加插装,这样编译和部署后的类就已经在运行时包含了插装。
Source code instrumentation: the most basic technique is to add instrumentation at the source code phase so that the compiled and deployed classes already contain the instrumentation at run time.
并针对上述问题,提出了预编译与运行时编译结合的代码生成方式、动态代码插装、源断点标识技术等解决方案。
Dynamic code instrumentation, combined with hybrid code generation and source breakpoint identification, provides a well-suited solution to those problems.
这个流程有时极为有效,因为插装是完全经过编译的字节码,并且代码的执行路径以最细化的方式扩展,同时仍然能够收集数据。
This process can be highly efficient because the instrumentation is fully compiled bytecode, and the code's execution path is extended in about as small a way possible while still collecting data.
相反,插装应用程序代码本身会直接修改和影响核心代码的执行。
In contrast, instrumenting the application code itself directly modifies and affects the core code's execution.
本节将讨论如何实现源代码级插装,并将提供一些最佳实践和示例代码。
This section addresses the subject of implementing source level instrumentation and provides some best practices and example source code.
在本文的第1部分中,我只讨论基于源代码的插装;您将在第2部分中了解更多关于截取、字节码插装和类包装的信息。
Here in Part 1, I address only source code based instrumentation; you'll read more about interception, bytecode instrumentation, and class wrapping in Part 2.
类包装背后的理念是:目标类可以包装在一层插装代码中,后者具有与被包装的类相同的外部行为。
The idea behind class wrapping is that a target class can be wrapped in a layer of instrumenting code that retains the same external behavior as the class that's wrapped.
重新插装步骤会将已经覆盖过的插装从代码中去掉,只留下在开始的测试中没有执行的插装。
This reinstrumentation step removes the instrumentation from code that's already been covered, only leaving it in place for code that wasn't executed by the initial tests.
首先使用Gretel插装代码,接着用Gretel插装(instrumentation)运行一个或多个测试,将执行数据保存到文件中,然后再次使用Gretel来查看所保存的数据。
You start by using Gretel to instrument your code, next running one or more tests with the Gretel instrumentation saving execution data to files, then using Gretel again to view the saved data.
提供有效插装应用程序源代码的方法。
Offers techniques for efficiently instrumenting application source code.
运行环境支持对程序插装保护代码,执行保护策略。
The running environment supports protecting code instrumentation to execute protection strategies.
运行环境支持对程序插装保护代码,执行保护策略。
The running environment supports protecting code instrumentation to execute protection strategies.
应用推荐