|
Class: InstrumentationContext
Object
|
+--InstrumentationContext
- Package:
- stx:libcomp
- Category:
- System-Compiler-Instrumentation
- Version:
- rev:
1.18
date: 2017/07/12 14:13:05
- user: mawalch
- file: InstrumentationContext.st directory: libcomp
- module: stx stc-classLibrary: libcomp
installed as a thread-local variable (instrumentationContext) by the
beActiveIn:aProcess method, instances of me keep some meta state while
instrumentation is ongoing.
Especially, instrumentationInfo objects are only updated in processes with a context.
This has two advantages:
- it blocks recursive calls, while inside instrumentation code
- it blocks measurements from other processes
(so code coverage is only measured when executed during a test run, not if
executed by other processes)
the main entries are run: and runForCoverage:
the code must have been recompiled with instrumentation before
(see InstrumentingCompiler - class protocol)
instance access
-
current
-
the current context for this running thread.
walks along the parent-process chain, up to a possible global context
usage example(s):
InstrumentationContext current
|
-
forProcess: aProcess
-
the context for this thread.
walks along the parent-process chain, up to a possible global context
instance creation
-
new
-
return an initialized instance
queries
-
hasGlobalInstrumentationContext
-
InstrumentationContext hasGlobalInstrumentationContext
running
-
run: aBlock
-
run aBlock with instrumentation enabled
usage example(s):
Smalltalk loadPackage:'stx/goodies:regression'.
BTree withAllPrivateClasses
do:[:cls | cls recompileUsingCompilerClass:InstrumentingCompiler].
InstrumentationContext
run:[ RegressionTests::BinaryTreeTester suite run ].
(Tools::NewSystemBrowser open)
switchToClass:BTree;
showCoverageInformation value:true
|
-
runForCoverage: aBlock
-
run aBlock with instrumentation enabled, but only for coverage (i.e. not counting)
utilities
-
flushAllPerProcessInstrumentationContexts
-
self flushAllPerProcessInstrumentationContexts
-
globalInstrumentationContext
-
-
setGlobalInstrumentationContext: aContextOrNil
-
setup for global instrumentation: instrumentation is performed for all processes
-
setInstrumentationContext: aContextOrNil in: aProcess
-
setup for process specific instrumentation:
instrumentation is aProcess
accessing
-
coverageOnly
-
if on, only keep track of coverage (not counting);
if off, we also count how often the code has been entered,
and by which sender
-
coverageOnly: aBoolean
-
if on, only keep track of coverage (not counting);
if off, we also count how often the code has been entered
-
enabled
-
-
enabled: aBoolean
-
Modified (format): / 08-08-2011 / 14:47:12 / cg
-
inInstrumentedCode
-
-
inInstrumentedCode: aBoolean
-
Modified (format): / 08-08-2011 / 19:43:19 / cg
initialization
-
initialize
-
Invoked when a new instance is created.
usage example(s):
super initialize. -- commented since inherited method does nothing
|
installing
-
beActiveEverywhere
-
become the current instrumentaion context for all processes.
usage example(s):
InstrumentationContext new beActiveEverywhere
|
-
beActiveIn: aProcess
-
become the current instrumentaion context for a process.
usage example(s):
InstrumentationContext new beActiveIn:(Processor activeProcess)
|
queries
-
enabledAndNotInInstrumentedCode
-
running
-
run: aBlock
-
run aBlock with instrumentation enabled
-
runForCoverage: aBlock
-
run aBlock with instrumentation enabled;
but only for coverage (i.e. not counting)
|