mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-08 19:04:45 +00:00
Bug 1332466 - Update VTune integration. r=sfink
This commit is contained in:
parent
19c60a97a2
commit
4e8843518e
@ -145,8 +145,11 @@ add_old_configure_assignment('MOZ_PROFILING', profiling)
|
||||
|
||||
@depends(profiling, target)
|
||||
def imply_vtune(value, target):
|
||||
if value and (target.kernel == 'WINNT' or (target.kernel == 'Linux' and
|
||||
target.os == 'GNU')):
|
||||
ok_cpu = target.cpu in ['x86', 'x86_64']
|
||||
ok_kernel = target.kernel == 'WINNT' or \
|
||||
(target.kernel == 'Linux' and target.os == 'GNU')
|
||||
|
||||
if value and ok_cpu and ok_kernel:
|
||||
return True
|
||||
|
||||
set_config('MOZ_PROFILING', profiling)
|
||||
@ -154,7 +157,7 @@ set_define('MOZ_PROFILING', profiling)
|
||||
imply_option('--enable-vtune', imply_vtune, reason='--enable-profiling')
|
||||
|
||||
|
||||
js_option('--enable-vtune', env='MOZ_VTUNE', help='Enable vtune profiling')
|
||||
js_option('--enable-vtune', env='MOZ_VTUNE', help='Enable VTune profiling')
|
||||
|
||||
@depends('--enable-vtune')
|
||||
def vtune(value):
|
||||
|
@ -222,6 +222,10 @@ var ignoreFunctions = {
|
||||
"EntryType* nsTHashtable<EntryType>::PutEntry(nsTHashtable<EntryType>::KeyType) [with EntryType = nsBaseHashtableET<nsPtrHashKey<const mozilla::BlockingResourceBase>, nsAutoPtr<mozilla::DeadlockDetector<mozilla::BlockingResourceBase>::OrderingEntry> >; nsTHashtable<EntryType>::KeyType = const mozilla::BlockingResourceBase*]" : true,
|
||||
"EntryType* nsTHashtable<EntryType>::GetEntry(nsTHashtable<EntryType>::KeyType) const [with EntryType = nsBaseHashtableET<nsPtrHashKey<const mozilla::BlockingResourceBase>, nsAutoPtr<mozilla::DeadlockDetector<mozilla::BlockingResourceBase>::OrderingEntry> >; nsTHashtable<EntryType>::KeyType = const mozilla::BlockingResourceBase*]" : true,
|
||||
|
||||
// VTune internals that lazy-load a shared library and make IndirectCalls.
|
||||
"iJIT_IsProfilingActive" : true,
|
||||
"iJIT_NotifyEvent": true,
|
||||
|
||||
// The big hammers.
|
||||
"PR_GetCurrentThread" : true,
|
||||
"calloc" : true,
|
||||
|
@ -36,6 +36,9 @@
|
||||
# include "jit/PerfSpewer.h"
|
||||
#endif
|
||||
#include "vm/MatchPairs.h"
|
||||
#ifdef MOZ_VTUNE
|
||||
# include "vtune/VTuneWrapper.h"
|
||||
#endif
|
||||
|
||||
#include "jit/MacroAssembler-inl.h"
|
||||
|
||||
@ -499,6 +502,10 @@ NativeRegExpMacroAssembler::GenerateCode(JSContext* cx, bool match_only)
|
||||
writePerfSpewerJitCodeProfile(code, "RegExp");
|
||||
#endif
|
||||
|
||||
#ifdef MOZ_VTUNE
|
||||
vtune::MarkRegExp(code, match_only);
|
||||
#endif
|
||||
|
||||
for (size_t i = 0; i < labelPatches.length(); i++) {
|
||||
LabelPatch& v = labelPatches[i];
|
||||
MOZ_ASSERT(!v.label);
|
||||
|
@ -35,6 +35,9 @@
|
||||
#include "jit/MacroAssembler-inl.h"
|
||||
#include "vm/Interpreter-inl.h"
|
||||
#include "vm/NativeObject-inl.h"
|
||||
#ifdef MOZ_VTUNE
|
||||
# include "vtune/VTuneWrapper.h"
|
||||
#endif
|
||||
|
||||
using namespace js;
|
||||
using namespace js::jit;
|
||||
@ -225,10 +228,6 @@ BaselineCompiler::compile()
|
||||
(void*) baselineScript.get(), (void*) code->raw(),
|
||||
script->filename(), script->lineno());
|
||||
|
||||
#ifdef JS_ION_PERF
|
||||
writePerfSpewerBaselineProfile(script, code);
|
||||
#endif
|
||||
|
||||
MOZ_ASSERT(pcMappingIndexEntries.length() > 0);
|
||||
baselineScript->copyPCMappingIndexEntries(&pcMappingIndexEntries[0]);
|
||||
|
||||
@ -307,6 +306,14 @@ BaselineCompiler::compile()
|
||||
|
||||
script->setBaselineScript(cx->runtime(), baselineScript.release());
|
||||
|
||||
#ifdef JS_ION_PERF
|
||||
writePerfSpewerBaselineProfile(script, code);
|
||||
#endif
|
||||
|
||||
#ifdef MOZ_VTUNE
|
||||
vtune::MarkScript(code, script, "baseline");
|
||||
#endif
|
||||
|
||||
return Method_Compiled;
|
||||
}
|
||||
|
||||
|
@ -53,6 +53,9 @@
|
||||
#include "jit/shared/CodeGenerator-shared-inl.h"
|
||||
#include "jit/shared/Lowering-shared-inl.h"
|
||||
#include "vm/Interpreter-inl.h"
|
||||
#ifdef MOZ_VTUNE
|
||||
# include "vtune/VTuneWrapper.h"
|
||||
#endif
|
||||
|
||||
using namespace js;
|
||||
using namespace js::jit;
|
||||
@ -1811,6 +1814,9 @@ JitCompartment::generateRegExpMatcherStub(JSContext* cx)
|
||||
#ifdef JS_ION_PERF
|
||||
writePerfSpewerJitCodeProfile(code, "RegExpMatcherStub");
|
||||
#endif
|
||||
#ifdef MOZ_VTUNE
|
||||
vtune::MarkStub(code, "RegExpMatcherStub");
|
||||
#endif
|
||||
|
||||
if (cx->zone()->needsIncrementalBarrier())
|
||||
code->togglePreBarriers(true, DontReprotect);
|
||||
@ -1968,6 +1974,9 @@ JitCompartment::generateRegExpSearcherStub(JSContext* cx)
|
||||
#ifdef JS_ION_PERF
|
||||
writePerfSpewerJitCodeProfile(code, "RegExpSearcherStub");
|
||||
#endif
|
||||
#ifdef MOZ_VTUNE
|
||||
vtune::MarkStub(code, "RegExpSearcherStub");
|
||||
#endif
|
||||
|
||||
if (cx->zone()->needsIncrementalBarrier())
|
||||
code->togglePreBarriers(true, DontReprotect);
|
||||
@ -2116,6 +2125,9 @@ JitCompartment::generateRegExpTesterStub(JSContext* cx)
|
||||
#ifdef JS_ION_PERF
|
||||
writePerfSpewerJitCodeProfile(code, "RegExpTesterStub");
|
||||
#endif
|
||||
#ifdef MOZ_VTUNE
|
||||
vtune::MarkStub(code, "RegExpTesterStub");
|
||||
#endif
|
||||
|
||||
if (cx->zone()->needsIncrementalBarrier())
|
||||
code->togglePreBarriers(true, DontReprotect);
|
||||
@ -7721,6 +7733,9 @@ JitCompartment::generateStringConcatStub(JSContext* cx)
|
||||
#ifdef JS_ION_PERF
|
||||
writePerfSpewerJitCodeProfile(code, "StringConcatStub");
|
||||
#endif
|
||||
#ifdef MOZ_VTUNE
|
||||
vtune::MarkStub(code, "StringConcatStub");
|
||||
#endif
|
||||
|
||||
return code;
|
||||
}
|
||||
@ -7762,6 +7777,9 @@ JitRuntime::generateMallocStub(JSContext* cx)
|
||||
#ifdef JS_ION_PERF
|
||||
writePerfSpewerJitCodeProfile(code, "MallocStub");
|
||||
#endif
|
||||
#ifdef MOZ_VTUNE
|
||||
vtune::MarkStub(code, "MallocStub");
|
||||
#endif
|
||||
|
||||
return code;
|
||||
}
|
||||
@ -7798,6 +7816,9 @@ JitRuntime::generateFreeStub(JSContext* cx)
|
||||
#ifdef JS_ION_PERF
|
||||
writePerfSpewerJitCodeProfile(code, "FreeStub");
|
||||
#endif
|
||||
#ifdef MOZ_VTUNE
|
||||
vtune::MarkStub(code, "FreeStub");
|
||||
#endif
|
||||
|
||||
return code;
|
||||
}
|
||||
@ -7836,6 +7857,9 @@ JitRuntime::generateLazyLinkStub(JSContext* cx)
|
||||
|
||||
#ifdef JS_ION_PERF
|
||||
writePerfSpewerJitCodeProfile(code, "LazyLinkStub");
|
||||
#endif
|
||||
#ifdef MOZ_VTUNE
|
||||
vtune::MarkStub(code, "LazyLinkStub");
|
||||
#endif
|
||||
return code;
|
||||
}
|
||||
@ -9905,6 +9929,10 @@ CodeGenerator::link(JSContext* cx, CompilerConstraintList* constraints)
|
||||
perfSpewer_.writeProfile(script, code, masm);
|
||||
#endif
|
||||
|
||||
#ifdef MOZ_VTUNE
|
||||
vtune::MarkScript(code, script, "ion");
|
||||
#endif
|
||||
|
||||
// for marking during GC.
|
||||
if (safepointIndices_.length())
|
||||
ionScript->copySafepointIndices(&safepointIndices_[0], masm);
|
||||
|
@ -51,6 +51,9 @@
|
||||
#include "vm/Debugger.h"
|
||||
#include "vm/HelperThreads.h"
|
||||
#include "vm/TraceLogging.h"
|
||||
#ifdef MOZ_VTUNE
|
||||
# include "vtune/VTuneWrapper.h"
|
||||
#endif
|
||||
|
||||
#include "jscompartmentinlines.h"
|
||||
#include "jsobjinlines.h"
|
||||
@ -810,6 +813,10 @@ JitCode::finalize(FreeOp* fop)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef MOZ_VTUNE
|
||||
vtune::UnmarkCode(this);
|
||||
#endif
|
||||
|
||||
MOZ_ASSERT(pool_);
|
||||
|
||||
// With W^X JIT code, reprotecting memory for each JitCode instance is
|
||||
@ -828,6 +835,7 @@ JitCode::finalize(FreeOp* fop)
|
||||
// memory instead.
|
||||
if (!PerfEnabled())
|
||||
pool_->release(headerSize_ + bufferSize_, CodeKind(kind_));
|
||||
|
||||
pool_ = nullptr;
|
||||
}
|
||||
|
||||
|
@ -13,6 +13,9 @@
|
||||
#endif
|
||||
#include "jit/VMFunctions.h"
|
||||
#include "jit/x64/SharedICHelpers-x64.h"
|
||||
#ifdef MOZ_VTUNE
|
||||
# include "vtune/VTuneWrapper.h"
|
||||
#endif
|
||||
|
||||
#include "jit/MacroAssembler-inl.h"
|
||||
|
||||
@ -340,6 +343,9 @@ JitRuntime::generateEnterJIT(JSContext* cx, EnterJitType type)
|
||||
#ifdef JS_ION_PERF
|
||||
writePerfSpewerJitCodeProfile(code, "EnterJIT");
|
||||
#endif
|
||||
#ifdef MOZ_VTUNE
|
||||
vtune::MarkStub(code, "EnterJIT");
|
||||
#endif
|
||||
|
||||
return code;
|
||||
}
|
||||
@ -389,6 +395,9 @@ JitRuntime::generateInvalidator(JSContext* cx)
|
||||
#ifdef JS_ION_PERF
|
||||
writePerfSpewerJitCodeProfile(code, "Invalidator");
|
||||
#endif
|
||||
#ifdef MOZ_VTUNE
|
||||
vtune::MarkStub(code, "Invalidator");
|
||||
#endif
|
||||
|
||||
return code;
|
||||
}
|
||||
@ -548,6 +557,9 @@ JitRuntime::generateArgumentsRectifier(JSContext* cx, void** returnAddrOut)
|
||||
#ifdef JS_ION_PERF
|
||||
writePerfSpewerJitCodeProfile(code, "ArgumentsRectifier");
|
||||
#endif
|
||||
#ifdef MOZ_VTUNE
|
||||
vtune::MarkStub(code, "ArgumentsRectifier");
|
||||
#endif
|
||||
|
||||
if (returnAddrOut)
|
||||
*returnAddrOut = (void*)(code->raw() + returnOffset);
|
||||
@ -633,6 +645,9 @@ JitRuntime::generateBailoutHandler(JSContext* cx)
|
||||
#ifdef JS_ION_PERF
|
||||
writePerfSpewerJitCodeProfile(code, "BailoutHandler");
|
||||
#endif
|
||||
#ifdef MOZ_VTUNE
|
||||
vtune::MarkStub(code, "BailoutHandler");
|
||||
#endif
|
||||
|
||||
return code;
|
||||
}
|
||||
@ -818,6 +833,9 @@ JitRuntime::generateVMWrapper(JSContext* cx, const VMFunction& f)
|
||||
#ifdef JS_ION_PERF
|
||||
writePerfSpewerJitCodeProfile(wrapper, "VMWrapper");
|
||||
#endif
|
||||
#ifdef MOZ_VTUNE
|
||||
vtune::MarkStub(wrapper, "VMWrapper");
|
||||
#endif
|
||||
|
||||
// linker.newCode may trigger a GC and sweep functionWrappers_ so we have to
|
||||
// use relookupOrAdd instead of add.
|
||||
@ -854,6 +872,9 @@ JitRuntime::generatePreBarrier(JSContext* cx, MIRType type)
|
||||
#ifdef JS_ION_PERF
|
||||
writePerfSpewerJitCodeProfile(code, "PreBarrier");
|
||||
#endif
|
||||
#ifdef MOZ_VTUNE
|
||||
vtune::MarkStub(code, "PreBarrier");
|
||||
#endif
|
||||
|
||||
return code;
|
||||
}
|
||||
@ -930,6 +951,9 @@ JitRuntime::generateDebugTrapHandler(JSContext* cx)
|
||||
#ifdef JS_ION_PERF
|
||||
writePerfSpewerJitCodeProfile(codeDbg, "DebugTrapHandler");
|
||||
#endif
|
||||
#ifdef MOZ_VTUNE
|
||||
vtune::MarkStub(codeDbg, "DebugTrapHandler");
|
||||
#endif
|
||||
|
||||
return codeDbg;
|
||||
}
|
||||
@ -947,6 +971,9 @@ JitRuntime::generateExceptionTailStub(JSContext* cx, void* handler)
|
||||
#ifdef JS_ION_PERF
|
||||
writePerfSpewerJitCodeProfile(code, "ExceptionTailStub");
|
||||
#endif
|
||||
#ifdef MOZ_VTUNE
|
||||
vtune::MarkStub(code, "ExceptionTailStub");
|
||||
#endif
|
||||
|
||||
return code;
|
||||
}
|
||||
@ -964,6 +991,9 @@ JitRuntime::generateBailoutTailStub(JSContext* cx)
|
||||
#ifdef JS_ION_PERF
|
||||
writePerfSpewerJitCodeProfile(code, "BailoutTailStub");
|
||||
#endif
|
||||
#ifdef MOZ_VTUNE
|
||||
vtune::MarkStub(code, "BailoutTailStub");
|
||||
#endif
|
||||
|
||||
return code;
|
||||
}
|
||||
@ -1298,6 +1328,9 @@ JitRuntime::generateProfilerExitFrameTailStub(JSContext* cx)
|
||||
#ifdef JS_ION_PERF
|
||||
writePerfSpewerJitCodeProfile(code, "ProfilerExitFrameStub");
|
||||
#endif
|
||||
#ifdef MOZ_VTUNE
|
||||
vtune::MarkStub(code, "ProfilerExitFrameStub");
|
||||
#endif
|
||||
|
||||
return code;
|
||||
}
|
||||
|
@ -19,6 +19,9 @@
|
||||
#endif
|
||||
#include "jit/VMFunctions.h"
|
||||
#include "jit/x86/SharedICHelpers-x86.h"
|
||||
#ifdef MOZ_VTUNE
|
||||
# include "vtune/VTuneWrapper.h"
|
||||
#endif
|
||||
|
||||
#include "jsscriptinlines.h"
|
||||
|
||||
@ -385,6 +388,9 @@ JitRuntime::generateInvalidator(JSContext* cx)
|
||||
#ifdef JS_ION_PERF
|
||||
writePerfSpewerJitCodeProfile(code, "Invalidator");
|
||||
#endif
|
||||
#ifdef MOZ_VTUNE
|
||||
vtune::MarkStub(code, "Invalidator");
|
||||
#endif
|
||||
|
||||
return code;
|
||||
}
|
||||
@ -546,6 +552,9 @@ JitRuntime::generateArgumentsRectifier(JSContext* cx, void** returnAddrOut)
|
||||
#ifdef JS_ION_PERF
|
||||
writePerfSpewerJitCodeProfile(code, "ArgumentsRectifier");
|
||||
#endif
|
||||
#ifdef MOZ_VTUNE
|
||||
vtune::MarkStub(code, "ArgumentsRectifier");
|
||||
#endif
|
||||
|
||||
if (returnAddrOut)
|
||||
*returnAddrOut = (void*) (code->raw() + returnOffset);
|
||||
@ -645,7 +654,10 @@ JitRuntime::generateBailoutTable(JSContext* cx, uint32_t frameClass)
|
||||
JitCode* code = linker.newCode<NoGC>(cx, OTHER_CODE);
|
||||
|
||||
#ifdef JS_ION_PERF
|
||||
writePerfSpewerJitCodeProfile(code, "BailoutHandler");
|
||||
writePerfSpewerJitCodeProfile(code, "BailoutTable");
|
||||
#endif
|
||||
#ifdef MOZ_VTUNE
|
||||
vtune::MarkStub(code, "BailoutTable");
|
||||
#endif
|
||||
|
||||
return code;
|
||||
@ -663,6 +675,9 @@ JitRuntime::generateBailoutHandler(JSContext* cx)
|
||||
#ifdef JS_ION_PERF
|
||||
writePerfSpewerJitCodeProfile(code, "BailoutHandler");
|
||||
#endif
|
||||
#ifdef MOZ_VTUNE
|
||||
vtune::MarkStub(code, "BailoutHandler");
|
||||
#endif
|
||||
|
||||
return code;
|
||||
}
|
||||
@ -843,6 +858,9 @@ JitRuntime::generateVMWrapper(JSContext* cx, const VMFunction& f)
|
||||
#ifdef JS_ION_PERF
|
||||
writePerfSpewerJitCodeProfile(wrapper, "VMWrapper");
|
||||
#endif
|
||||
#ifdef MOZ_VTUNE
|
||||
vtune::MarkStub(wrapper, "VMWrapper");
|
||||
#endif
|
||||
|
||||
// linker.newCode may trigger a GC and sweep functionWrappers_ so we have to
|
||||
// use relookupOrAdd instead of add.
|
||||
@ -884,6 +902,9 @@ JitRuntime::generatePreBarrier(JSContext* cx, MIRType type)
|
||||
#ifdef JS_ION_PERF
|
||||
writePerfSpewerJitCodeProfile(code, "PreBarrier");
|
||||
#endif
|
||||
#ifdef MOZ_VTUNE
|
||||
vtune::MarkStub(code, "PreBarrier");
|
||||
#endif
|
||||
|
||||
return code;
|
||||
}
|
||||
@ -960,6 +981,9 @@ JitRuntime::generateDebugTrapHandler(JSContext* cx)
|
||||
#ifdef JS_ION_PERF
|
||||
writePerfSpewerJitCodeProfile(codeDbg, "DebugTrapHandler");
|
||||
#endif
|
||||
#ifdef MOZ_VTUNE
|
||||
vtune::MarkStub(codeDbg, "DebugTrapHandler");
|
||||
#endif
|
||||
|
||||
return codeDbg;
|
||||
}
|
||||
@ -977,6 +1001,9 @@ JitRuntime::generateExceptionTailStub(JSContext* cx, void* handler)
|
||||
#ifdef JS_ION_PERF
|
||||
writePerfSpewerJitCodeProfile(code, "ExceptionTailStub");
|
||||
#endif
|
||||
#ifdef MOZ_VTUNE
|
||||
vtune::MarkStub(code, "ExceptionTailStub");
|
||||
#endif
|
||||
|
||||
return code;
|
||||
}
|
||||
@ -994,6 +1021,9 @@ JitRuntime::generateBailoutTailStub(JSContext* cx)
|
||||
#ifdef JS_ION_PERF
|
||||
writePerfSpewerJitCodeProfile(code, "BailoutTailStub");
|
||||
#endif
|
||||
#ifdef MOZ_VTUNE
|
||||
vtune::MarkStub(code, "BailoutTailStub");
|
||||
#endif
|
||||
|
||||
return code;
|
||||
}
|
||||
@ -1331,6 +1361,9 @@ JitRuntime::generateProfilerExitFrameTailStub(JSContext* cx)
|
||||
#ifdef JS_ION_PERF
|
||||
writePerfSpewerJitCodeProfile(code, "ProfilerExitFrameStub");
|
||||
#endif
|
||||
#ifdef MOZ_VTUNE
|
||||
vtune::MarkStub(code, "ProfilerExitFrameStub");
|
||||
#endif
|
||||
|
||||
return code;
|
||||
}
|
||||
|
@ -51,6 +51,9 @@
|
||||
#include "vm/Shape.h"
|
||||
#include "vm/SharedImmutableStringsCache.h"
|
||||
#include "vm/Xdr.h"
|
||||
#ifdef MOZ_VTUNE
|
||||
# include "vtune/VTuneWrapper.h"
|
||||
#endif
|
||||
|
||||
#include "jsfuninlines.h"
|
||||
#include "jsobjinlines.h"
|
||||
@ -2532,6 +2535,10 @@ JSScript::Create(JSContext* cx, const ReadOnlyCompileOptions& options,
|
||||
script->sourceStart_ = bufStart;
|
||||
script->sourceEnd_ = bufEnd;
|
||||
|
||||
#ifdef MOZ_VTUNE
|
||||
script->vtuneMethodId_ = vtune::GenerateUniqueMethodID();
|
||||
#endif
|
||||
|
||||
return script;
|
||||
}
|
||||
|
||||
|
@ -890,6 +890,14 @@ class JSScript : public js::gc::TenuredCell
|
||||
uint32_t sourceStart_;
|
||||
uint32_t sourceEnd_;
|
||||
|
||||
#ifdef MOZ_VTUNE
|
||||
// Unique Method ID passed to the VTune profiler, or 0 if unset.
|
||||
// Allows attribution of different jitcode to the same source script.
|
||||
uint32_t vtuneMethodId_;
|
||||
// Extra padding to maintain JSScript as a multiple of gc::CellSize.
|
||||
uint32_t __vtune_unused_padding_;
|
||||
#endif
|
||||
|
||||
// Number of times the script has been called or has had backedges taken.
|
||||
// When running in ion, also increased for any inlined scripts. Reset if
|
||||
// the script's JIT code is forcibly discarded.
|
||||
@ -1556,6 +1564,10 @@ class JSScript : public js::gc::TenuredCell
|
||||
const char* filename() const { return scriptSource()->filename(); }
|
||||
const char* maybeForwardedFilename() const { return maybeForwardedScriptSource()->filename(); }
|
||||
|
||||
#ifdef MOZ_VTUNE
|
||||
uint32_t vtuneMethodID() const { return vtuneMethodId_; }
|
||||
#endif
|
||||
|
||||
public:
|
||||
|
||||
/* Return whether this script was compiled for 'eval' */
|
||||
|
@ -616,7 +616,9 @@ if CONFIG['JS_HAS_CTYPES']:
|
||||
|
||||
if CONFIG['MOZ_VTUNE']:
|
||||
SOURCES += [
|
||||
'vtune/jitprofiling.c'
|
||||
'vtune/ittnotify_static.c',
|
||||
'vtune/jitprofiling.c',
|
||||
'vtune/VTuneWrapper.cpp',
|
||||
]
|
||||
|
||||
if CONFIG['HAVE_LINUX_PERF_EVENT_H']:
|
||||
|
@ -1,10 +1,11 @@
|
||||
VTune files imported from VTune Amplifier XE 2013 Rev 11.
|
||||
VTune files imported from VTune Amplifier XE 2017 Rev 1.0.486011.
|
||||
|
||||
To update these files, copy the following from a VTune install directory:
|
||||
sdk/src/ittnotify/ittnotify_config.h
|
||||
sdk/src/ittnotify/ittnotify_types.h
|
||||
sdk/src/ittnotify/jitprofiling.c
|
||||
sdk/src/ittnotify/*
|
||||
|
||||
include/ittnotify.h
|
||||
include/jitprofiling.h
|
||||
include/legacy/ittnotify.h
|
||||
|
||||
If the license has changed, update the "VTune License" section of
|
||||
toolkit/content/license.html
|
||||
|
149
js/src/vtune/VTuneWrapper.cpp
Normal file
149
js/src/vtune/VTuneWrapper.cpp
Normal file
@ -0,0 +1,149 @@
|
||||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||
* vim: set ts=8 sts=4 et sw=4 tw=99:
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "vtune/VTuneWrapper.h"
|
||||
|
||||
#include "mozilla/Sprintf.h"
|
||||
|
||||
#include "jscntxt.h"
|
||||
#include "jscompartment.h"
|
||||
#include "jsgc.h"
|
||||
|
||||
#include "vm/Shape.h"
|
||||
#include "wasm/WasmCode.h"
|
||||
|
||||
#ifdef MOZ_VTUNE
|
||||
|
||||
namespace js {
|
||||
namespace vtune {
|
||||
|
||||
uint32_t
|
||||
GenerateUniqueMethodID()
|
||||
{
|
||||
return (uint32_t)iJIT_GetNewMethodID();
|
||||
}
|
||||
|
||||
|
||||
// Stubs and trampolines are created on engine initialization and are never unloaded.
|
||||
void
|
||||
MarkStub(const js::jit::JitCode* code, const char* name)
|
||||
{
|
||||
if (!IsProfilingActive())
|
||||
return;
|
||||
|
||||
iJIT_Method_Load_V2 method = {0};
|
||||
method.method_id = GenerateUniqueMethodID();
|
||||
method.method_name = const_cast<char*>(name);
|
||||
method.method_load_address = code->raw();
|
||||
method.method_size = code->instructionsSize();
|
||||
method.module_name = const_cast<char*>("jitstubs");
|
||||
|
||||
iJIT_NotifyEvent(iJVM_EVENT_TYPE_METHOD_LOAD_FINISHED_V2, (void*)&method);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
MarkRegExp(const js::jit::JitCode* code, bool match_only)
|
||||
{
|
||||
if (!IsProfilingActive())
|
||||
return;
|
||||
|
||||
iJIT_Method_Load_V2 method = {0};
|
||||
method.method_id = GenerateUniqueMethodID();
|
||||
method.method_load_address = code->raw();
|
||||
method.method_size = code->instructionsSize();
|
||||
|
||||
if (match_only)
|
||||
method.method_name = const_cast<char*>("regexp (match-only)");
|
||||
else
|
||||
method.method_name = const_cast<char*>("regexp (normal)");
|
||||
|
||||
method.module_name = const_cast<char*>("irregexp");
|
||||
|
||||
int ok = iJIT_NotifyEvent(iJVM_EVENT_TYPE_METHOD_LOAD_FINISHED_V2, (void*)&method);
|
||||
if (ok != 1)
|
||||
printf("[!] VTune Integration: Failed to load method.\n");
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
MarkScript(const js::jit::JitCode* code, const JSScript* script, const char* module)
|
||||
{
|
||||
if (!IsProfilingActive())
|
||||
return;
|
||||
|
||||
iJIT_Method_Load_V2 method = {0};
|
||||
method.method_id = script->vtuneMethodID();
|
||||
method.method_load_address = code->raw();
|
||||
method.method_size = code->instructionsSize();
|
||||
method.module_name = const_cast<char*>(module);
|
||||
|
||||
// Line numbers begin at 1, but columns begin at 0.
|
||||
// Text editors start at 1,1 so fixup is performed to match.
|
||||
char namebuf[512];
|
||||
SprintfLiteral(namebuf, "%s:%zu:%zu",
|
||||
script->filename(), script->lineno(), script->column() + 1);
|
||||
|
||||
method.method_name = &namebuf[0];
|
||||
|
||||
int ok = iJIT_NotifyEvent(iJVM_EVENT_TYPE_METHOD_LOAD_FINISHED_V2, (void*)&method);
|
||||
if (ok != 1)
|
||||
printf("[!] VTune Integration: Failed to load method.\n");
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
MarkWasm(const js::wasm::CodeSegment& cs, const char* name, void* start, uintptr_t size)
|
||||
{
|
||||
if (!IsProfilingActive())
|
||||
return;
|
||||
|
||||
iJIT_Method_Load_V2 method = {0};
|
||||
method.method_id = cs.vtune_method_id_;
|
||||
method.method_name = const_cast<char*>(name);
|
||||
method.method_load_address = start;
|
||||
method.method_size = (unsigned)size;
|
||||
method.module_name = const_cast<char*>("wasm");
|
||||
|
||||
int ok = iJIT_NotifyEvent(iJVM_EVENT_TYPE_METHOD_LOAD_FINISHED_V2, (void*)&method);
|
||||
if (ok != 1)
|
||||
printf("[!] VTune Integration: Failed to load method.\n");
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
UnmarkCode(const js::jit::JitCode* code)
|
||||
{
|
||||
UnmarkBytes(code->raw(), (unsigned)code->instructionsSize());
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
UnmarkBytes(void* bytes, unsigned size)
|
||||
{
|
||||
if (!IsProfilingActive())
|
||||
return;
|
||||
|
||||
// It appears that the method_id is not required for unloading.
|
||||
iJIT_Method_Load method = {0};
|
||||
method.method_load_address = bytes;
|
||||
method.method_size = size;
|
||||
|
||||
// The iJVM_EVENT_TYPE_METHOD_UNLOAD_START event is undocumented.
|
||||
// VTune appears to happily accept unload events even for untracked JitCode.
|
||||
int ok = iJIT_NotifyEvent(iJVM_EVENT_TYPE_METHOD_UNLOAD_START, (void*)&method);
|
||||
|
||||
// Assertions aren't reported in VTune: instead, they immediately end profiling
|
||||
// with no warning that a crash occurred. This can generate misleading profiles.
|
||||
// So instead, print out a message to stdout (which VTune does not redirect).
|
||||
if (ok != 1)
|
||||
printf("[!] VTune Integration: Failed to unload method.\n");
|
||||
}
|
||||
|
||||
} // namespace vtune
|
||||
} // namespace js
|
||||
|
||||
#endif // MOZ_VTUNE
|
@ -4,15 +4,54 @@
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#ifndef vtunewrapper_h
|
||||
#define vtunewrapper_h
|
||||
#ifndef vtune_vtunewrapper_h
|
||||
#define vtune_vtunewrapper_h
|
||||
|
||||
#ifdef MOZ_VTUNE
|
||||
|
||||
#include "vtune/jitprofiling.h"
|
||||
|
||||
#include "jsgc.h"
|
||||
#include "jsscript.h"
|
||||
|
||||
#include "jit/IonCode.h"
|
||||
#include "wasm/WasmCode.h"
|
||||
|
||||
namespace js {
|
||||
namespace vtune {
|
||||
|
||||
// VTune profiling may be attached/detached at any time, but there is no API for
|
||||
// attaching a callback to execute at attachment time. Methods compiled before
|
||||
// VTune was most recently attached therefore do not provide any information to VTune.
|
||||
inline bool
|
||||
IsVTuneProfilingActive()
|
||||
IsProfilingActive()
|
||||
{
|
||||
return iJIT_IsProfilingActive() == iJIT_SAMPLING_ON;
|
||||
}
|
||||
|
||||
#endif // vtunewrapper_h
|
||||
// Wrapper exists in case we need locking in the future.
|
||||
uint32_t GenerateUniqueMethodID();
|
||||
|
||||
void MarkStub(const js::jit::JitCode* code, const char* name);
|
||||
|
||||
void MarkRegExp(const js::jit::JitCode* code, bool match_only);
|
||||
|
||||
void MarkScript(const js::jit::JitCode* code,
|
||||
const JSScript* script,
|
||||
const char* module);
|
||||
|
||||
void MarkWasm(const js::wasm::CodeSegment& cs,
|
||||
const char* name,
|
||||
void* start,
|
||||
uintptr_t size);
|
||||
|
||||
void UnmarkCode(const js::jit::JitCode* code);
|
||||
|
||||
void UnmarkBytes(void* bytes, unsigned size);
|
||||
|
||||
} // namespace vtune
|
||||
} // namespace js
|
||||
|
||||
#endif // MOZ_VTUNE
|
||||
|
||||
#endif // vtune_vtunewrapper_h
|
||||
|
77
js/src/vtune/disable_warnings.h
Normal file
77
js/src/vtune/disable_warnings.h
Normal file
@ -0,0 +1,77 @@
|
||||
/* <copyright>
|
||||
This file is provided under a dual BSD/GPLv2 license. When using or
|
||||
redistributing this file, you may do so under either license.
|
||||
|
||||
GPL LICENSE SUMMARY
|
||||
|
||||
Copyright (c) 2005-2014 Intel Corporation. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of version 2 of the GNU General Public License as
|
||||
published by the Free Software Foundation.
|
||||
|
||||
This program is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
The full GNU General Public License is included in this distribution
|
||||
in the file called LICENSE.GPL.
|
||||
|
||||
Contact Information:
|
||||
http://software.intel.com/en-us/articles/intel-vtune-amplifier-xe/
|
||||
|
||||
BSD LICENSE
|
||||
|
||||
Copyright (c) 2005-2014 Intel Corporation. All rights reserved.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in
|
||||
the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
* Neither the name of Intel Corporation nor the names of its
|
||||
contributors may be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
</copyright> */
|
||||
|
||||
#include "vtune/ittnotify_config.h"
|
||||
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
|
||||
#pragma warning (disable: 593) /* parameter "XXXX" was set but never used */
|
||||
#pragma warning (disable: 344) /* typedef name has already been declared (with same type) */
|
||||
#pragma warning (disable: 174) /* expression has no effect */
|
||||
#pragma warning (disable: 4127) /* conditional expression is constant */
|
||||
#pragma warning (disable: 4306) /* conversion from '?' to '?' of greater size */
|
||||
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
|
||||
#if defined __INTEL_COMPILER
|
||||
|
||||
#pragma warning (disable: 869) /* parameter "XXXXX" was never referenced */
|
||||
#pragma warning (disable: 1418) /* external function definition with no prior declaration */
|
||||
#pragma warning (disable: 1419) /* external declaration in primary source file */
|
||||
|
||||
#endif /* __INTEL_COMPILER */
|
4123
js/src/vtune/ittnotify.h
Normal file
4123
js/src/vtune/ittnotify.h
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,10 +1,10 @@
|
||||
/*
|
||||
/* <copyright>
|
||||
This file is provided under a dual BSD/GPLv2 license. When using or
|
||||
redistributing this file, you may do so under either license.
|
||||
|
||||
GPL LICENSE SUMMARY
|
||||
|
||||
Copyright (c) 2005-2012 Intel Corporation. All rights reserved.
|
||||
Copyright (c) 2005-2014 Intel Corporation. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of version 2 of the GNU General Public License as
|
||||
@ -26,7 +26,7 @@
|
||||
|
||||
BSD LICENSE
|
||||
|
||||
Copyright (c) 2005-2012 Intel Corporation. All rights reserved.
|
||||
Copyright (c) 2005-2014 Intel Corporation. All rights reserved.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
@ -54,7 +54,7 @@
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
</copyright> */
|
||||
#ifndef _ITTNOTIFY_CONFIG_H_
|
||||
#define _ITTNOTIFY_CONFIG_H_
|
||||
|
||||
@ -71,11 +71,17 @@
|
||||
# define ITT_OS_MAC 3
|
||||
#endif /* ITT_OS_MAC */
|
||||
|
||||
#ifndef ITT_OS_FREEBSD
|
||||
# define ITT_OS_FREEBSD 4
|
||||
#endif /* ITT_OS_FREEBSD */
|
||||
|
||||
#ifndef ITT_OS
|
||||
# if defined WIN32 || defined _WIN32
|
||||
# define ITT_OS ITT_OS_WIN
|
||||
# elif defined( __APPLE__ ) && defined( __MACH__ )
|
||||
# define ITT_OS ITT_OS_MAC
|
||||
# elif defined( __FreeBSD__ )
|
||||
# define ITT_OS ITT_OS_FREEBSD
|
||||
# else
|
||||
# define ITT_OS ITT_OS_LINUX
|
||||
# endif
|
||||
@ -89,12 +95,24 @@
|
||||
# define ITT_PLATFORM_POSIX 2
|
||||
#endif /* ITT_PLATFORM_POSIX */
|
||||
|
||||
#ifndef ITT_PLATFORM_MAC
|
||||
# define ITT_PLATFORM_MAC 3
|
||||
#endif /* ITT_PLATFORM_MAC */
|
||||
|
||||
#ifndef ITT_PLATFORM_FREEBSD
|
||||
# define ITT_PLATFORM_FREEBSD 4
|
||||
#endif /* ITT_PLATFORM_FREEBSD */
|
||||
|
||||
#ifndef ITT_PLATFORM
|
||||
# if ITT_OS==ITT_OS_WIN
|
||||
# define ITT_PLATFORM ITT_PLATFORM_WIN
|
||||
# elif ITT_OS==ITT_OS_MAC
|
||||
# define ITT_PLATFORM ITT_PLATFORM_MAC
|
||||
# elif ITT_OS==ITT_OS_FREEBSD
|
||||
# define ITT_PLATFORM ITT_PLATFORM_FREEBSD
|
||||
# else
|
||||
# define ITT_PLATFORM ITT_PLATFORM_POSIX
|
||||
# endif /* _WIN32 */
|
||||
# endif
|
||||
#endif /* ITT_PLATFORM */
|
||||
|
||||
#if defined(_UNICODE) && !defined(UNICODE)
|
||||
@ -111,36 +129,36 @@
|
||||
#endif /* UNICODE || _UNICODE */
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
|
||||
#ifndef CDECL
|
||||
#ifndef ITTAPI_CDECL
|
||||
# if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
# define CDECL __cdecl
|
||||
# define ITTAPI_CDECL __cdecl
|
||||
# else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
# if defined _M_X64 || defined _M_AMD64 || defined __x86_64__
|
||||
# define CDECL /* not actual on x86_64 platform */
|
||||
# else /* _M_X64 || _M_AMD64 || __x86_64__ */
|
||||
# define CDECL __attribute__ ((cdecl))
|
||||
# endif /* _M_X64 || _M_AMD64 || __x86_64__ */
|
||||
# if defined _M_IX86 || defined __i386__
|
||||
# define ITTAPI_CDECL __attribute__ ((cdecl))
|
||||
# else /* _M_IX86 || __i386__ */
|
||||
# define ITTAPI_CDECL /* actual only on x86 platform */
|
||||
# endif /* _M_IX86 || __i386__ */
|
||||
# endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
#endif /* CDECL */
|
||||
#endif /* ITTAPI_CDECL */
|
||||
|
||||
#ifndef STDCALL
|
||||
# if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
# define STDCALL __stdcall
|
||||
# else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
# if defined _M_X64 || defined _M_AMD64 || defined __x86_64__
|
||||
# define STDCALL /* not supported on x86_64 platform */
|
||||
# else /* _M_X64 || _M_AMD64 || __x86_64__ */
|
||||
# if defined _M_IX86 || defined __i386__
|
||||
# define STDCALL __attribute__ ((stdcall))
|
||||
# endif /* _M_X64 || _M_AMD64 || __x86_64__ */
|
||||
# else /* _M_IX86 || __i386__ */
|
||||
# define STDCALL /* supported only on x86 platform */
|
||||
# endif /* _M_IX86 || __i386__ */
|
||||
# endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
#endif /* STDCALL */
|
||||
|
||||
#define ITTAPI CDECL
|
||||
#define LIBITTAPI CDECL
|
||||
#define ITTAPI ITTAPI_CDECL
|
||||
#define LIBITTAPI ITTAPI_CDECL
|
||||
|
||||
/* TODO: Temporary for compatibility! */
|
||||
#define ITTAPI_CALL CDECL
|
||||
#define LIBITTAPI_CALL CDECL
|
||||
#define ITTAPI_CALL ITTAPI_CDECL
|
||||
#define LIBITTAPI_CALL ITTAPI_CDECL
|
||||
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
/* use __forceinline (VC++ specific) */
|
||||
@ -154,10 +172,11 @@
|
||||
*/
|
||||
#ifdef __STRICT_ANSI__
|
||||
#define ITT_INLINE static
|
||||
#define ITT_INLINE_ATTRIBUTE __attribute__((unused))
|
||||
#else /* __STRICT_ANSI__ */
|
||||
#define ITT_INLINE static inline
|
||||
#define ITT_INLINE_ATTRIBUTE __attribute__((always_inline, unused))
|
||||
#endif /* __STRICT_ANSI__ */
|
||||
#define ITT_INLINE_ATTRIBUTE __attribute__ ((always_inline))
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
/** @endcond */
|
||||
|
||||
@ -169,24 +188,36 @@
|
||||
# define ITT_ARCH_IA32E 2
|
||||
#endif /* ITT_ARCH_IA32E */
|
||||
|
||||
#ifndef ITT_ARCH_IA64
|
||||
# define ITT_ARCH_IA64 3
|
||||
#endif /* ITT_ARCH_IA64 */
|
||||
#ifndef ITT_ARCH_ARM
|
||||
# define ITT_ARCH_ARM 4
|
||||
#endif /* ITT_ARCH_ARM */
|
||||
|
||||
#ifndef ITT_ARCH_PPC64
|
||||
# define ITT_ARCH_PPC64 5
|
||||
#endif /* ITT_ARCH_PPC64 */
|
||||
|
||||
#ifndef ITT_ARCH
|
||||
# if defined _M_X64 || defined _M_AMD64 || defined __x86_64__
|
||||
# define ITT_ARCH ITT_ARCH_IA32E
|
||||
# elif defined _M_IA64 || defined __ia64
|
||||
# define ITT_ARCH ITT_ARCH_IA64
|
||||
# else
|
||||
# if defined _M_IX86 || defined __i386__
|
||||
# define ITT_ARCH ITT_ARCH_IA32
|
||||
# elif defined _M_X64 || defined _M_AMD64 || defined __x86_64__
|
||||
# define ITT_ARCH ITT_ARCH_IA32E
|
||||
# elif defined _M_IA64 || defined __ia64__
|
||||
# define ITT_ARCH ITT_ARCH_IA64
|
||||
# elif defined _M_ARM || defined __arm__
|
||||
# define ITT_ARCH ITT_ARCH_ARM
|
||||
# elif defined __powerpc64__
|
||||
# define ITT_ARCH ITT_ARCH_PPC64
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
# define ITT_EXTERN_C extern "C"
|
||||
# define ITT_EXTERN_C_BEGIN extern "C" {
|
||||
# define ITT_EXTERN_C_END }
|
||||
#else
|
||||
# define ITT_EXTERN_C /* nothing */
|
||||
# define ITT_EXTERN_C_BEGIN /* nothing */
|
||||
# define ITT_EXTERN_C_END /* nothing */
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#define ITT_TO_STR_AUX(x) #x
|
||||
@ -202,7 +233,7 @@
|
||||
#define ITT_MAGIC { 0xED, 0xAB, 0xAB, 0xEC, 0x0D, 0xEE, 0xDA, 0x30 }
|
||||
|
||||
/* Replace with snapshot date YYYYMMDD for promotion build. */
|
||||
#define API_VERSION_BUILD 20111111
|
||||
#define API_VERSION_BUILD 20151119
|
||||
|
||||
#ifndef API_VERSION_NUM
|
||||
#define API_VERSION_NUM 0.0.0
|
||||
@ -227,6 +258,9 @@ typedef CRITICAL_SECTION mutex_t;
|
||||
#ifndef _GNU_SOURCE
|
||||
#define _GNU_SOURCE 1 /* need for PTHREAD_MUTEX_RECURSIVE */
|
||||
#endif /* _GNU_SOURCE */
|
||||
#ifndef __USE_UNIX98
|
||||
#define __USE_UNIX98 1 /* need for PTHREAD_MUTEX_RECURSIVE, on SLES11.1 with gcc 4.3.4 wherein pthread.h missing dependency on __USE_XOPEN2K8 */
|
||||
#endif /*__USE_UNIX98*/
|
||||
#include <pthread.h>
|
||||
typedef void* lib_t;
|
||||
typedef pthread_t TIDT;
|
||||
@ -246,8 +280,8 @@ typedef pthread_mutex_t mutex_t;
|
||||
#define __itt_unload_lib(handle) FreeLibrary(handle)
|
||||
#define __itt_system_error() (int)GetLastError()
|
||||
#define __itt_fstrcmp(s1, s2) lstrcmpA(s1, s2)
|
||||
#define __itt_fstrlen(s) lstrlenA(s)
|
||||
#define __itt_fstrcpyn(s1, s2, l) lstrcpynA(s1, s2, l)
|
||||
#define __itt_fstrnlen(s, l) strnlen_s(s, l)
|
||||
#define __itt_fstrcpyn(s1, b, s2, l) strncpy_s(s1, b, s2, l)
|
||||
#define __itt_fstrdup(s) _strdup(s)
|
||||
#define __itt_thread_id() GetCurrentThreadId()
|
||||
#define __itt_thread_yield() SwitchToThread()
|
||||
@ -259,6 +293,10 @@ ITT_INLINE long __itt_interlocked_increment(volatile long* ptr)
|
||||
return InterlockedIncrement(ptr);
|
||||
}
|
||||
#endif /* ITT_SIMPLE_INIT */
|
||||
|
||||
#define DL_SYMBOLS (1)
|
||||
#define PTHREAD_SYMBOLS (1)
|
||||
|
||||
#else /* ITT_PLATFORM!=ITT_PLATFORM_WIN */
|
||||
#define __itt_get_proc(lib, name) dlsym(lib, name)
|
||||
#define __itt_mutex_init(mutex) {\
|
||||
@ -287,29 +325,42 @@ ITT_INLINE long __itt_interlocked_increment(volatile long* ptr)
|
||||
#define __itt_unload_lib(handle) dlclose(handle)
|
||||
#define __itt_system_error() errno
|
||||
#define __itt_fstrcmp(s1, s2) strcmp(s1, s2)
|
||||
#define __itt_fstrlen(s) strlen(s)
|
||||
#define __itt_fstrcpyn(s1, s2, l) strncpy(s1, s2, l)
|
||||
|
||||
/* makes customer code define safe APIs for SDL_STRNLEN_S and SDL_STRNCPY_S */
|
||||
#ifdef SDL_STRNLEN_S
|
||||
#define __itt_fstrnlen(s, l) SDL_STRNLEN_S(s, l)
|
||||
#else
|
||||
#define __itt_fstrnlen(s, l) strlen(s)
|
||||
#endif /* SDL_STRNLEN_S */
|
||||
#ifdef SDL_STRNCPY_S
|
||||
#define __itt_fstrcpyn(s1, b, s2, l) SDL_STRNCPY_S(s1, b, s2, l)
|
||||
#else
|
||||
#define __itt_fstrcpyn(s1, b, s2, l) strncpy(s1, s2, l)
|
||||
#endif /* SDL_STRNCPY_S */
|
||||
|
||||
#define __itt_fstrdup(s) strdup(s)
|
||||
#define __itt_thread_id() pthread_self()
|
||||
#define __itt_thread_yield() sched_yield()
|
||||
#if ITT_ARCH==ITT_ARCH_IA64
|
||||
#ifdef __INTEL_COMPILER
|
||||
#define __TBB_machine_fetchadd4(addr, val) __fetchadd4_acq((void*)addr, val)
|
||||
#define __TBB_machine_fetchadd4(addr, val) __fetchadd4_acq((void *)addr, val)
|
||||
#else /* __INTEL_COMPILER */
|
||||
/* TODO: Add Support for not Intel compilers for IA64 */
|
||||
/* TODO: Add Support for not Intel compilers for IA-64 architecture */
|
||||
#endif /* __INTEL_COMPILER */
|
||||
#else /* ITT_ARCH!=ITT_ARCH_IA64 */
|
||||
#elif ITT_ARCH==ITT_ARCH_IA32 || ITT_ARCH==ITT_ARCH_IA32E /* ITT_ARCH!=ITT_ARCH_IA64 */
|
||||
ITT_INLINE long
|
||||
__TBB_machine_fetchadd4(volatile void* ptr, long addend) ITT_INLINE_ATTRIBUTE;
|
||||
ITT_INLINE long __TBB_machine_fetchadd4(volatile void* ptr, long addend)
|
||||
{
|
||||
long result;
|
||||
__asm__ __volatile__("lock\nxadd %0,%1"
|
||||
: "=r"(result),"=m"(*(long*)ptr)
|
||||
: "0"(addend), "m"(*(long*)ptr)
|
||||
: "=r"(result),"=m"(*(int*)ptr)
|
||||
: "0"(addend), "m"(*(int*)ptr)
|
||||
: "memory");
|
||||
return result;
|
||||
}
|
||||
#elif ITT_ARCH==ITT_ARCH_ARM || ITT_ARCH==ITT_ARCH_PPC64
|
||||
#define __TBB_machine_fetchadd4(addr, val) __sync_fetch_and_add(addr, val)
|
||||
#endif /* ITT_ARCH==ITT_ARCH_IA64 */
|
||||
#ifndef ITT_SIMPLE_INIT
|
||||
ITT_INLINE long
|
||||
@ -319,6 +370,22 @@ ITT_INLINE long __itt_interlocked_increment(volatile long* ptr)
|
||||
return __TBB_machine_fetchadd4(ptr, 1) + 1L;
|
||||
}
|
||||
#endif /* ITT_SIMPLE_INIT */
|
||||
|
||||
void* dlopen(const char*, int) __attribute__((weak));
|
||||
void* dlsym(void*, const char*) __attribute__((weak));
|
||||
int dlclose(void*) __attribute__((weak));
|
||||
#define DL_SYMBOLS (dlopen && dlsym && dlclose)
|
||||
|
||||
int pthread_mutex_init(pthread_mutex_t*, const pthread_mutexattr_t*) __attribute__((weak));
|
||||
int pthread_mutex_lock(pthread_mutex_t*) __attribute__((weak));
|
||||
int pthread_mutex_unlock(pthread_mutex_t*) __attribute__((weak));
|
||||
int pthread_mutex_destroy(pthread_mutex_t*) __attribute__((weak));
|
||||
int pthread_mutexattr_init(pthread_mutexattr_t*) __attribute__((weak));
|
||||
int pthread_mutexattr_settype(pthread_mutexattr_t*, int) __attribute__((weak));
|
||||
int pthread_mutexattr_destroy(pthread_mutexattr_t*) __attribute__((weak));
|
||||
pthread_t pthread_self(void) __attribute__((weak));
|
||||
#define PTHREAD_SYMBOLS (pthread_mutex_init && pthread_mutex_lock && pthread_mutex_unlock && pthread_mutex_destroy && pthread_mutexattr_init && pthread_mutexattr_settype && pthread_mutexattr_destroy && pthread_self)
|
||||
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
|
||||
typedef enum {
|
||||
@ -348,7 +415,7 @@ typedef struct ___itt_thread_info
|
||||
struct ___itt_thread_info* next;
|
||||
} __itt_thread_info;
|
||||
|
||||
#include "ittnotify_types.h" /* For __itt_group_id definition */
|
||||
#include "vtune/ittnotify_types.h" /* For __itt_group_id definition */
|
||||
|
||||
typedef struct ___itt_api_info_20101001
|
||||
{
|
||||
@ -367,6 +434,27 @@ typedef struct ___itt_api_info
|
||||
__itt_group_id group;
|
||||
} __itt_api_info;
|
||||
|
||||
typedef struct __itt_counter_info
|
||||
{
|
||||
const char* nameA; /*!< Copy of original name in ASCII. */
|
||||
#if defined(UNICODE) || defined(_UNICODE)
|
||||
const wchar_t* nameW; /*!< Copy of original name in UNICODE. */
|
||||
#else /* UNICODE || _UNICODE */
|
||||
void* nameW;
|
||||
#endif /* UNICODE || _UNICODE */
|
||||
const char* domainA; /*!< Copy of original name in ASCII. */
|
||||
#if defined(UNICODE) || defined(_UNICODE)
|
||||
const wchar_t* domainW; /*!< Copy of original name in UNICODE. */
|
||||
#else /* UNICODE || _UNICODE */
|
||||
void* domainW;
|
||||
#endif /* UNICODE || _UNICODE */
|
||||
unsigned type;
|
||||
long index;
|
||||
int extra1; /*!< Reserved to the runtime */
|
||||
void* extra2; /*!< Reserved to the runtime */
|
||||
struct __itt_counter_info* next;
|
||||
} __itt_counter_info_t;
|
||||
|
||||
struct ___itt_domain;
|
||||
struct ___itt_string_handle;
|
||||
|
||||
@ -390,6 +478,7 @@ typedef struct ___itt_global
|
||||
struct ___itt_domain* domain_list;
|
||||
struct ___itt_string_handle* string_list;
|
||||
__itt_collection_state state;
|
||||
__itt_counter_info_t* counter_list;
|
||||
} __itt_global;
|
||||
|
||||
#pragma pack(pop)
|
||||
@ -431,7 +520,7 @@ typedef struct ___itt_global
|
||||
#define NEW_DOMAIN_W(gptr,h,h_tail,name) { \
|
||||
h = (__itt_domain*)malloc(sizeof(__itt_domain)); \
|
||||
if (h != NULL) { \
|
||||
h->flags = 0; /* domain is disabled by default */ \
|
||||
h->flags = 1; /* domain is enabled by default */ \
|
||||
h->nameA = NULL; \
|
||||
h->nameW = name ? _wcsdup(name) : NULL; \
|
||||
h->extra1 = 0; /* reserved */ \
|
||||
@ -447,7 +536,7 @@ typedef struct ___itt_global
|
||||
#define NEW_DOMAIN_A(gptr,h,h_tail,name) { \
|
||||
h = (__itt_domain*)malloc(sizeof(__itt_domain)); \
|
||||
if (h != NULL) { \
|
||||
h->flags = 0; /* domain is disabled by default */ \
|
||||
h->flags = 1; /* domain is enabled by default */ \
|
||||
h->nameA = name ? __itt_fstrdup(name) : NULL; \
|
||||
h->nameW = NULL; \
|
||||
h->extra1 = 0; /* reserved */ \
|
||||
@ -490,4 +579,38 @@ typedef struct ___itt_global
|
||||
} \
|
||||
}
|
||||
|
||||
#define NEW_COUNTER_W(gptr,h,h_tail,name,domain,type) { \
|
||||
h = (__itt_counter_info_t*)malloc(sizeof(__itt_counter_info_t)); \
|
||||
if (h != NULL) { \
|
||||
h->nameA = NULL; \
|
||||
h->nameW = name ? _wcsdup(name) : NULL; \
|
||||
h->domainA = NULL; \
|
||||
h->domainW = name ? _wcsdup(domain) : NULL; \
|
||||
h->type = type; \
|
||||
h->index = 0; \
|
||||
h->next = NULL; \
|
||||
if (h_tail == NULL) \
|
||||
(gptr)->counter_list = h; \
|
||||
else \
|
||||
h_tail->next = h; \
|
||||
} \
|
||||
}
|
||||
|
||||
#define NEW_COUNTER_A(gptr,h,h_tail,name,domain,type) { \
|
||||
h = (__itt_counter_info_t*)malloc(sizeof(__itt_counter_info_t)); \
|
||||
if (h != NULL) { \
|
||||
h->nameA = name ? __itt_fstrdup(name) : NULL; \
|
||||
h->nameW = NULL; \
|
||||
h->domainA = domain ? __itt_fstrdup(domain) : NULL; \
|
||||
h->domainW = NULL; \
|
||||
h->type = type; \
|
||||
h->index = 0; \
|
||||
h->next = NULL; \
|
||||
if (h_tail == NULL) \
|
||||
(gptr)->counter_list = h; \
|
||||
else \
|
||||
h_tail->next = h; \
|
||||
} \
|
||||
}
|
||||
|
||||
#endif /* _ITTNOTIFY_CONFIG_H_ */
|
||||
|
1236
js/src/vtune/ittnotify_static.c
Normal file
1236
js/src/vtune/ittnotify_static.c
Normal file
File diff suppressed because it is too large
Load Diff
389
js/src/vtune/ittnotify_static.h
Normal file
389
js/src/vtune/ittnotify_static.h
Normal file
@ -0,0 +1,389 @@
|
||||
/* <copyright>
|
||||
This file is provided under a dual BSD/GPLv2 license. When using or
|
||||
redistributing this file, you may do so under either license.
|
||||
|
||||
GPL LICENSE SUMMARY
|
||||
|
||||
Copyright (c) 2005-2014 Intel Corporation. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of version 2 of the GNU General Public License as
|
||||
published by the Free Software Foundation.
|
||||
|
||||
This program is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
The full GNU General Public License is included in this distribution
|
||||
in the file called LICENSE.GPL.
|
||||
|
||||
Contact Information:
|
||||
http://software.intel.com/en-us/articles/intel-vtune-amplifier-xe/
|
||||
|
||||
BSD LICENSE
|
||||
|
||||
Copyright (c) 2005-2014 Intel Corporation. All rights reserved.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in
|
||||
the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
* Neither the name of Intel Corporation nor the names of its
|
||||
contributors may be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
</copyright> */
|
||||
|
||||
#include "vtune/ittnotify_config.h"
|
||||
|
||||
#ifndef ITT_FORMAT_DEFINED
|
||||
# ifndef ITT_FORMAT
|
||||
# define ITT_FORMAT
|
||||
# endif /* ITT_FORMAT */
|
||||
# ifndef ITT_NO_PARAMS
|
||||
# define ITT_NO_PARAMS
|
||||
# endif /* ITT_NO_PARAMS */
|
||||
#endif /* ITT_FORMAT_DEFINED */
|
||||
|
||||
/*
|
||||
* parameters for macro expected:
|
||||
* ITT_STUB(api, type, func_name, arguments, params, func_name_in_dll, group, printf_fmt)
|
||||
*/
|
||||
#ifdef __ITT_INTERNAL_INIT
|
||||
|
||||
#ifndef __ITT_INTERNAL_BODY
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
ITT_STUB(ITTAPI, __itt_domain*, domain_createA, (const char *name), (ITT_FORMAT name), domain_createA, __itt_group_structure, "\"%s\"")
|
||||
ITT_STUB(ITTAPI, __itt_domain*, domain_createW, (const wchar_t *name), (ITT_FORMAT name), domain_createW, __itt_group_structure, "\"%S\"")
|
||||
#else /* ITT_PLATFORM!=ITT_PLATFORM_WIN */
|
||||
ITT_STUB(ITTAPI, __itt_domain*, domain_create, (const char *name), (ITT_FORMAT name), domain_create, __itt_group_structure, "\"%s\"")
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
ITT_STUB(ITTAPI, __itt_string_handle*, string_handle_createA, (const char *name), (ITT_FORMAT name), string_handle_createA, __itt_group_structure, "\"%s\"")
|
||||
ITT_STUB(ITTAPI, __itt_string_handle*, string_handle_createW, (const wchar_t *name), (ITT_FORMAT name), string_handle_createW, __itt_group_structure, "\"%S\"")
|
||||
#else /* ITT_PLATFORM!=ITT_PLATFORM_WIN */
|
||||
ITT_STUB(ITTAPI, __itt_string_handle*, string_handle_create, (const char *name), (ITT_FORMAT name), string_handle_create, __itt_group_structure, "\"%s\"")
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
ITT_STUB(ITTAPI, __itt_counter, counter_createA, (const char *name, const char *domain), (ITT_FORMAT name, domain), counter_createA, __itt_group_counter, "\"%s\", \"%s\"")
|
||||
ITT_STUB(ITTAPI, __itt_counter, counter_createW, (const wchar_t *name, const wchar_t *domain), (ITT_FORMAT name, domain), counter_createW, __itt_group_counter, "\"%s\", \"%s\"")
|
||||
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
ITT_STUB(ITTAPI, __itt_counter, counter_create, (const char *name, const char *domain), (ITT_FORMAT name, domain), counter_create, __itt_group_counter, "\"%s\", \"%s\"")
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
ITT_STUB(ITTAPI, __itt_counter, counter_create_typedA, (const char *name, const char *domain, __itt_metadata_type type), (ITT_FORMAT name, domain, type), counter_create_typedA, __itt_group_counter, "\"%s\", \"%s\", %d")
|
||||
ITT_STUB(ITTAPI, __itt_counter, counter_create_typedW, (const wchar_t *name, const wchar_t *domain, __itt_metadata_type type), (ITT_FORMAT name, domain, type), counter_create_typedW, __itt_group_counter, "\"%s\", \"%s\", %d")
|
||||
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
ITT_STUB(ITTAPI, __itt_counter, counter_create_typed, (const char *name, const char *domain, __itt_metadata_type type), (ITT_FORMAT name, domain, type), counter_create_typed, __itt_group_counter, "\"%s\", \"%s\", %d")
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
|
||||
|
||||
ITT_STUBV(ITTAPI, void, pause, (void), (ITT_NO_PARAMS), pause, __itt_group_control | __itt_group_legacy, "no args")
|
||||
ITT_STUBV(ITTAPI, void, resume, (void), (ITT_NO_PARAMS), resume, __itt_group_control | __itt_group_legacy, "no args")
|
||||
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
ITT_STUBV(ITTAPI, void, thread_set_nameA, (const char *name), (ITT_FORMAT name), thread_set_nameA, __itt_group_thread, "\"%s\"")
|
||||
ITT_STUBV(ITTAPI, void, thread_set_nameW, (const wchar_t *name), (ITT_FORMAT name), thread_set_nameW, __itt_group_thread, "\"%S\"")
|
||||
#else /* ITT_PLATFORM!=ITT_PLATFORM_WIN */
|
||||
ITT_STUBV(ITTAPI, void, thread_set_name, (const char *name), (ITT_FORMAT name), thread_set_name, __itt_group_thread, "\"%s\"")
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
ITT_STUBV(ITTAPI, void, thread_ignore, (void), (ITT_NO_PARAMS), thread_ignore, __itt_group_thread, "no args")
|
||||
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
ITT_STUB(LIBITTAPI, int, thr_name_setA, (const char *name, int namelen), (ITT_FORMAT name, namelen), thr_name_setA, __itt_group_thread | __itt_group_legacy, "\"%s\", %d")
|
||||
ITT_STUB(LIBITTAPI, int, thr_name_setW, (const wchar_t *name, int namelen), (ITT_FORMAT name, namelen), thr_name_setW, __itt_group_thread | __itt_group_legacy, "\"%S\", %d")
|
||||
#else /* ITT_PLATFORM!=ITT_PLATFORM_WIN */
|
||||
ITT_STUB(LIBITTAPI, int, thr_name_set, (const char *name, int namelen), (ITT_FORMAT name, namelen), thr_name_set, __itt_group_thread | __itt_group_legacy, "\"%s\", %d")
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
ITT_STUBV(LIBITTAPI, void, thr_ignore, (void), (ITT_NO_PARAMS), thr_ignore, __itt_group_thread | __itt_group_legacy, "no args")
|
||||
#endif /* __ITT_INTERNAL_BODY */
|
||||
|
||||
ITT_STUBV(ITTAPI, void, enable_attach, (void), (ITT_NO_PARAMS), enable_attach, __itt_group_all, "no args")
|
||||
|
||||
#else /* __ITT_INTERNAL_INIT */
|
||||
|
||||
ITT_STUBV(ITTAPI, void, detach, (void), (ITT_NO_PARAMS), detach, __itt_group_control | __itt_group_legacy, "no args")
|
||||
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
ITT_STUBV(ITTAPI, void, sync_createA, (void *addr, const char *objtype, const char *objname, int attribute), (ITT_FORMAT addr, objtype, objname, attribute), sync_createA, __itt_group_sync | __itt_group_fsync, "%p, \"%s\", \"%s\", %x")
|
||||
ITT_STUBV(ITTAPI, void, sync_createW, (void *addr, const wchar_t *objtype, const wchar_t *objname, int attribute), (ITT_FORMAT addr, objtype, objname, attribute), sync_createW, __itt_group_sync | __itt_group_fsync, "%p, \"%S\", \"%S\", %x")
|
||||
ITT_STUBV(ITTAPI, void, sync_renameA, (void *addr, const char *name), (ITT_FORMAT addr, name), sync_renameA, __itt_group_sync | __itt_group_fsync, "%p, \"%s\"")
|
||||
ITT_STUBV(ITTAPI, void, sync_renameW, (void *addr, const wchar_t *name), (ITT_FORMAT addr, name), sync_renameW, __itt_group_sync | __itt_group_fsync, "%p, \"%S\"")
|
||||
#else /* ITT_PLATFORM!=ITT_PLATFORM_WIN */
|
||||
ITT_STUBV(ITTAPI, void, sync_create, (void *addr, const char *objtype, const char *objname, int attribute), (ITT_FORMAT addr, objtype, objname, attribute), sync_create, __itt_group_sync | __itt_group_fsync, "%p, \"%s\", \"%s\", %x")
|
||||
ITT_STUBV(ITTAPI, void, sync_rename, (void *addr, const char *name), (ITT_FORMAT addr, name), sync_rename, __itt_group_sync | __itt_group_fsync, "%p, \"%s\"")
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
ITT_STUBV(ITTAPI, void, sync_destroy, (void *addr), (ITT_FORMAT addr), sync_destroy, __itt_group_sync | __itt_group_fsync, "%p")
|
||||
|
||||
ITT_STUBV(ITTAPI, void, sync_prepare, (void* addr), (ITT_FORMAT addr), sync_prepare, __itt_group_sync, "%p")
|
||||
ITT_STUBV(ITTAPI, void, sync_cancel, (void *addr), (ITT_FORMAT addr), sync_cancel, __itt_group_sync, "%p")
|
||||
ITT_STUBV(ITTAPI, void, sync_acquired, (void *addr), (ITT_FORMAT addr), sync_acquired, __itt_group_sync, "%p")
|
||||
ITT_STUBV(ITTAPI, void, sync_releasing, (void* addr), (ITT_FORMAT addr), sync_releasing, __itt_group_sync, "%p")
|
||||
|
||||
ITT_STUBV(ITTAPI, void, suppress_push, (unsigned int mask), (ITT_FORMAT mask), suppress_push, __itt_group_suppress, "%p")
|
||||
ITT_STUBV(ITTAPI, void, suppress_pop, (void), (ITT_NO_PARAMS), suppress_pop, __itt_group_suppress, "no args")
|
||||
ITT_STUBV(ITTAPI, void, suppress_mark_range, (__itt_suppress_mode_t mode, unsigned int mask, void * address, size_t size),(ITT_FORMAT mode, mask, address, size), suppress_mark_range, __itt_group_suppress, "%d, %p, %p, %d")
|
||||
ITT_STUBV(ITTAPI, void, suppress_clear_range,(__itt_suppress_mode_t mode, unsigned int mask, void * address, size_t size),(ITT_FORMAT mode, mask, address, size), suppress_clear_range,__itt_group_suppress, "%d, %p, %p, %d")
|
||||
|
||||
ITT_STUBV(ITTAPI, void, fsync_prepare, (void* addr), (ITT_FORMAT addr), sync_prepare, __itt_group_fsync, "%p")
|
||||
ITT_STUBV(ITTAPI, void, fsync_cancel, (void *addr), (ITT_FORMAT addr), sync_cancel, __itt_group_fsync, "%p")
|
||||
ITT_STUBV(ITTAPI, void, fsync_acquired, (void *addr), (ITT_FORMAT addr), sync_acquired, __itt_group_fsync, "%p")
|
||||
ITT_STUBV(ITTAPI, void, fsync_releasing, (void* addr), (ITT_FORMAT addr), sync_releasing, __itt_group_fsync, "%p")
|
||||
|
||||
ITT_STUBV(ITTAPI, void, model_site_begin, (__itt_model_site *site, __itt_model_site_instance *instance, const char *name), (ITT_FORMAT site, instance, name), model_site_begin, __itt_group_model, "%p, %p, \"%s\"")
|
||||
ITT_STUBV(ITTAPI, void, model_site_end, (__itt_model_site *site, __itt_model_site_instance *instance), (ITT_FORMAT site, instance), model_site_end, __itt_group_model, "%p, %p")
|
||||
ITT_STUBV(ITTAPI, void, model_task_begin, (__itt_model_task *task, __itt_model_task_instance *instance, const char *name), (ITT_FORMAT task, instance, name), model_task_begin, __itt_group_model, "%p, %p, \"%s\"")
|
||||
ITT_STUBV(ITTAPI, void, model_task_end, (__itt_model_task *task, __itt_model_task_instance *instance), (ITT_FORMAT task, instance), model_task_end, __itt_group_model, "%p, %p")
|
||||
ITT_STUBV(ITTAPI, void, model_lock_acquire, (void *lock), (ITT_FORMAT lock), model_lock_acquire, __itt_group_model, "%p")
|
||||
ITT_STUBV(ITTAPI, void, model_lock_release, (void *lock), (ITT_FORMAT lock), model_lock_release, __itt_group_model, "%p")
|
||||
ITT_STUBV(ITTAPI, void, model_record_allocation, (void *addr, size_t size), (ITT_FORMAT addr, size), model_record_allocation, __itt_group_model, "%p, %d")
|
||||
ITT_STUBV(ITTAPI, void, model_record_deallocation, (void *addr), (ITT_FORMAT addr), model_record_deallocation, __itt_group_model, "%p")
|
||||
ITT_STUBV(ITTAPI, void, model_induction_uses, (void* addr, size_t size), (ITT_FORMAT addr, size), model_induction_uses, __itt_group_model, "%p, %d")
|
||||
ITT_STUBV(ITTAPI, void, model_reduction_uses, (void* addr, size_t size), (ITT_FORMAT addr, size), model_reduction_uses, __itt_group_model, "%p, %d")
|
||||
ITT_STUBV(ITTAPI, void, model_observe_uses, (void* addr, size_t size), (ITT_FORMAT addr, size), model_observe_uses, __itt_group_model, "%p, %d")
|
||||
ITT_STUBV(ITTAPI, void, model_clear_uses, (void* addr), (ITT_FORMAT addr), model_clear_uses, __itt_group_model, "%p")
|
||||
|
||||
#ifndef __ITT_INTERNAL_BODY
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
ITT_STUBV(ITTAPI, void, model_site_beginW, (const wchar_t *name), (ITT_FORMAT name), model_site_beginW, __itt_group_model, "\"%s\"")
|
||||
ITT_STUBV(ITTAPI, void, model_task_beginW, (const wchar_t *name), (ITT_FORMAT name), model_task_beginW, __itt_group_model, "\"%s\"")
|
||||
ITT_STUBV(ITTAPI, void, model_iteration_taskW, (const wchar_t *name), (ITT_FORMAT name), model_iteration_taskW, __itt_group_model, "\"%s\"")
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
ITT_STUBV(ITTAPI, void, model_site_beginA, (const char *name), (ITT_FORMAT name), model_site_beginA, __itt_group_model, "\"%s\"")
|
||||
ITT_STUBV(ITTAPI, void, model_site_beginAL, (const char *name, size_t len), (ITT_FORMAT name, len), model_site_beginAL, __itt_group_model, "\"%s\", %d")
|
||||
ITT_STUBV(ITTAPI, void, model_task_beginA, (const char *name), (ITT_FORMAT name), model_task_beginA, __itt_group_model, "\"%s\"")
|
||||
ITT_STUBV(ITTAPI, void, model_task_beginAL, (const char *name, size_t len), (ITT_FORMAT name, len), model_task_beginAL, __itt_group_model, "\"%s\", %d")
|
||||
ITT_STUBV(ITTAPI, void, model_iteration_taskA, (const char *name), (ITT_FORMAT name), model_iteration_taskA, __itt_group_model, "\"%s\"")
|
||||
ITT_STUBV(ITTAPI, void, model_iteration_taskAL, (const char *name, size_t len), (ITT_FORMAT name, len), model_iteration_taskAL, __itt_group_model, "\"%s\", %d")
|
||||
ITT_STUBV(ITTAPI, void, model_site_end_2, (void), (ITT_NO_PARAMS), model_site_end_2, __itt_group_model, "no args")
|
||||
ITT_STUBV(ITTAPI, void, model_task_end_2, (void), (ITT_NO_PARAMS), model_task_end_2, __itt_group_model, "no args")
|
||||
ITT_STUBV(ITTAPI, void, model_lock_acquire_2, (void *lock), (ITT_FORMAT lock), model_lock_acquire_2, __itt_group_model, "%p")
|
||||
ITT_STUBV(ITTAPI, void, model_lock_release_2, (void *lock), (ITT_FORMAT lock), model_lock_release_2, __itt_group_model, "%p")
|
||||
ITT_STUBV(ITTAPI, void, model_aggregate_task, (size_t count), (ITT_FORMAT count), model_aggregate_task, __itt_group_model, "%d")
|
||||
ITT_STUBV(ITTAPI, void, model_disable_push, (__itt_model_disable x), (ITT_FORMAT x), model_disable_push, __itt_group_model, "%p")
|
||||
ITT_STUBV(ITTAPI, void, model_disable_pop, (void), (ITT_NO_PARAMS), model_disable_pop, __itt_group_model, "no args")
|
||||
#endif /* __ITT_INTERNAL_BODY */
|
||||
|
||||
#ifndef __ITT_INTERNAL_BODY
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
ITT_STUB(ITTAPI, __itt_heap_function, heap_function_createA, (const char *name, const char *domain), (ITT_FORMAT name, domain), heap_function_createA, __itt_group_heap, "\"%s\", \"%s\"")
|
||||
ITT_STUB(ITTAPI, __itt_heap_function, heap_function_createW, (const wchar_t *name, const wchar_t *domain), (ITT_FORMAT name, domain), heap_function_createW, __itt_group_heap, "\"%s\", \"%s\"")
|
||||
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
ITT_STUB(ITTAPI, __itt_heap_function, heap_function_create, (const char *name, const char *domain), (ITT_FORMAT name, domain), heap_function_create, __itt_group_heap, "\"%s\", \"%s\"")
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
#endif /* __ITT_INTERNAL_BODY */
|
||||
ITT_STUBV(ITTAPI, void, heap_allocate_begin, (__itt_heap_function h, size_t size, int initialized), (ITT_FORMAT h, size, initialized), heap_allocate_begin, __itt_group_heap, "%p, %lu, %d")
|
||||
ITT_STUBV(ITTAPI, void, heap_allocate_end, (__itt_heap_function h, void** addr, size_t size, int initialized), (ITT_FORMAT h, addr, size, initialized), heap_allocate_end, __itt_group_heap, "%p, %p, %lu, %d")
|
||||
ITT_STUBV(ITTAPI, void, heap_free_begin, (__itt_heap_function h, void* addr), (ITT_FORMAT h, addr), heap_free_begin, __itt_group_heap, "%p, %p")
|
||||
ITT_STUBV(ITTAPI, void, heap_free_end, (__itt_heap_function h, void* addr), (ITT_FORMAT h, addr), heap_free_end, __itt_group_heap, "%p, %p")
|
||||
ITT_STUBV(ITTAPI, void, heap_reallocate_begin, (__itt_heap_function h, void* addr, size_t new_size, int initialized), (ITT_FORMAT h, addr, new_size, initialized), heap_reallocate_begin, __itt_group_heap, "%p, %p, %lu, %d")
|
||||
ITT_STUBV(ITTAPI, void, heap_reallocate_end, (__itt_heap_function h, void* addr, void** new_addr, size_t new_size, int initialized), (ITT_FORMAT h, addr, new_addr, new_size, initialized), heap_reallocate_end, __itt_group_heap, "%p, %p, %p, %lu, %d")
|
||||
ITT_STUBV(ITTAPI, void, heap_internal_access_begin, (void), (ITT_NO_PARAMS), heap_internal_access_begin, __itt_group_heap, "no args")
|
||||
ITT_STUBV(ITTAPI, void, heap_internal_access_end, (void), (ITT_NO_PARAMS), heap_internal_access_end, __itt_group_heap, "no args")
|
||||
ITT_STUBV(ITTAPI, void, heap_record_memory_growth_begin, (void), (ITT_NO_PARAMS), heap_record_memory_growth_begin, __itt_group_heap, "no args")
|
||||
ITT_STUBV(ITTAPI, void, heap_record_memory_growth_end, (void), (ITT_NO_PARAMS), heap_record_memory_growth_end, __itt_group_heap, "no args")
|
||||
ITT_STUBV(ITTAPI, void, heap_reset_detection, (unsigned int reset_mask), (ITT_FORMAT reset_mask), heap_reset_detection, __itt_group_heap, "%u")
|
||||
ITT_STUBV(ITTAPI, void, heap_record, (unsigned int record_mask), (ITT_FORMAT record_mask), heap_record, __itt_group_heap, "%u")
|
||||
|
||||
ITT_STUBV(ITTAPI, void, id_create, (const __itt_domain *domain, __itt_id id), (ITT_FORMAT domain, id), id_create, __itt_group_structure, "%p, %lu")
|
||||
ITT_STUBV(ITTAPI, void, id_destroy, (const __itt_domain *domain, __itt_id id), (ITT_FORMAT domain, id), id_destroy, __itt_group_structure, "%p, %lu")
|
||||
|
||||
ITT_STUB(ITTAPI, __itt_timestamp, get_timestamp, (void), (ITT_NO_PARAMS), get_timestamp, __itt_group_structure, "no args")
|
||||
|
||||
ITT_STUBV(ITTAPI, void, region_begin, (const __itt_domain *domain, __itt_id id, __itt_id parent, __itt_string_handle *name), (ITT_FORMAT domain, id, parent, name), region_begin, __itt_group_structure, "%p, %lu, %lu, %p")
|
||||
ITT_STUBV(ITTAPI, void, region_end, (const __itt_domain *domain, __itt_id id), (ITT_FORMAT domain, id), region_end, __itt_group_structure, "%p, %lu")
|
||||
|
||||
#ifndef __ITT_INTERNAL_BODY
|
||||
ITT_STUBV(ITTAPI, void, frame_begin_v3, (const __itt_domain *domain, __itt_id *id), (ITT_FORMAT domain, id), frame_begin_v3, __itt_group_structure, "%p, %p")
|
||||
ITT_STUBV(ITTAPI, void, frame_end_v3, (const __itt_domain *domain, __itt_id *id), (ITT_FORMAT domain, id), frame_end_v3, __itt_group_structure, "%p, %p")
|
||||
ITT_STUBV(ITTAPI, void, frame_submit_v3, (const __itt_domain *domain, __itt_id *id, __itt_timestamp begin, __itt_timestamp end), (ITT_FORMAT domain, id, begin, end), frame_submit_v3, __itt_group_structure, "%p, %p, %lu, %lu")
|
||||
#endif /* __ITT_INTERNAL_BODY */
|
||||
|
||||
ITT_STUBV(ITTAPI, void, task_group, (const __itt_domain *domain, __itt_id id, __itt_id parent, __itt_string_handle *name), (ITT_FORMAT domain, id, parent, name), task_group, __itt_group_structure, "%p, %lu, %lu, %p")
|
||||
|
||||
ITT_STUBV(ITTAPI, void, task_begin, (const __itt_domain *domain, __itt_id id, __itt_id parent, __itt_string_handle *name), (ITT_FORMAT domain, id, parent, name), task_begin, __itt_group_structure, "%p, %lu, %lu, %p")
|
||||
ITT_STUBV(ITTAPI, void, task_begin_fn, (const __itt_domain *domain, __itt_id id, __itt_id parent, void* fn), (ITT_FORMAT domain, id, parent, fn), task_begin_fn, __itt_group_structure, "%p, %lu, %lu, %p")
|
||||
ITT_STUBV(ITTAPI, void, task_end, (const __itt_domain *domain), (ITT_FORMAT domain), task_end, __itt_group_structure, "%p")
|
||||
|
||||
ITT_STUBV(ITTAPI, void, counter_inc_v3, (const __itt_domain *domain, __itt_string_handle *name), (ITT_FORMAT domain, name), counter_inc_v3, __itt_group_structure, "%p, %p")
|
||||
ITT_STUBV(ITTAPI, void, counter_inc_delta_v3, (const __itt_domain *domain, __itt_string_handle *name, unsigned long long value), (ITT_FORMAT domain, name, value), counter_inc_delta_v3, __itt_group_structure, "%p, %p, %lu")
|
||||
ITT_STUBV(ITTAPI, void, counter_dec_v3, (const __itt_domain *domain, __itt_string_handle *name), (ITT_FORMAT domain, name), counter_dec_v3, __itt_group_structure, "%p, %p")
|
||||
ITT_STUBV(ITTAPI, void, counter_dec_delta_v3, (const __itt_domain *domain, __itt_string_handle *name, unsigned long long value), (ITT_FORMAT domain, name, value), counter_dec_delta_v3, __itt_group_structure, "%p, %p, %lu")
|
||||
|
||||
ITT_STUBV(ITTAPI, void, marker, (const __itt_domain *domain, __itt_id id, __itt_string_handle *name, __itt_scope scope), (ITT_FORMAT domain, id, name, scope), marker, __itt_group_structure, "%p, %lu, %p, %d")
|
||||
|
||||
ITT_STUBV(ITTAPI, void, metadata_add, (const __itt_domain *domain, __itt_id id, __itt_string_handle *key, __itt_metadata_type type, size_t count, void *data), (ITT_FORMAT domain, id, key, type, count, data), metadata_add, __itt_group_structure, "%p, %lu, %p, %d, %lu, %p")
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
ITT_STUBV(ITTAPI, void, metadata_str_addA, (const __itt_domain *domain, __itt_id id, __itt_string_handle *key, const char* data, size_t length), (ITT_FORMAT domain, id, key, data, length), metadata_str_addA, __itt_group_structure, "%p, %lu, %p, %p, %lu")
|
||||
ITT_STUBV(ITTAPI, void, metadata_str_addW, (const __itt_domain *domain, __itt_id id, __itt_string_handle *key, const wchar_t* data, size_t length), (ITT_FORMAT domain, id, key, data, length), metadata_str_addW, __itt_group_structure, "%p, %lu, %p, %p, %lu")
|
||||
#else /* ITT_PLATFORM!=ITT_PLATFORM_WIN */
|
||||
ITT_STUBV(ITTAPI, void, metadata_str_add, (const __itt_domain *domain, __itt_id id, __itt_string_handle *key, const char* data, size_t length), (ITT_FORMAT domain, id, key, data, length), metadata_str_add, __itt_group_structure, "%p, %lu, %p, %p, %lu")
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
|
||||
ITT_STUBV(ITTAPI, void, relation_add_to_current, (const __itt_domain *domain, __itt_relation relation, __itt_id tail), (ITT_FORMAT domain, relation, tail), relation_add_to_current, __itt_group_structure, "%p, %lu, %p")
|
||||
ITT_STUBV(ITTAPI, void, relation_add, (const __itt_domain *domain, __itt_id head, __itt_relation relation, __itt_id tail), (ITT_FORMAT domain, head, relation, tail), relation_add, __itt_group_structure, "%p, %p, %lu, %p")
|
||||
|
||||
#ifndef __ITT_INTERNAL_BODY
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
ITT_STUB(LIBITTAPI, __itt_event, event_createA, (const char *name, int namelen), (ITT_FORMAT name, namelen), event_createA, __itt_group_mark | __itt_group_legacy, "\"%s\", %d")
|
||||
ITT_STUB(LIBITTAPI, __itt_event, event_createW, (const wchar_t *name, int namelen), (ITT_FORMAT name, namelen), event_createW, __itt_group_mark | __itt_group_legacy, "\"%S\", %d")
|
||||
#else /* ITT_PLATFORM!=ITT_PLATFORM_WIN */
|
||||
ITT_STUB(LIBITTAPI, __itt_event, event_create, (const char *name, int namelen), (ITT_FORMAT name, namelen), event_create, __itt_group_mark | __itt_group_legacy, "\"%s\", %d")
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
ITT_STUB(LIBITTAPI, int, event_start, (__itt_event event), (ITT_FORMAT event), event_start, __itt_group_mark | __itt_group_legacy, "%d")
|
||||
ITT_STUB(LIBITTAPI, int, event_end, (__itt_event event), (ITT_FORMAT event), event_end, __itt_group_mark | __itt_group_legacy, "%d")
|
||||
#endif /* __ITT_INTERNAL_BODY */
|
||||
|
||||
#ifndef __ITT_INTERNAL_BODY
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
ITT_STUBV(ITTAPI, void, sync_set_nameA, (void *addr, const char *objtype, const char *objname, int attribute), (ITT_FORMAT addr, objtype, objname, attribute), sync_set_nameA, __itt_group_sync | __itt_group_fsync | __itt_group_legacy, "%p, \"%s\", \"%s\", %x")
|
||||
ITT_STUBV(ITTAPI, void, sync_set_nameW, (void *addr, const wchar_t *objtype, const wchar_t *objname, int attribute), (ITT_FORMAT addr, objtype, objname, attribute), sync_set_nameW, __itt_group_sync | __itt_group_fsync | __itt_group_legacy, "%p, \"%S\", \"%S\", %x")
|
||||
#else /* ITT_PLATFORM!=ITT_PLATFORM_WIN */
|
||||
ITT_STUBV(ITTAPI, void, sync_set_name, (void *addr, const char *objtype, const char *objname, int attribute), (ITT_FORMAT addr, objtype, objname, attribute), sync_set_name, __itt_group_sync | __itt_group_fsync | __itt_group_legacy, "p, \"%s\", \"%s\", %x")
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
ITT_STUB(LIBITTAPI, int, notify_sync_nameA, (void *p, const char *objtype, int typelen, const char *objname, int namelen, int attribute), (ITT_FORMAT p, objtype, typelen, objname, namelen, attribute), notify_sync_nameA, __itt_group_sync | __itt_group_fsync | __itt_group_legacy, "%p, \"%s\", %d, \"%s\", %d, %x")
|
||||
ITT_STUB(LIBITTAPI, int, notify_sync_nameW, (void *p, const wchar_t *objtype, int typelen, const wchar_t *objname, int namelen, int attribute), (ITT_FORMAT p, objtype, typelen, objname, namelen, attribute), notify_sync_nameW, __itt_group_sync | __itt_group_fsync | __itt_group_legacy, "%p, \"%S\", %d, \"%S\", %d, %x")
|
||||
#else /* ITT_PLATFORM!=ITT_PLATFORM_WIN */
|
||||
ITT_STUB(LIBITTAPI, int, notify_sync_name, (void *p, const char *objtype, int typelen, const char *objname, int namelen, int attribute), (ITT_FORMAT p, objtype, typelen, objname, namelen, attribute), notify_sync_name, __itt_group_sync | __itt_group_fsync | __itt_group_legacy, "%p, \"%s\", %d, \"%s\", %d, %x")
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
|
||||
ITT_STUBV(LIBITTAPI, void, notify_sync_prepare, (void *p), (ITT_FORMAT p), notify_sync_prepare, __itt_group_sync | __itt_group_fsync | __itt_group_legacy, "%p")
|
||||
ITT_STUBV(LIBITTAPI, void, notify_sync_cancel, (void *p), (ITT_FORMAT p), notify_sync_cancel, __itt_group_sync | __itt_group_fsync | __itt_group_legacy, "%p")
|
||||
ITT_STUBV(LIBITTAPI, void, notify_sync_acquired, (void *p), (ITT_FORMAT p), notify_sync_acquired, __itt_group_sync | __itt_group_fsync | __itt_group_legacy, "%p")
|
||||
ITT_STUBV(LIBITTAPI, void, notify_sync_releasing, (void *p), (ITT_FORMAT p), notify_sync_releasing, __itt_group_sync | __itt_group_fsync | __itt_group_legacy, "%p")
|
||||
#endif /* __ITT_INTERNAL_BODY */
|
||||
|
||||
ITT_STUBV(LIBITTAPI, void, memory_read, (void *addr, size_t size), (ITT_FORMAT addr, size), memory_read, __itt_group_legacy, "%p, %lu")
|
||||
ITT_STUBV(LIBITTAPI, void, memory_write, (void *addr, size_t size), (ITT_FORMAT addr, size), memory_write, __itt_group_legacy, "%p, %lu")
|
||||
ITT_STUBV(LIBITTAPI, void, memory_update, (void *addr, size_t size), (ITT_FORMAT addr, size), memory_update, __itt_group_legacy, "%p, %lu")
|
||||
|
||||
ITT_STUB(LIBITTAPI, __itt_state_t, state_get, (void), (ITT_NO_PARAMS), state_get, __itt_group_legacy, "no args")
|
||||
ITT_STUB(LIBITTAPI, __itt_state_t, state_set, (__itt_state_t s), (ITT_FORMAT s), state_set, __itt_group_legacy, "%d")
|
||||
ITT_STUB(LIBITTAPI, __itt_obj_state_t, obj_mode_set, (__itt_obj_prop_t p, __itt_obj_state_t s), (ITT_FORMAT p, s), obj_mode_set, __itt_group_legacy, "%d, %d")
|
||||
ITT_STUB(LIBITTAPI, __itt_thr_state_t, thr_mode_set, (__itt_thr_prop_t p, __itt_thr_state_t s), (ITT_FORMAT p, s), thr_mode_set, __itt_group_legacy, "%d, %d")
|
||||
|
||||
#ifndef __ITT_INTERNAL_BODY
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
ITT_STUB(ITTAPI, __itt_frame, frame_createA, (const char *domain), (ITT_FORMAT domain), frame_createA, __itt_group_frame, "\"%s\"")
|
||||
ITT_STUB(ITTAPI, __itt_frame, frame_createW, (const wchar_t *domain), (ITT_FORMAT domain), frame_createW, __itt_group_frame, "\"%s\"")
|
||||
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
ITT_STUB(ITTAPI, __itt_frame, frame_create, (const char *domain), (ITT_FORMAT domain), frame_create, __itt_group_frame, "\"%s\"")
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
#endif /* __ITT_INTERNAL_BODY */
|
||||
ITT_STUBV(ITTAPI, void, frame_begin, (__itt_frame frame), (ITT_FORMAT frame), frame_begin, __itt_group_frame, "%p")
|
||||
ITT_STUBV(ITTAPI, void, frame_end, (__itt_frame frame), (ITT_FORMAT frame), frame_end, __itt_group_frame, "%p")
|
||||
|
||||
ITT_STUBV(ITTAPI, void, counter_destroy, (__itt_counter id), (ITT_FORMAT id), counter_destroy, __itt_group_counter, "%p")
|
||||
ITT_STUBV(ITTAPI, void, counter_inc, (__itt_counter id), (ITT_FORMAT id), counter_inc, __itt_group_counter, "%p")
|
||||
ITT_STUBV(ITTAPI, void, counter_inc_delta, (__itt_counter id, unsigned long long value), (ITT_FORMAT id, value), counter_inc_delta, __itt_group_counter, "%p, %lu")
|
||||
ITT_STUBV(ITTAPI, void, counter_dec, (__itt_counter id), (ITT_FORMAT id), counter_dec, __itt_group_counter, "%p")
|
||||
ITT_STUBV(ITTAPI, void, counter_dec_delta, (__itt_counter id, unsigned long long value), (ITT_FORMAT id, value), counter_dec_delta, __itt_group_counter, "%p, %lu")
|
||||
ITT_STUBV(ITTAPI, void, counter_set_value, (__itt_counter id, void *value_ptr), (ITT_FORMAT id, value_ptr), counter_set_value, __itt_group_counter, "%p, %p")
|
||||
ITT_STUBV(ITTAPI, void, counter_set_value_ex, (__itt_counter id, __itt_clock_domain *clock_domain, unsigned long long timestamp, void *value_ptr), (ITT_FORMAT id, clock_domain, timestamp, value_ptr), counter_set_value_ex, __itt_group_counter, "%p, %p, %llu, %p")
|
||||
|
||||
#ifndef __ITT_INTERNAL_BODY
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
ITT_STUB(ITTAPI, __itt_mark_type, mark_createA, (const char *name), (ITT_FORMAT name), mark_createA, __itt_group_mark, "\"%s\"")
|
||||
ITT_STUB(ITTAPI, __itt_mark_type, mark_createW, (const wchar_t *name), (ITT_FORMAT name), mark_createW, __itt_group_mark, "\"%S\"")
|
||||
#else /* ITT_PLATFORM!=ITT_PLATFORM_WIN */
|
||||
ITT_STUB(ITTAPI, __itt_mark_type, mark_create, (const char *name), (ITT_FORMAT name), mark_create, __itt_group_mark, "\"%s\"")
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
#endif /* __ITT_INTERNAL_BODY */
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
ITT_STUB(ITTAPI, int, markA, (__itt_mark_type mt, const char *parameter), (ITT_FORMAT mt, parameter), markA, __itt_group_mark, "%d, \"%s\"")
|
||||
ITT_STUB(ITTAPI, int, markW, (__itt_mark_type mt, const wchar_t *parameter), (ITT_FORMAT mt, parameter), markW, __itt_group_mark, "%d, \"%S\"")
|
||||
#else /* ITT_PLATFORM!=ITT_PLATFORM_WIN */
|
||||
ITT_STUB(ITTAPI, int, mark, (__itt_mark_type mt, const char *parameter), (ITT_FORMAT mt, parameter), mark, __itt_group_mark, "%d, \"%s\"")
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
ITT_STUB(ITTAPI, int, mark_off, (__itt_mark_type mt), (ITT_FORMAT mt), mark_off, __itt_group_mark, "%d")
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
ITT_STUB(ITTAPI, int, mark_globalA, (__itt_mark_type mt, const char *parameter), (ITT_FORMAT mt, parameter), mark_globalA, __itt_group_mark, "%d, \"%s\"")
|
||||
ITT_STUB(ITTAPI, int, mark_globalW, (__itt_mark_type mt, const wchar_t *parameter), (ITT_FORMAT mt, parameter), mark_globalW, __itt_group_mark, "%d, \"%S\"")
|
||||
#else /* ITT_PLATFORM!=ITT_PLATFORM_WIN */
|
||||
ITT_STUB(ITTAPI, int, mark_global, (__itt_mark_type mt, const char *parameter), (ITT_FORMAT mt, parameter), mark_global, __itt_group_mark, "%d, \"%S\"")
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
ITT_STUB(ITTAPI, int, mark_global_off, (__itt_mark_type mt), (ITT_FORMAT mt), mark_global_off, __itt_group_mark, "%d")
|
||||
|
||||
#ifndef __ITT_INTERNAL_BODY
|
||||
ITT_STUB(ITTAPI, __itt_caller, stack_caller_create, (void), (ITT_NO_PARAMS), stack_caller_create, __itt_group_stitch, "no args")
|
||||
#endif /* __ITT_INTERNAL_BODY */
|
||||
ITT_STUBV(ITTAPI, void, stack_caller_destroy, (__itt_caller id), (ITT_FORMAT id), stack_caller_destroy, __itt_group_stitch, "%p")
|
||||
ITT_STUBV(ITTAPI, void, stack_callee_enter, (__itt_caller id), (ITT_FORMAT id), stack_callee_enter, __itt_group_stitch, "%p")
|
||||
ITT_STUBV(ITTAPI, void, stack_callee_leave, (__itt_caller id), (ITT_FORMAT id), stack_callee_leave, __itt_group_stitch, "%p")
|
||||
|
||||
ITT_STUB(ITTAPI, __itt_clock_domain*, clock_domain_create, (__itt_get_clock_info_fn fn, void* fn_data), (ITT_FORMAT fn, fn_data), clock_domain_create, __itt_group_structure, "%p, %p")
|
||||
ITT_STUBV(ITTAPI, void, clock_domain_reset, (void), (ITT_NO_PARAMS), clock_domain_reset, __itt_group_structure, "no args")
|
||||
ITT_STUBV(ITTAPI, void, id_create_ex, (const __itt_domain *domain, __itt_clock_domain* clock_domain, unsigned long long timestamp, __itt_id id), (ITT_FORMAT domain, clock_domain, timestamp, id), id_create_ex, __itt_group_structure, "%p, %p, %lu, %lu")
|
||||
ITT_STUBV(ITTAPI, void, id_destroy_ex, (const __itt_domain *domain, __itt_clock_domain* clock_domain, unsigned long long timestamp, __itt_id id), (ITT_FORMAT domain, clock_domain, timestamp, id), id_destroy_ex, __itt_group_structure, "%p, %p, %lu, %lu")
|
||||
ITT_STUBV(ITTAPI, void, task_begin_ex, (const __itt_domain *domain, __itt_clock_domain* clock_domain, unsigned long long timestamp, __itt_id id, __itt_id parentid, __itt_string_handle *name), (ITT_FORMAT domain, clock_domain, timestamp, id, parentid, name), task_begin_ex, __itt_group_structure, "%p, %p, %lu, %lu, %lu, %p")
|
||||
ITT_STUBV(ITTAPI, void, task_begin_fn_ex, (const __itt_domain *domain, __itt_clock_domain* clock_domain, unsigned long long timestamp, __itt_id id, __itt_id parentid, void* fn), (ITT_FORMAT domain, clock_domain, timestamp, id, parentid, fn), task_begin_fn_ex, __itt_group_structure, "%p, %p, %lu, %lu, %lu, %p")
|
||||
ITT_STUBV(ITTAPI, void, task_end_ex, (const __itt_domain *domain, __itt_clock_domain* clock_domain, unsigned long long timestamp), (ITT_FORMAT domain, clock_domain, timestamp), task_end_ex, __itt_group_structure, "%p, %p, %lu")
|
||||
ITT_STUBV(ITTAPI, void, task_begin_overlapped, (const __itt_domain *domain, __itt_id id, __itt_id parent, __itt_string_handle *name), (ITT_FORMAT domain, id, parent, name), task_begin_overlapped, __itt_group_structure, "%p, %lu, %lu, %p")
|
||||
ITT_STUBV(ITTAPI, void, task_begin_overlapped_ex, (const __itt_domain *domain, __itt_clock_domain* clock_domain, unsigned long long timestamp, __itt_id id, __itt_id parentid, __itt_string_handle *name), (ITT_FORMAT domain, clock_domain, timestamp, id, parentid, name), task_begin_overlapped_ex, __itt_group_structure, "%p, %p, %lu, %lu, %lu, %p")
|
||||
ITT_STUBV(ITTAPI, void, task_end_overlapped, (const __itt_domain *domain, __itt_id id), (ITT_FORMAT domain, id), task_end_overlapped, __itt_group_structure, "%p, %lu")
|
||||
ITT_STUBV(ITTAPI, void, task_end_overlapped_ex, (const __itt_domain *domain, __itt_clock_domain* clock_domain, unsigned long long timestamp, __itt_id id), (ITT_FORMAT domain, clock_domain, timestamp, id), task_end_overlapped_ex, __itt_group_structure, "%p, %p, %lu, %lu")
|
||||
ITT_STUBV(ITTAPI, void, marker_ex, (const __itt_domain *domain, __itt_clock_domain* clock_domain, unsigned long long timestamp, __itt_id id, __itt_string_handle *name, __itt_scope scope), (ITT_FORMAT domain, clock_domain, timestamp, id, name, scope), marker_ex, __itt_group_structure, "%p, %p, %lu, %lu, %p, %d")
|
||||
ITT_STUBV(ITTAPI, void, metadata_add_with_scope, (const __itt_domain *domain, __itt_scope scope, __itt_string_handle *key, __itt_metadata_type type, size_t count, void *data), (ITT_FORMAT domain, scope, key, type, count, data), metadata_add_with_scope, __itt_group_structure, "%p, %d, %p, %d, %lu, %p")
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
ITT_STUBV(ITTAPI, void, metadata_str_add_with_scopeA, (const __itt_domain *domain, __itt_scope scope, __itt_string_handle *key, const char *data, size_t length), (ITT_FORMAT domain, scope, key, data, length), metadata_str_add_with_scopeA, __itt_group_structure, "%p, %d, %p, %p, %lu")
|
||||
ITT_STUBV(ITTAPI, void, metadata_str_add_with_scopeW, (const __itt_domain *domain, __itt_scope scope, __itt_string_handle *key, const wchar_t *data, size_t length), (ITT_FORMAT domain, scope, key, data, length), metadata_str_add_with_scopeW, __itt_group_structure, "%p, %d, %p, %p, %lu")
|
||||
#else /* ITT_PLATFORM!=ITT_PLATFORM_WIN */
|
||||
ITT_STUBV(ITTAPI, void, metadata_str_add_with_scope, (const __itt_domain *domain, __itt_scope scope, __itt_string_handle *key, const char *data, size_t length), (ITT_FORMAT domain, scope, key, data, length), metadata_str_add_with_scope, __itt_group_structure, "%p, %d, %p, %p, %lu")
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
ITT_STUBV(ITTAPI, void, relation_add_to_current_ex, (const __itt_domain *domain, __itt_clock_domain* clock_domain, unsigned long long timestamp, __itt_relation relation, __itt_id tail), (ITT_FORMAT domain, clock_domain, timestamp, relation, tail), relation_add_to_current_ex, __itt_group_structure, "%p, %p, %lu, %d, %lu")
|
||||
ITT_STUBV(ITTAPI, void, relation_add_ex, (const __itt_domain *domain, __itt_clock_domain* clock_domain, unsigned long long timestamp, __itt_id head, __itt_relation relation, __itt_id tail), (ITT_FORMAT domain, clock_domain, timestamp, head, relation, tail), relation_add_ex, __itt_group_structure, "%p, %p, %lu, %lu, %d, %lu")
|
||||
ITT_STUB(ITTAPI, __itt_track_group*, track_group_create, (__itt_string_handle* name, __itt_track_group_type track_group_type), (ITT_FORMAT name, track_group_type), track_group_create, __itt_group_structure, "%p, %d")
|
||||
ITT_STUB(ITTAPI, __itt_track*, track_create, (__itt_track_group* track_group,__itt_string_handle* name, __itt_track_type track_type), (ITT_FORMAT track_group, name, track_type), track_create, __itt_group_structure, "%p, %p, %d")
|
||||
ITT_STUBV(ITTAPI, void, set_track, (__itt_track *track), (ITT_FORMAT track), set_track, __itt_group_structure, "%p")
|
||||
|
||||
#ifndef __ITT_INTERNAL_BODY
|
||||
ITT_STUB(ITTAPI, const char*, api_version, (void), (ITT_NO_PARAMS), api_version, __itt_group_all & ~__itt_group_legacy, "no args")
|
||||
#endif /* __ITT_INTERNAL_BODY */
|
||||
|
||||
#ifndef __ITT_INTERNAL_BODY
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
ITT_STUB(ITTAPI, int, av_saveA, (void *data, int rank, const int *dimensions, int type, const char *filePath, int columnOrder), (ITT_FORMAT data, rank, dimensions, type, filePath, columnOrder), av_saveA, __itt_group_arrays, "%p, %d, %p, %d, \"%s\", %d")
|
||||
ITT_STUB(ITTAPI, int, av_saveW, (void *data, int rank, const int *dimensions, int type, const wchar_t *filePath, int columnOrder), (ITT_FORMAT data, rank, dimensions, type, filePath, columnOrder), av_saveW, __itt_group_arrays, "%p, %d, %p, %d, \"%S\", %d")
|
||||
#else /* ITT_PLATFORM!=ITT_PLATFORM_WIN */
|
||||
ITT_STUB(ITTAPI, int, av_save, (void *data, int rank, const int *dimensions, int type, const char *filePath, int columnOrder), (ITT_FORMAT data, rank, dimensions, type, filePath, columnOrder), av_save, __itt_group_arrays, "%p, %d, %p, %d, \"%s\", %d")
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
#endif /* __ITT_INTERNAL_BODY */
|
||||
|
||||
#ifndef __ITT_INTERNAL_BODY
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
ITT_STUBV(ITTAPI, void, module_loadA, (void *start_addr, void* end_addr, const char *path), (ITT_FORMAT start_addr, end_addr, path), module_loadA, __itt_group_none, "%p, %p, %p")
|
||||
ITT_STUBV(ITTAPI, void, module_loadW, (void *start_addr, void* end_addr, const wchar_t *path), (ITT_FORMAT start_addr, end_addr, path), module_loadW, __itt_group_none, "%p, %p, %p")
|
||||
#else /* ITT_PLATFORM!=ITT_PLATFORM_WIN */
|
||||
ITT_STUBV(ITTAPI, void, module_load, (void *start_addr, void *end_addr, const char *path), (ITT_FORMAT start_addr, end_addr, path), module_load, __itt_group_none, "%p, %p, %p")
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
#endif /* __ITT_INTERNAL_BODY */
|
||||
|
||||
|
||||
#endif /* __ITT_INTERNAL_INIT */
|
@ -1,10 +1,10 @@
|
||||
/*
|
||||
/* <copyright>
|
||||
This file is provided under a dual BSD/GPLv2 license. When using or
|
||||
redistributing this file, you may do so under either license.
|
||||
|
||||
GPL LICENSE SUMMARY
|
||||
|
||||
Copyright (c) 2005-2012 Intel Corporation. All rights reserved.
|
||||
Copyright (c) 2005-2014 Intel Corporation. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of version 2 of the GNU General Public License as
|
||||
@ -26,7 +26,7 @@
|
||||
|
||||
BSD LICENSE
|
||||
|
||||
Copyright (c) 2005-2012 Intel Corporation. All rights reserved.
|
||||
Copyright (c) 2005-2014 Intel Corporation. All rights reserved.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
@ -54,7 +54,8 @@
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
</copyright> */
|
||||
|
||||
#ifndef _ITTNOTIFY_TYPES_H_
|
||||
#define _ITTNOTIFY_TYPES_H_
|
||||
|
||||
|
@ -1,10 +1,10 @@
|
||||
/*
|
||||
/* <copyright>
|
||||
This file is provided under a dual BSD/GPLv2 license. When using or
|
||||
redistributing this file, you may do so under either license.
|
||||
|
||||
GPL LICENSE SUMMARY
|
||||
|
||||
Copyright (c) 2005-2012 Intel Corporation. All rights reserved.
|
||||
Copyright (c) 2005-2014 Intel Corporation. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of version 2 of the GNU General Public License as
|
||||
@ -26,7 +26,7 @@
|
||||
|
||||
BSD LICENSE
|
||||
|
||||
Copyright (c) 2005-2012 Intel Corporation. All rights reserved.
|
||||
Copyright (c) 2005-2014 Intel Corporation. All rights reserved.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
@ -54,22 +54,21 @@
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
</copyright> */
|
||||
|
||||
#include "vtune/ittnotify_config.h"
|
||||
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
#include <windows.h>
|
||||
#pragma optimize("", off)
|
||||
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
#include <pthread.h>
|
||||
#include <dlfcn.h>
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
#if ITT_PLATFORM != ITT_PLATFORM_MAC && ITT_PLATFORM != ITT_PLATFORM_FREEBSD
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "vtune/jitprofiling.h"
|
||||
|
||||
static const char rcsid[] = "\n@(#) $Revision: 294150 $\n";
|
||||
static const char rcsid[] = "\n@(#) $Revision: 471937 $\n";
|
||||
|
||||
#define DLL_ENVIRONMENT_VAR "VS_PROFILER"
|
||||
|
||||
@ -84,7 +83,10 @@ static const char rcsid[] = "\n@(#) $Revision: 294150 $\n";
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
#define DEFAULT_DLLNAME "JitPI.dll"
|
||||
HINSTANCE m_libHandle = NULL;
|
||||
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
#elif ITT_PLATFORM==ITT_PLATFORM_MAC
|
||||
#define DEFAULT_DLLNAME "libJitPI.dylib"
|
||||
void* m_libHandle = NULL;
|
||||
#else
|
||||
#define DEFAULT_DLLNAME "libJitPI.so"
|
||||
void* m_libHandle = NULL;
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
@ -93,191 +95,62 @@ void* m_libHandle = NULL;
|
||||
#define ANDROID_JIT_AGENT_PATH "/data/intel/libittnotify.so"
|
||||
|
||||
/* the function pointers */
|
||||
typedef unsigned int(*TPInitialize)(void);
|
||||
typedef unsigned int(JITAPI *TPInitialize)(void);
|
||||
static TPInitialize FUNC_Initialize=NULL;
|
||||
|
||||
typedef unsigned int(*TPNotify)(unsigned int, void*);
|
||||
typedef unsigned int(JITAPI *TPNotify)(unsigned int, void*);
|
||||
static TPNotify FUNC_NotifyEvent=NULL;
|
||||
|
||||
static iJIT_IsProfilingActiveFlags executionMode = iJIT_NOTHING_RUNNING;
|
||||
|
||||
/* end collector dll part. */
|
||||
|
||||
/* loadiJIT_Funcs() : this function is called just in the beginning
|
||||
* and is responsible to load the functions from BistroJavaCollector.dll
|
||||
/* loadiJIT_Funcs() : this function is called just in the beginning
|
||||
* and is responsible to load the functions from BistroJavaCollector.dll
|
||||
* result:
|
||||
* on success: the functions loads, iJIT_DLL_is_missing=0, return value = 1
|
||||
* on failure: the functions are NULL, iJIT_DLL_is_missing=1, return value = 0
|
||||
*/
|
||||
*/
|
||||
static int loadiJIT_Funcs(void);
|
||||
|
||||
/* global representing whether the BistroJavaCollector can't be loaded */
|
||||
/* global representing whether the collector can't be loaded */
|
||||
static int iJIT_DLL_is_missing = 0;
|
||||
|
||||
/* Virtual stack - the struct is used as a virtual stack for each thread.
|
||||
* Every thread initializes with a stack of size INIT_TOP_STACK.
|
||||
* Every method entry decreases from the current stack point,
|
||||
* and when a thread stack reaches its top of stack (return from the global
|
||||
* function), the top of stack and the current stack increase. Notice that
|
||||
* when returning from a function the stack pointer is the address of
|
||||
* the function return.
|
||||
*/
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
static DWORD threadLocalStorageHandle = 0;
|
||||
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
static pthread_key_t threadLocalStorageHandle = (pthread_key_t)0;
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
|
||||
#define INIT_TOP_Stack 10000
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned int TopStack;
|
||||
unsigned int CurrentStack;
|
||||
} ThreadStack, *pThreadStack;
|
||||
|
||||
/* end of virtual stack. */
|
||||
|
||||
/*
|
||||
* The function for reporting virtual-machine related events to VTune.
|
||||
* Note: when reporting iJVM_EVENT_TYPE_ENTER_NIDS, there is no need to fill
|
||||
* in the stack_id field in the iJIT_Method_NIDS structure, as VTune fills it.
|
||||
* The return value in iJVM_EVENT_TYPE_ENTER_NIDS &&
|
||||
* iJVM_EVENT_TYPE_LEAVE_NIDS events will be 0 in case of failure.
|
||||
* in iJVM_EVENT_TYPE_METHOD_LOAD_FINISHED event
|
||||
* it will be -1 if EventSpecificData == 0 otherwise it will be 0.
|
||||
*/
|
||||
|
||||
ITT_EXTERN_C int JITAPI
|
||||
ITT_EXTERN_C int JITAPI
|
||||
iJIT_NotifyEvent(iJIT_JVM_EVENT event_type, void *EventSpecificData)
|
||||
{
|
||||
int ReturnValue;
|
||||
int ReturnValue = 0;
|
||||
|
||||
/*
|
||||
* This section is for debugging outside of VTune.
|
||||
* It creates the environment variables that indicates call graph mode.
|
||||
* If running outside of VTune remove the remark.
|
||||
*
|
||||
*
|
||||
* static int firstTime = 1;
|
||||
* char DoCallGraph[12] = "DoCallGraph";
|
||||
* if (firstTime)
|
||||
* {
|
||||
* firstTime = 0;
|
||||
* SetEnvironmentVariable( "BISTRO_COLLECTORS_DO_CALLGRAPH", DoCallGraph);
|
||||
* }
|
||||
*
|
||||
* end of section.
|
||||
*/
|
||||
|
||||
/* initialization part - the functions have not been loaded yet. This part
|
||||
* will load the functions, and check if we are in Call Graph mode.
|
||||
* (for special treatment).
|
||||
*/
|
||||
if (!FUNC_NotifyEvent)
|
||||
/* initialization part - the collector has not been loaded yet. */
|
||||
if (!FUNC_NotifyEvent)
|
||||
{
|
||||
if (iJIT_DLL_is_missing)
|
||||
if (iJIT_DLL_is_missing)
|
||||
return 0;
|
||||
|
||||
/* load the Function from the DLL */
|
||||
if (!loadiJIT_Funcs())
|
||||
if (!loadiJIT_Funcs())
|
||||
return 0;
|
||||
|
||||
/* Call Graph initialization. */
|
||||
}
|
||||
|
||||
/* If the event is method entry/exit, check that in the current mode
|
||||
* VTune is allowed to receive it
|
||||
*/
|
||||
if ((event_type == iJVM_EVENT_TYPE_ENTER_NIDS ||
|
||||
event_type == iJVM_EVENT_TYPE_LEAVE_NIDS) &&
|
||||
(executionMode != iJIT_CALLGRAPH_ON))
|
||||
if (event_type == iJVM_EVENT_TYPE_METHOD_LOAD_FINISHED ||
|
||||
event_type == iJVM_EVENT_TYPE_METHOD_UPDATE)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
/* This section is performed when method enter event occurs.
|
||||
* It updates the virtual stack, or creates it if this is the first
|
||||
* method entry in the thread. The stack pointer is decreased.
|
||||
*/
|
||||
if (event_type == iJVM_EVENT_TYPE_ENTER_NIDS)
|
||||
{
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
pThreadStack threadStack =
|
||||
(pThreadStack)TlsGetValue (threadLocalStorageHandle);
|
||||
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
pThreadStack threadStack =
|
||||
(pThreadStack)pthread_getspecific(threadLocalStorageHandle);
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
|
||||
/* check for use of reserved method IDs */
|
||||
if ( ((piJIT_Method_NIDS) EventSpecificData)->method_id <= 999 )
|
||||
return 0;
|
||||
|
||||
if (!threadStack)
|
||||
{
|
||||
/* initialize the stack. */
|
||||
threadStack = (pThreadStack) calloc (sizeof(ThreadStack), 1);
|
||||
if (!threadStack)
|
||||
return 0;
|
||||
threadStack->TopStack = INIT_TOP_Stack;
|
||||
threadStack->CurrentStack = INIT_TOP_Stack;
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
TlsSetValue(threadLocalStorageHandle,(void*)threadStack);
|
||||
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
pthread_setspecific(threadLocalStorageHandle,(void*)threadStack);
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
}
|
||||
|
||||
/* decrease the stack. */
|
||||
((piJIT_Method_NIDS) EventSpecificData)->stack_id =
|
||||
(threadStack->CurrentStack)--;
|
||||
}
|
||||
|
||||
/* This section is performed when method leave event occurs
|
||||
* It updates the virtual stack.
|
||||
* Increases the stack pointer.
|
||||
* If the stack pointer reached the top (left the global function)
|
||||
* increase the pointer and the top pointer.
|
||||
*/
|
||||
if (event_type == iJVM_EVENT_TYPE_LEAVE_NIDS)
|
||||
{
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
pThreadStack threadStack =
|
||||
(pThreadStack)TlsGetValue (threadLocalStorageHandle);
|
||||
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
pThreadStack threadStack =
|
||||
(pThreadStack)pthread_getspecific(threadLocalStorageHandle);
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
|
||||
/* check for use of reserved method IDs */
|
||||
if ( ((piJIT_Method_NIDS) EventSpecificData)->method_id <= 999 )
|
||||
return 0;
|
||||
|
||||
if (!threadStack)
|
||||
{
|
||||
/* Error: first report in this thread is method exit */
|
||||
exit (1);
|
||||
}
|
||||
|
||||
((piJIT_Method_NIDS) EventSpecificData)->stack_id =
|
||||
++(threadStack->CurrentStack) + 1;
|
||||
|
||||
if (((piJIT_Method_NIDS) EventSpecificData)->stack_id
|
||||
> threadStack->TopStack)
|
||||
((piJIT_Method_NIDS) EventSpecificData)->stack_id =
|
||||
(unsigned int)-1;
|
||||
}
|
||||
|
||||
if (event_type == iJVM_EVENT_TYPE_METHOD_LOAD_FINISHED)
|
||||
{
|
||||
/* check for use of reserved method IDs */
|
||||
if ( ((piJIT_Method_Load) EventSpecificData)->method_id <= 999 )
|
||||
if (((piJIT_Method_Load)EventSpecificData)->method_id == 0)
|
||||
return 0;
|
||||
}
|
||||
else if (event_type == iJVM_EVENT_TYPE_METHOD_LOAD_FINISHED_V2)
|
||||
{
|
||||
/* check for use of reserved method IDs */
|
||||
if ( ((piJIT_Method_Load_V2) EventSpecificData)->method_id <= 999 )
|
||||
if (((piJIT_Method_Load_V2)EventSpecificData)->method_id == 0)
|
||||
return 0;
|
||||
}
|
||||
else if (event_type == iJVM_EVENT_TYPE_METHOD_LOAD_FINISHED_V3)
|
||||
{
|
||||
if (((piJIT_Method_Load_V3)EventSpecificData)->method_id == 0)
|
||||
return 0;
|
||||
}
|
||||
else if (event_type == iJVM_EVENT_TYPE_METHOD_INLINE_LOAD_FINISHED)
|
||||
{
|
||||
if (((piJIT_Method_Inline_Load)EventSpecificData)->method_id == 0 ||
|
||||
((piJIT_Method_Inline_Load)EventSpecificData)->parent_method_id == 0)
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -286,26 +159,6 @@ iJIT_NotifyEvent(iJIT_JVM_EVENT event_type, void *EventSpecificData)
|
||||
return ReturnValue;
|
||||
}
|
||||
|
||||
/* The new mode call back routine */
|
||||
ITT_EXTERN_C void JITAPI
|
||||
iJIT_RegisterCallbackEx(void *userdata, iJIT_ModeChangedEx
|
||||
NewModeCallBackFuncEx)
|
||||
{
|
||||
/* is it already missing... or the load of functions from the DLL failed */
|
||||
if (iJIT_DLL_is_missing || !loadiJIT_Funcs())
|
||||
{
|
||||
/* then do not bother with notifications */
|
||||
NewModeCallBackFuncEx(userdata, iJIT_NO_NOTIFICATIONS);
|
||||
/* Error: could not load JIT functions. */
|
||||
return;
|
||||
}
|
||||
/* nothing to do with the callback */
|
||||
}
|
||||
|
||||
/*
|
||||
* This function allows the user to query in which mode, if at all,
|
||||
*VTune is running
|
||||
*/
|
||||
ITT_EXTERN_C iJIT_IsProfilingActiveFlags JITAPI iJIT_IsProfilingActive()
|
||||
{
|
||||
if (!iJIT_DLL_is_missing)
|
||||
@ -316,11 +169,10 @@ ITT_EXTERN_C iJIT_IsProfilingActiveFlags JITAPI iJIT_IsProfilingActive()
|
||||
return executionMode;
|
||||
}
|
||||
|
||||
/* this function loads the collector dll (BistroJavaCollector)
|
||||
* and the relevant functions.
|
||||
/* This function loads the collector dll and the relevant functions.
|
||||
* on success: all functions load, iJIT_DLL_is_missing = 0, return value = 1
|
||||
* on failure: all functions are NULL, iJIT_DLL_is_missing = 1, return value = 0
|
||||
*/
|
||||
*/
|
||||
static int loadiJIT_Funcs()
|
||||
{
|
||||
static int bDllWasLoaded = 0;
|
||||
@ -339,7 +191,7 @@ static int loadiJIT_Funcs()
|
||||
iJIT_DLL_is_missing = 1;
|
||||
FUNC_NotifyEvent = NULL;
|
||||
|
||||
if (m_libHandle)
|
||||
if (m_libHandle)
|
||||
{
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
FreeLibrary(m_libHandle);
|
||||
@ -356,15 +208,18 @@ static int loadiJIT_Funcs()
|
||||
{
|
||||
DWORD envret = 0;
|
||||
dllName = (char*)malloc(sizeof(char) * (dNameLength + 1));
|
||||
envret = GetEnvironmentVariableA(NEW_DLL_ENVIRONMENT_VAR,
|
||||
dllName, dNameLength);
|
||||
if (envret)
|
||||
if(dllName != NULL)
|
||||
{
|
||||
/* Try to load the dll from the PATH... */
|
||||
m_libHandle = LoadLibraryExA(dllName,
|
||||
NULL, LOAD_WITH_ALTERED_SEARCH_PATH);
|
||||
envret = GetEnvironmentVariableA(NEW_DLL_ENVIRONMENT_VAR,
|
||||
dllName, dNameLength);
|
||||
if (envret)
|
||||
{
|
||||
/* Try to load the dll from the PATH... */
|
||||
m_libHandle = LoadLibraryExA(dllName,
|
||||
NULL, LOAD_WITH_ALTERED_SEARCH_PATH);
|
||||
}
|
||||
free(dllName);
|
||||
}
|
||||
free(dllName);
|
||||
} else {
|
||||
/* Try to use old VS_PROFILER variable */
|
||||
dNameLength = GetEnvironmentVariableA(DLL_ENVIRONMENT_VAR, NULL, 0);
|
||||
@ -372,21 +227,24 @@ static int loadiJIT_Funcs()
|
||||
{
|
||||
DWORD envret = 0;
|
||||
dllName = (char*)malloc(sizeof(char) * (dNameLength + 1));
|
||||
envret = GetEnvironmentVariableA(DLL_ENVIRONMENT_VAR,
|
||||
dllName, dNameLength);
|
||||
if (envret)
|
||||
if(dllName != NULL)
|
||||
{
|
||||
/* Try to load the dll from the PATH... */
|
||||
m_libHandle = LoadLibraryA(dllName);
|
||||
envret = GetEnvironmentVariableA(DLL_ENVIRONMENT_VAR,
|
||||
dllName, dNameLength);
|
||||
if (envret)
|
||||
{
|
||||
/* Try to load the dll from the PATH... */
|
||||
m_libHandle = LoadLibraryA(dllName);
|
||||
}
|
||||
free(dllName);
|
||||
}
|
||||
free(dllName);
|
||||
}
|
||||
}
|
||||
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
dllName = getenv(NEW_DLL_ENVIRONMENT_VAR);
|
||||
if (!dllName)
|
||||
dllName = getenv(DLL_ENVIRONMENT_VAR);
|
||||
#ifdef ANDROID
|
||||
#if defined(__ANDROID__) || defined(ANDROID)
|
||||
if (!dllName)
|
||||
dllName = ANDROID_JIT_AGENT_PATH;
|
||||
#endif
|
||||
@ -409,8 +267,8 @@ static int loadiJIT_Funcs()
|
||||
/* if the dll wasn't loaded - exit. */
|
||||
if (!m_libHandle)
|
||||
{
|
||||
iJIT_DLL_is_missing = 1; /* don't try to initialize
|
||||
* JIT agent the second time
|
||||
iJIT_DLL_is_missing = 1; /* don't try to initialize
|
||||
* JIT agent the second time
|
||||
*/
|
||||
return 0;
|
||||
}
|
||||
@ -442,84 +300,12 @@ static int loadiJIT_Funcs()
|
||||
bDllWasLoaded = 1;
|
||||
iJIT_DLL_is_missing = 0; /* DLL is ok. */
|
||||
|
||||
/*
|
||||
* Call Graph mode: init the thread local storage
|
||||
* (need to store the virtual stack there).
|
||||
*/
|
||||
if ( executionMode == iJIT_CALLGRAPH_ON )
|
||||
{
|
||||
/* Allocate a thread local storage slot for the thread "stack" */
|
||||
if (!threadLocalStorageHandle)
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
threadLocalStorageHandle = TlsAlloc();
|
||||
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
pthread_key_create(&threadLocalStorageHandle, NULL);
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* This function should be called by the user whenever a thread ends,
|
||||
* to free the thread "virtual stack" storage
|
||||
*/
|
||||
ITT_EXTERN_C void JITAPI FinalizeThread()
|
||||
{
|
||||
if (threadLocalStorageHandle)
|
||||
{
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
pThreadStack threadStack =
|
||||
(pThreadStack)TlsGetValue (threadLocalStorageHandle);
|
||||
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
pThreadStack threadStack =
|
||||
(pThreadStack)pthread_getspecific(threadLocalStorageHandle);
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
if (threadStack)
|
||||
{
|
||||
free (threadStack);
|
||||
threadStack = NULL;
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
TlsSetValue (threadLocalStorageHandle, threadStack);
|
||||
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
pthread_setspecific(threadLocalStorageHandle, threadStack);
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* This function should be called by the user when the process ends,
|
||||
* to free the local storage index
|
||||
*/
|
||||
ITT_EXTERN_C void JITAPI FinalizeProcess()
|
||||
{
|
||||
if (m_libHandle)
|
||||
{
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
FreeLibrary(m_libHandle);
|
||||
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
dlclose(m_libHandle);
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
m_libHandle = NULL;
|
||||
}
|
||||
|
||||
if (threadLocalStorageHandle)
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
TlsFree (threadLocalStorageHandle);
|
||||
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
pthread_key_delete(threadLocalStorageHandle);
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
}
|
||||
|
||||
/*
|
||||
* This function should be called by the user for any method once.
|
||||
* The function will return a unique method ID, the user should maintain
|
||||
* the ID for each method
|
||||
*/
|
||||
ITT_EXTERN_C unsigned int JITAPI iJIT_GetNewMethodID()
|
||||
{
|
||||
static unsigned int methodID = 0x100000;
|
||||
static unsigned int methodID = 1;
|
||||
|
||||
if (methodID == 0)
|
||||
return 0; /* ERROR : this is not a valid value */
|
||||
|
@ -1,10 +1,10 @@
|
||||
/*
|
||||
/* <copyright>
|
||||
This file is provided under a dual BSD/GPLv2 license. When using or
|
||||
redistributing this file, you may do so under either license.
|
||||
|
||||
GPL LICENSE SUMMARY
|
||||
|
||||
Copyright (c) 2005-2013 Intel Corporation. All rights reserved.
|
||||
Copyright (c) 2005-2014 Intel Corporation. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of version 2 of the GNU General Public License as
|
||||
@ -26,7 +26,7 @@
|
||||
|
||||
BSD LICENSE
|
||||
|
||||
Copyright (c) 2005-2013 Intel Corporation. All rights reserved.
|
||||
Copyright (c) 2005-2014 Intel Corporation. All rights reserved.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
@ -54,7 +54,7 @@
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
</copyright> */
|
||||
|
||||
#ifndef __JITPROFILING_H__
|
||||
#define __JITPROFILING_H__
|
||||
@ -70,11 +70,11 @@
|
||||
* associated with JIT-compiled code.
|
||||
*
|
||||
* These APIs can be used to\n
|
||||
* **Profile trace-based and method-based JIT-compiled
|
||||
* code**. Some examples of environments that you can profile with this APIs:
|
||||
* dynamic JIT compilation of JavaScript code traces, OpenCL JIT execution,
|
||||
* Java/.NET managed execution environments, and custom ISV JIT engines.
|
||||
*
|
||||
* - **Profile trace-based and method-based JIT-compiled
|
||||
* code**. Some examples of environments that you can profile with these APIs:
|
||||
* dynamic JIT compilation of JavaScript code traces, JIT execution in OpenCL(TM)
|
||||
* software technology, Java/.NET managed execution environments, and custom
|
||||
* ISV JIT engines.
|
||||
* @code
|
||||
* #include <jitprofiling.h>
|
||||
*
|
||||
@ -94,8 +94,8 @@
|
||||
* iJIT_NotifyEvent(iJVM_EVENT_TYPE_SHUTDOWN, NULL);
|
||||
* @endcode
|
||||
*
|
||||
* * Expected behaviour:
|
||||
* * If any iJVM_EVENT_TYPE_METHOD_LOAD_FINISHED event overwrites
|
||||
* * Expected behavior:
|
||||
* * If any iJVM_EVENT_TYPE_METHOD_LOAD_FINISHED event overwrites an
|
||||
* already reported method, then such a method becomes invalid and its
|
||||
* memory region is treated as unloaded. VTune Amplifier displays the metrics
|
||||
* collected by the method until it is overwritten.
|
||||
@ -104,15 +104,15 @@
|
||||
* the first line number.
|
||||
* * Dynamically generated code can be associated with a module name.
|
||||
* Use the iJIT_Method_Load_V2 structure.\n
|
||||
* Clarification of some cases:\n
|
||||
* * If you register a function with the same method ID multiple times
|
||||
* Clarification of some cases:
|
||||
* * If you register a function with the same method ID multiple times,
|
||||
* specifying different module names, then the VTune Amplifier picks up
|
||||
* the module name registered first. If you want to distinguish the same
|
||||
* function between different JIT engines, supply different method IDs for
|
||||
* each function. Other symbolic information (for example, source file)
|
||||
* can be identical.
|
||||
*
|
||||
* **Analyze split functions** (multiple joint or disjoint code regions
|
||||
* - **Analyze split functions** (multiple joint or disjoint code regions
|
||||
* belonging to the same function) **including re-JIT**
|
||||
* with potential overlapping of code regions in time, which is common in
|
||||
* resource-limited environments.
|
||||
@ -123,45 +123,44 @@
|
||||
*
|
||||
* iJIT_Method_Load a = {0};
|
||||
* a.method_id = method_id;
|
||||
* a.method_load_address = acode_addr;
|
||||
* a.method_size = acode_size;
|
||||
* a.method_load_address = 0x100;
|
||||
* a.method_size = 0x20;
|
||||
*
|
||||
* iJIT_Method_Load b = {0};
|
||||
* b.method_id = method_id;
|
||||
* b.method_load_address = baddr_second;
|
||||
* b.method_size = bsize_second;
|
||||
* b.method_load_address = 0x200;
|
||||
* b.method_size = 0x30;
|
||||
*
|
||||
* iJIT_NotifyEvent(iJVM_EVENT_TYPE_METHOD_LOAD_FINISHED, (void*)&a);
|
||||
* iJIT_NotifyEvent(iJVM_EVENT_TYPE_METHOD_LOAD_FINISHED, (void*)&b);
|
||||
* @endcode
|
||||
*
|
||||
* * Expected behaviour:
|
||||
* * If a iJVM_EVENT_TYPE_METHOD_LOAD_FINISHED event overwrites
|
||||
* * If a iJVM_EVENT_TYPE_METHOD_LOAD_FINISHED event overwrites an
|
||||
* already reported method, then such a method becomes invalid and
|
||||
* its memory region is treated as unloaded.
|
||||
* * All code regions reported with the same method ID are considered as
|
||||
* belonging to the same method. Symbolic information (method name,
|
||||
* source file name) will be taken from the first notification, all
|
||||
* source file name) will be taken from the first notification, and all
|
||||
* subsequent notifications with the same method ID will be processed
|
||||
* only for line number table information. So, the VTune Amplifier will map
|
||||
* samples to a source line using the line number table from the current
|
||||
* notification while taking source file name from the very first one.\n
|
||||
* notification while taking the source file name from the very first one.\n
|
||||
* Clarification of some cases:\n
|
||||
* * If you register a second code region with a different source file
|
||||
* name and the same method ID, then this information will be saved and
|
||||
* will not be considered as an extension of the first code region, but
|
||||
* VTune Amplifier will use source file of the first code region and map
|
||||
* VTune Amplifier will use the source file of the first code region and map
|
||||
* performance metrics incorrectly.
|
||||
* * If you register a second code region with the same source file as
|
||||
* for the first region and the same method ID, then source file will be
|
||||
* for the first region and the same method ID, then the source file will be
|
||||
* discarded but VTune Amplifier will map metrics to the source file correctly.
|
||||
* * If you register a second code region with a null source file and
|
||||
* the same method ID, then provided line number info will be associated
|
||||
* with the source file of the first code region.
|
||||
*
|
||||
* **Explore inline functions** including multi-level hierarchy of
|
||||
* nested inlines to see how performance metrics are distributed through them.
|
||||
*
|
||||
* - **Explore inline functions** including multi-level hierarchy of
|
||||
* nested inline methods which shows how performance metrics are distributed through them.
|
||||
* @code
|
||||
* #include <jitprofiling.h>
|
||||
*
|
||||
@ -194,25 +193,24 @@
|
||||
*
|
||||
* * Requirements:
|
||||
* * Each inline (iJIT_Method_Inline_Load) method should be associated
|
||||
* with two method IDs: one for itself, one for its immediate parent.
|
||||
* with two method IDs: one for itself; one for its immediate parent.
|
||||
* * Address regions of inline methods of the same parent method cannot
|
||||
* overlap each other.
|
||||
* * Execution of the parent method must not be started until it and all
|
||||
* its inlines are reported.
|
||||
* its inline methods are reported.
|
||||
* * Expected behaviour:
|
||||
* * In case of nested inlines an order of
|
||||
* * In case of nested inline methods an order of
|
||||
* iJVM_EVENT_TYPE_METHOD_INLINE_LOAD_FINISHED events is not important.
|
||||
* * If any event overwrites either inline method or top parent method,
|
||||
* then the parent including inlines becomes invalid and its memory
|
||||
* then the parent, including inline methods, becomes invalid and its memory
|
||||
* region is treated as unloaded.
|
||||
*
|
||||
* **Life time of allocated data**\n
|
||||
* The client sends an event notification to the agent with event-specific
|
||||
* data, which is a structure. The pointers in the structure refers to memory
|
||||
* data, which is a structure. The pointers in the structure refer to memory
|
||||
* allocated by the client, which responsible for releasing it. The pointers are
|
||||
* used by the iJIT_NotifyEvent method to copy client's data in a trace file
|
||||
* used by the iJIT_NotifyEvent method to copy client's data in a trace file,
|
||||
* and they are not used after the iJIT_NotifyEvent method returns.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -222,31 +220,29 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* @enum iJIT_jvm_event
|
||||
* @brief Enumerator for the types of notifications
|
||||
*/
|
||||
typedef enum iJIT_jvm_event
|
||||
{
|
||||
iJVM_EVENT_TYPE_SHUTDOWN = 2, /**< Send to shutdown the agent.
|
||||
iJVM_EVENT_TYPE_SHUTDOWN = 2, /**<\brief Send this to shutdown the agent.
|
||||
* Use NULL for event data. */
|
||||
|
||||
iJVM_EVENT_TYPE_METHOD_LOAD_FINISHED = 13, /**< Send when a dynamic code is
|
||||
iJVM_EVENT_TYPE_METHOD_LOAD_FINISHED = 13, /**<\brief Send when dynamic code is
|
||||
* JIT compiled and loaded into
|
||||
* memory by the JIT engine but
|
||||
* memory by the JIT engine, but
|
||||
* before the code is executed.
|
||||
* Use iJIT_Method_Load as event
|
||||
* data. */
|
||||
/** @cond exclude_from_documentation */
|
||||
iJVM_EVENT_TYPE_METHOD_UNLOAD_START, /**< Send when a compiled dynamic
|
||||
iJVM_EVENT_TYPE_METHOD_UNLOAD_START, /**<\brief Send when compiled dynamic
|
||||
* code is being unloaded from memory.
|
||||
* Use iJIT_Method_Load as event data.*/
|
||||
/** @endcond */
|
||||
|
||||
//TODO: add a note that line info assumes from method load
|
||||
iJVM_EVENT_TYPE_METHOD_UPDATE, /**< Send to provide a new content for
|
||||
* an early reported dynamic code.
|
||||
* The previous content will be invalidate
|
||||
* starting from time of the notification.
|
||||
iJVM_EVENT_TYPE_METHOD_UPDATE, /**<\brief Send to provide new content for
|
||||
* a previously reported dynamic code.
|
||||
* The previous content will be invalidated
|
||||
* starting from the time of the notification.
|
||||
* Use iJIT_Method_Load as event data but
|
||||
* required fields are following:
|
||||
* - method_id identify the code to update.
|
||||
@ -256,103 +252,46 @@ typedef enum iJIT_jvm_event
|
||||
* - method_size specify length of updated code
|
||||
* range. */
|
||||
|
||||
iJVM_EVENT_TYPE_METHOD_INLINE_LOAD_FINISHED, /**< Send when an inline dynamic
|
||||
|
||||
iJVM_EVENT_TYPE_METHOD_INLINE_LOAD_FINISHED, /**<\brief Send when an inline dynamic
|
||||
* code is JIT compiled and loaded
|
||||
* into memory by the JIT engine
|
||||
* into memory by the JIT engine,
|
||||
* but before the parent code region
|
||||
* is started executing.
|
||||
* starts executing.
|
||||
* Use iJIT_Method_Inline_Load as event data.*/
|
||||
|
||||
/** @cond exclude_from_documentation */
|
||||
/* Legacy stuff. Do not use it. */
|
||||
iJVM_EVENT_TYPE_ENTER_NIDS = 19,
|
||||
iJVM_EVENT_TYPE_LEAVE_NIDS,
|
||||
iJVM_EVENT_TYPE_METHOD_UPDATE_V2,
|
||||
/** @endcond */
|
||||
|
||||
iJVM_EVENT_TYPE_METHOD_LOAD_FINISHED_V2 /**< Send when a dynamic code is
|
||||
* JIT compiled and loaded into
|
||||
* memory by the JIT engine but
|
||||
* before the code is executed.
|
||||
* Use iJIT_Method_Load_V2 as event
|
||||
* data. */
|
||||
iJVM_EVENT_TYPE_METHOD_LOAD_FINISHED_V2 = 21, /**<\brief Send when a dynamic code is
|
||||
* JIT compiled and loaded into
|
||||
* memory by the JIT engine, but
|
||||
* before the code is executed.
|
||||
* Use iJIT_Method_Load_V2 as event data. */
|
||||
|
||||
iJVM_EVENT_TYPE_METHOD_LOAD_FINISHED_V3 /**<\brief Send when a dynamic code is
|
||||
* JIT compiled and loaded into
|
||||
* memory by the JIT engine, but
|
||||
* before the code is executed.
|
||||
* Use iJIT_Method_Load_V3 as event data. */
|
||||
} iJIT_JVM_EVENT;
|
||||
|
||||
/** @cond exclude_from_documentation */
|
||||
/* Legacy stuff. Do not use it. */
|
||||
typedef enum _iJIT_ModeFlags
|
||||
{
|
||||
iJIT_NO_NOTIFICATIONS = 0x0000,
|
||||
iJIT_BE_NOTIFY_ON_LOAD = 0x0001,
|
||||
iJIT_BE_NOTIFY_ON_UNLOAD = 0x0002,
|
||||
iJIT_BE_NOTIFY_ON_METHOD_ENTRY = 0x0004,
|
||||
iJIT_BE_NOTIFY_ON_METHOD_EXIT = 0x0008
|
||||
|
||||
} iJIT_ModeFlags;
|
||||
/** @endcond */
|
||||
|
||||
/**
|
||||
* @enum _iJIT_IsProfilingActiveFlags
|
||||
* @brief Enumerator for the agent's mode
|
||||
*/
|
||||
typedef enum _iJIT_IsProfilingActiveFlags
|
||||
{
|
||||
iJIT_NOTHING_RUNNING = 0x0000, /**< The agent is not running.
|
||||
iJIT_NOTHING_RUNNING = 0x0000, /**<\brief The agent is not running;
|
||||
* iJIT_NotifyEvent calls will
|
||||
* not be processed. */
|
||||
iJIT_SAMPLING_ON = 0x0001, /**< The agent is running and
|
||||
iJIT_SAMPLING_ON = 0x0001, /**<\brief The agent is running and
|
||||
* ready to process notifications. */
|
||||
|
||||
/** @cond exclude_from_documentation */
|
||||
/* Legacy. Call Graph is running */
|
||||
iJIT_CALLGRAPH_ON = 0x0002
|
||||
/** @endcond */
|
||||
|
||||
} iJIT_IsProfilingActiveFlags;
|
||||
|
||||
/** @cond exclude_from_documentation */
|
||||
/* Legacy stuff. Do not use it. */
|
||||
typedef enum _iJDEnvironmentType
|
||||
{
|
||||
iJDE_JittingAPI = 2
|
||||
|
||||
} iJDEnvironmentType;
|
||||
|
||||
typedef struct _iJIT_Method_Id
|
||||
{
|
||||
unsigned int method_id;
|
||||
|
||||
} *piJIT_Method_Id, iJIT_Method_Id;
|
||||
|
||||
typedef struct _iJIT_Method_NIDS
|
||||
{
|
||||
unsigned int method_id; /**< Unique method ID */
|
||||
unsigned int stack_id; /**< NOTE: no need to fill this field,
|
||||
* it's filled by VTune Amplifier */
|
||||
char* method_name; /**< Method name (just the method, without the class) */
|
||||
|
||||
} *piJIT_Method_NIDS, iJIT_Method_NIDS;
|
||||
/** @endcond */
|
||||
|
||||
typedef enum _iJIT_CodeType
|
||||
{
|
||||
iJIT_CT_UNKNOWN = 0,
|
||||
iJIT_CT_CODE, // executable code
|
||||
iJIT_CT_DATA, // this kind of "update" will be excluded from the function's body.
|
||||
iJIT_CT_EOF
|
||||
} iJIT_CodeType;
|
||||
|
||||
typedef struct _iJIT_Method_Update
|
||||
{
|
||||
unsigned int method_id;
|
||||
void* load_address;
|
||||
unsigned int size;
|
||||
iJIT_CodeType type;
|
||||
|
||||
} *piJIT_Method_Update, iJIT_Method_Update;
|
||||
|
||||
/**
|
||||
* @details Describes a single entry in the line number information of
|
||||
* a code region that gives information about how the reported code region
|
||||
* @brief Description of a single entry in the line number information of a code region.
|
||||
* @details A table of line number entries gives information about how the reported code region
|
||||
* is mapped to source file.
|
||||
* Intel(R) VTune(TM) Amplifier uses line number information to attribute
|
||||
* the samples (virtual address) to a line number. \n
|
||||
@ -365,7 +304,7 @@ typedef struct _iJIT_Method_Update
|
||||
* 18 1
|
||||
* 21 30
|
||||
*
|
||||
* VTune(TM) Amplifier XE contsructs the following table using the client data
|
||||
* VTune Amplifier constructs the following table using the client data
|
||||
*
|
||||
* Code subrange Line number
|
||||
* 0-1 2
|
||||
@ -377,188 +316,344 @@ typedef struct _iJIT_Method_Update
|
||||
*/
|
||||
typedef struct _LineNumberInfo
|
||||
{
|
||||
unsigned int Offset; /**< Offset from the begining of the code region. */
|
||||
unsigned int LineNumber; /**< Matching source line number offset (from beginning of source file). */
|
||||
unsigned int Offset; /**<\brief Offset from the begining of the code region. */
|
||||
unsigned int LineNumber; /**<\brief Matching source line number offset (from beginning of source file). */
|
||||
|
||||
} *pLineNumberInfo, LineNumberInfo;
|
||||
|
||||
/**
|
||||
* Description of a JIT-compiled method
|
||||
* @brief Enumerator for the code architecture.
|
||||
*/
|
||||
typedef enum _iJIT_CodeArchitecture
|
||||
{
|
||||
iJIT_CA_NATIVE = 0, /**<\brief Native to the process architecture that is calling it. */
|
||||
|
||||
iJIT_CA_32, /**<\brief 32-bit machine code. */
|
||||
|
||||
iJIT_CA_64 /**<\brief 64-bit machine code. */
|
||||
|
||||
} iJIT_CodeArchitecture;
|
||||
|
||||
#pragma pack(push, 8)
|
||||
|
||||
/**
|
||||
* @brief Description of a JIT-compiled method
|
||||
* @details When you use the iJIT_Method_Load structure to describe
|
||||
* the JIT compiled method, use iJVM_EVENT_TYPE_METHOD_LOAD_FINISHED
|
||||
* as an event type to report it.
|
||||
*/
|
||||
typedef struct _iJIT_Method_Load
|
||||
{
|
||||
unsigned int method_id; /**< Unique method ID.
|
||||
* Method ID cannot be smaller than 999.
|
||||
* Either you use the API function
|
||||
unsigned int method_id; /**<\brief Unique method ID. Cannot be 0.
|
||||
* You must either use the API function
|
||||
* iJIT_GetNewMethodID to get a valid and unique
|
||||
* method ID, or you take care of ID uniqueness
|
||||
* method ID, or else manage ID uniqueness
|
||||
* and correct range by yourself.\n
|
||||
* You must use the same method ID for all code
|
||||
* regions of the same method, otherwise different
|
||||
* method IDs mean different methods. */
|
||||
* method IDs specify different methods. */
|
||||
|
||||
char* method_name; /** The name of the method. It can be optionally
|
||||
char* method_name; /**<\brief The name of the method. It can be optionally
|
||||
* prefixed with its class name and appended with
|
||||
* its complete signature. Can't be NULL. */
|
||||
* its complete signature. Can't be NULL. */
|
||||
|
||||
void* method_load_address; /** The start virtual address of the method code
|
||||
* region. If NULL that data provided with
|
||||
void* method_load_address; /**<\brief The start virtual address of the method code
|
||||
* region. If NULL, data provided with
|
||||
* event are not accepted. */
|
||||
|
||||
unsigned int method_size; /** The code size of the method in memory.
|
||||
unsigned int method_size; /**<\brief The code size of the method in memory.
|
||||
* If 0, then data provided with the event are not
|
||||
* accepted. */
|
||||
|
||||
unsigned int line_number_size; /** The number of entries in the line number
|
||||
unsigned int line_number_size; /**<\brief The number of entries in the line number
|
||||
* table.0 if none. */
|
||||
|
||||
pLineNumberInfo line_number_table; /** Pointer to the line numbers info
|
||||
pLineNumberInfo line_number_table; /**<\brief Pointer to the line numbers info
|
||||
* array. Can be NULL if
|
||||
* line_number_size is 0. See
|
||||
* LineNumberInfo Structure for a
|
||||
* description of a single entry in
|
||||
* the line number info array */
|
||||
|
||||
unsigned int class_id; /** This field is obsolete. */
|
||||
unsigned int class_id; /**<\brief This field is obsolete. */
|
||||
|
||||
char* class_file_name; /** Class name. Can be NULL.*/
|
||||
char* class_file_name; /**<\brief Class name. Can be NULL.*/
|
||||
|
||||
char* source_file_name; /** Source file name. Can be NULL.*/
|
||||
|
||||
void* user_data; /** This field is obsolete. */
|
||||
|
||||
unsigned int user_data_size; /** This field is obsolete. */
|
||||
|
||||
iJDEnvironmentType env; /** This field is obsolete. */
|
||||
char* source_file_name; /**<\brief Source file name. Can be NULL.*/
|
||||
|
||||
} *piJIT_Method_Load, iJIT_Method_Load;
|
||||
|
||||
#pragma pack(push, 8)
|
||||
/**
|
||||
* Description of a JIT-compiled method
|
||||
*
|
||||
* When you use the iJIT_Method_Load_V2 structure to describe
|
||||
* @brief Description of a JIT-compiled method
|
||||
* @details When you use the iJIT_Method_Load_V2 structure to describe
|
||||
* the JIT compiled method, use iJVM_EVENT_TYPE_METHOD_LOAD_FINISHED_V2
|
||||
* as an event type to report it.
|
||||
*/
|
||||
typedef struct _iJIT_Method_Load_V2
|
||||
{
|
||||
unsigned int method_id; /**< Unique method ID.
|
||||
* Method ID cannot be smaller than 999.
|
||||
* Either you use the API function
|
||||
unsigned int method_id; /**<\brief Unique method ID. Cannot be 0.
|
||||
* You must either use the API function
|
||||
* iJIT_GetNewMethodID to get a valid and unique
|
||||
* method ID, or you take care of ID uniqueness
|
||||
* method ID, or else manage ID uniqueness
|
||||
* and correct range by yourself.\n
|
||||
* You must use the same method ID for all code
|
||||
* regions of the same method, otherwise different
|
||||
* method IDs mean different methods. */
|
||||
* method IDs specify different methods. */
|
||||
|
||||
char* method_name; /** The name of the method. It can be optionally
|
||||
char* method_name; /**<\brief The name of the method. It can be optionally
|
||||
* prefixed with its class name and appended with
|
||||
* its complete signature. Can't be NULL. */
|
||||
|
||||
void* method_load_address; /** The start virtual address of the method code
|
||||
* region. If NULL that data provided with
|
||||
void* method_load_address; /**<\brief The start virtual address of the method code
|
||||
* region. If NULL, then data provided with the
|
||||
* event are not accepted. */
|
||||
|
||||
unsigned int method_size; /** The code size of the method in memory.
|
||||
unsigned int method_size; /**<\brief The code size of the method in memory.
|
||||
* If 0, then data provided with the event are not
|
||||
* accepted. */
|
||||
|
||||
unsigned int line_number_size; /** The number of entries in the line number
|
||||
* table.0 if none. */
|
||||
unsigned int line_number_size; /**<\brief The number of entries in the line number
|
||||
* table. 0 if none. */
|
||||
|
||||
pLineNumberInfo line_number_table; /** Pointer to the line numbers info
|
||||
pLineNumberInfo line_number_table; /**<\brief Pointer to the line numbers info
|
||||
* array. Can be NULL if
|
||||
* line_number_size is 0. See
|
||||
* LineNumberInfo Structure for a
|
||||
* description of a single entry in
|
||||
* the line number info array */
|
||||
* the line number info array. */
|
||||
|
||||
char* class_file_name; /** Class name. Can be NULL.*/
|
||||
char* class_file_name; /**<\brief Class name. Can be NULL. */
|
||||
|
||||
char* source_file_name; /** Source file name. Can be NULL.*/
|
||||
char* source_file_name; /**<\brief Source file name. Can be NULL. */
|
||||
|
||||
char* module_name; /** Module name. Can be NULL.
|
||||
char* module_name; /**<\brief Module name. Can be NULL.
|
||||
The module name can be useful for distinguishing among
|
||||
different JIT engines. Intel VTune Amplifier will display
|
||||
reported methods split by specified modules */
|
||||
different JIT engines. VTune Amplifier will display
|
||||
reported methods grouped by specific module. */
|
||||
|
||||
} *piJIT_Method_Load_V2, iJIT_Method_Load_V2;
|
||||
#pragma pack(pop)
|
||||
|
||||
/**
|
||||
* Description of an inline JIT-compiled method
|
||||
* @brief Description of a JIT-compiled method
|
||||
* @details The iJIT_Method_Load_V3 structure is the same as iJIT_Method_Load_V2
|
||||
* with a newly introduced 'arch' field that specifies architecture of the code region.
|
||||
* When you use the iJIT_Method_Load_V3 structure to describe
|
||||
* the JIT compiled method, use iJVM_EVENT_TYPE_METHOD_LOAD_FINISHED_V3
|
||||
* as an event type to report it.
|
||||
*/
|
||||
typedef struct _iJIT_Method_Load_V3
|
||||
{
|
||||
unsigned int method_id; /**<\brief Unique method ID. Cannot be 0.
|
||||
* You must either use the API function
|
||||
* iJIT_GetNewMethodID to get a valid and unique
|
||||
* method ID, or manage ID uniqueness
|
||||
* and correct range by yourself.\n
|
||||
* You must use the same method ID for all code
|
||||
* regions of the same method, otherwise they are
|
||||
* treated as regions of different methods. */
|
||||
|
||||
char* method_name; /**<\brief The name of the method. It can be optionally
|
||||
* prefixed with its class name and appended with
|
||||
* its complete signature. Cannot be NULL. */
|
||||
|
||||
void* method_load_address; /**<\brief The start virtual address of the method code
|
||||
* region. If NULL, then data provided with the
|
||||
* event are not accepted. */
|
||||
|
||||
unsigned int method_size; /**<\brief The code size of the method in memory.
|
||||
* If 0, then data provided with the event are not
|
||||
* accepted. */
|
||||
|
||||
unsigned int line_number_size; /**<\brief The number of entries in the line number
|
||||
* table. 0 if none. */
|
||||
|
||||
pLineNumberInfo line_number_table; /**<\brief Pointer to the line numbers info
|
||||
* array. Can be NULL if
|
||||
* line_number_size is 0. See
|
||||
* LineNumberInfo Structure for a
|
||||
* description of a single entry in
|
||||
* the line number info array. */
|
||||
|
||||
char* class_file_name; /**<\brief Class name. Can be NULL. */
|
||||
|
||||
char* source_file_name; /**<\brief Source file name. Can be NULL. */
|
||||
|
||||
char* module_name; /**<\brief Module name. Can be NULL.
|
||||
* The module name can be useful for distinguishing among
|
||||
* different JIT engines. VTune Amplifier will display
|
||||
* reported methods grouped by specific module. */
|
||||
|
||||
iJIT_CodeArchitecture module_arch; /**<\brief Architecture of the method's code region.
|
||||
* By default, it is the same as the process
|
||||
* architecture that is calling it.
|
||||
* For example, you can use it if your 32-bit JIT
|
||||
* engine generates 64-bit code.
|
||||
*
|
||||
* If JIT engine reports both 32-bit and 64-bit types
|
||||
* of methods then VTune Amplifier splits the methods
|
||||
* with the same module name but with different
|
||||
* architectures in two different modules. VTune Amplifier
|
||||
* modifies the original name provided with a 64-bit method
|
||||
* version by ending it with '(64)' */
|
||||
|
||||
} *piJIT_Method_Load_V3, iJIT_Method_Load_V3;
|
||||
|
||||
/**
|
||||
* @brief Description of an inline JIT-compiled method
|
||||
* @details When you use the_iJIT_Method_Inline_Load structure to describe
|
||||
* the JIT compiled method, use iJVM_EVENT_TYPE_METHOD_INLINE_LOAD_FINISHED
|
||||
* as an event type to report it.
|
||||
*/
|
||||
typedef struct _iJIT_Method_Inline_Load
|
||||
{
|
||||
unsigned int method_id; /**< Unique method ID.
|
||||
* Method ID cannot be smaller than 999.
|
||||
* Either you use the API function
|
||||
unsigned int method_id; /**<\brief Unique method ID. Cannot be 0.
|
||||
* You must either use the API function
|
||||
* iJIT_GetNewMethodID to get a valid and unique
|
||||
* method ID, or you take care of ID uniqueness
|
||||
* method ID, or else manage ID uniqueness
|
||||
* and correct range by yourself. */
|
||||
|
||||
unsigned int parent_method_id; /** Unique immediate parent's method ID.
|
||||
* Method ID may not be smaller than 999.
|
||||
* Either you use the API function
|
||||
unsigned int parent_method_id; /**<\brief Unique immediate parent's method ID.
|
||||
* Cannot be 0.
|
||||
* You must either use the API function
|
||||
* iJIT_GetNewMethodID to get a valid and unique
|
||||
* method ID, or you take care of ID uniqueness
|
||||
* method ID, or else manage ID uniqueness
|
||||
* and correct range by yourself. */
|
||||
|
||||
char* method_name; /** The name of the method. It can be optionally
|
||||
char* method_name; /**<\brief The name of the method. It can be optionally
|
||||
* prefixed with its class name and appended with
|
||||
* its complete signature. Can't be NULL. */
|
||||
* its complete signature. Can't be NULL. */
|
||||
|
||||
void* method_load_address; /** The virtual address on which the method
|
||||
* is inlined. If NULL, then data provided with
|
||||
* the event are not accepted. */
|
||||
void* method_load_address; /** <\brief The virtual address on which the method
|
||||
* is inlined. If NULL, then data provided with
|
||||
* the event are not accepted. */
|
||||
|
||||
unsigned int method_size; /** The code size of the method in memory.
|
||||
* If 0 that data provided with event are not
|
||||
unsigned int method_size; /**<\brief The code size of the method in memory.
|
||||
* If 0, then data provided with the event are not
|
||||
* accepted. */
|
||||
|
||||
unsigned int line_number_size; /** The number of entries in the line number
|
||||
unsigned int line_number_size; /**<\brief The number of entries in the line number
|
||||
* table. 0 if none. */
|
||||
|
||||
pLineNumberInfo line_number_table; /** Pointer to the line numbers info
|
||||
pLineNumberInfo line_number_table; /**<\brief Pointer to the line numbers info
|
||||
* array. Can be NULL if
|
||||
* line_number_size is 0. See
|
||||
* LineNumberInfo Structure for a
|
||||
* description of a single entry in
|
||||
* the line number info array */
|
||||
|
||||
char* class_file_name; /** Class name. Can be NULL.*/
|
||||
char* class_file_name; /**<\brief Class name. Can be NULL.*/
|
||||
|
||||
char* source_file_name; /** Source file name. Can be NULL.*/
|
||||
char* source_file_name; /**<\brief Source file name. Can be NULL.*/
|
||||
|
||||
} *piJIT_Method_Inline_Load, iJIT_Method_Inline_Load;
|
||||
|
||||
/** @cond exclude_from_documentation */
|
||||
/**
|
||||
* @brief Description of a segment type
|
||||
* @details Use the segment type to specify a type of data supplied
|
||||
* with the iJVM_EVENT_TYPE_METHOD_UPDATE_V2 event to be applied to
|
||||
* a certain code trace.
|
||||
*/
|
||||
typedef enum _iJIT_SegmentType
|
||||
{
|
||||
iJIT_CT_UNKNOWN = 0,
|
||||
|
||||
iJIT_CT_CODE, /**<\brief Executable code. */
|
||||
|
||||
iJIT_CT_DATA, /**<\brief Data (not executable code).
|
||||
* VTune Amplifier uses the format string
|
||||
* (see iJIT_Method_Update) to represent
|
||||
* this data in the VTune Amplifier GUI */
|
||||
|
||||
iJIT_CT_KEEP, /**<\brief Use the previous markup for the trace.
|
||||
* Can be used for the following
|
||||
* iJVM_EVENT_TYPE_METHOD_UPDATE_V2 events,
|
||||
* if the type of the previously reported segment
|
||||
* type is the same. */
|
||||
iJIT_CT_EOF
|
||||
} iJIT_SegmentType;
|
||||
|
||||
/**
|
||||
* @brief Description of a dynamic update of the content within JIT-compiled method
|
||||
* @details The JIT engine may generate the methods that are updated at runtime
|
||||
* partially by mixed (data + executable code) content. When you use the iJIT_Method_Update
|
||||
* structure to describe the update of the content within a JIT-compiled method,
|
||||
* use iJVM_EVENT_TYPE_METHOD_UPDATE_V2 as an event type to report it.
|
||||
*
|
||||
* On the first Update event, VTune Amplifier copies the original code range reported by
|
||||
* the iJVM_EVENT_TYPE_METHOD_LOAD event, then modifies it with the supplied bytes and
|
||||
* adds the modified range to the original method. For next update events, VTune Amplifier
|
||||
* does the same but it uses the latest modified version of a code region for update.
|
||||
* Eventually, VTune Amplifier GUI displays multiple code ranges for the method reported by
|
||||
* the iJVM_EVENT_TYPE_METHOD_LOAD event.
|
||||
* Notes:
|
||||
* - Multiple update events with different types for the same trace are allowed
|
||||
* but they must be reported for the same code ranges.
|
||||
* Example,
|
||||
* @code
|
||||
* [-- data---] Allowed
|
||||
* [-- code --] Allowed
|
||||
* [code] Ignored
|
||||
* [-- data---] Allowed
|
||||
* [-- code --] Allowed
|
||||
* [------------ trace ---------]
|
||||
* @endcode
|
||||
* - The types of previously reported events can be changed but they must be reported
|
||||
* for the same code ranges.
|
||||
* Example,
|
||||
* @code
|
||||
* [-- data---] Allowed
|
||||
* [-- code --] Allowed
|
||||
* [-- data---] Allowed
|
||||
* [-- code --] Allowed
|
||||
* [------------ trace ---------]
|
||||
* @endcode
|
||||
*/
|
||||
|
||||
typedef struct _iJIT_Method_Update
|
||||
{
|
||||
void* load_address; /**<\brief Start address of the update within a method */
|
||||
|
||||
unsigned int size; /**<\brief The update size */
|
||||
|
||||
iJIT_SegmentType type; /**<\brief Type of the update */
|
||||
|
||||
const char* data_format; /**<\brief C string that contains a format string
|
||||
* that follows the same specifications as format in printf.
|
||||
* The format string is used for iJIT_CT_CODE only
|
||||
* and cannot be NULL.
|
||||
* Format can be changed on the fly. */
|
||||
} *piJIT_Method_Update, iJIT_Method_Update;
|
||||
|
||||
/** @endcond */
|
||||
|
||||
#pragma pack(pop)
|
||||
|
||||
/** @cond exclude_from_documentation */
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#ifndef CDECL
|
||||
#ifndef JITAPI_CDECL
|
||||
# if defined WIN32 || defined _WIN32
|
||||
# define CDECL __cdecl
|
||||
# define JITAPI_CDECL __cdecl
|
||||
# else /* defined WIN32 || defined _WIN32 */
|
||||
# if defined _M_X64 || defined _M_AMD64 || defined __x86_64__
|
||||
# define CDECL /* not actual on x86_64 platform */
|
||||
# else /* _M_X64 || _M_AMD64 || __x86_64__ */
|
||||
# define CDECL __attribute__ ((cdecl))
|
||||
# endif /* _M_X64 || _M_AMD64 || __x86_64__ */
|
||||
# if defined _M_IX86 || defined __i386__
|
||||
# define JITAPI_CDECL __attribute__ ((cdecl))
|
||||
# else /* _M_IX86 || __i386__ */
|
||||
# define JITAPI_CDECL /* actual only on x86_64 platform */
|
||||
# endif /* _M_IX86 || __i386__ */
|
||||
# endif /* defined WIN32 || defined _WIN32 */
|
||||
#endif /* CDECL */
|
||||
#endif /* JITAPI_CDECL */
|
||||
|
||||
#define JITAPI CDECL
|
||||
#define JITAPI JITAPI_CDECL
|
||||
/** @endcond */
|
||||
|
||||
/**
|
||||
* @brief Generates a new unique method ID.
|
||||
*
|
||||
* You must use this API to obtain unique and valid method IDs for methods or
|
||||
* traces reported to the agent if you don't have you own mechanism to generate
|
||||
* traces reported to the agent if you don't have your own mechanism to generate
|
||||
* unique method IDs.
|
||||
*
|
||||
* @return a new unique method ID. When out of unique method IDs, this API
|
||||
@ -579,26 +674,15 @@ iJIT_IsProfilingActiveFlags JITAPI iJIT_IsProfilingActive(void);
|
||||
*
|
||||
* The reported information is used to attribute samples obtained from any
|
||||
* Intel(R) VTune(TM) Amplifier collector. This API needs to be called
|
||||
* after JIT compilation and before the first entry into the JIT compiled
|
||||
* after JIT compilation and before the first entry into the JIT-compiled
|
||||
* code.
|
||||
*
|
||||
* @param[in] event_type - type of the data sent to the agent
|
||||
* @param[in] EventSpecificData - pointer to event-specific data
|
||||
*
|
||||
*
|
||||
* @returns 1 on success, otherwise 0.
|
||||
*/
|
||||
int JITAPI iJIT_NotifyEvent(iJIT_JVM_EVENT event_type, void* EventSpecificData);
|
||||
|
||||
/** @cond exclude_from_documentation */
|
||||
/*
|
||||
* Do not use these legacy APIs, which are here for backward compatibility
|
||||
* with Intel(R) VTune(TM) Performance Analyzer.
|
||||
*/
|
||||
typedef void (*iJIT_ModeChangedEx)(void* UserData, iJIT_ModeFlags Flags);
|
||||
void JITAPI iJIT_RegisterCallbackEx(void* userdata,
|
||||
iJIT_ModeChangedEx NewModeCallBackFuncEx);
|
||||
void JITAPI FinalizeThread(void);
|
||||
void JITAPI FinalizeProcess(void);
|
||||
int JITAPI iJIT_NotifyEvent(iJIT_JVM_EVENT event_type, void *EventSpecificData);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
1039
js/src/vtune/legacy/ittnotify.h
Normal file
1039
js/src/vtune/legacy/ittnotify.h
Normal file
File diff suppressed because it is too large
Load Diff
@ -148,7 +148,7 @@ SendCodeRangesToProfiler(CodeSegment& cs, const Bytes& bytecode, const Metadata&
|
||||
enabled |= PerfFuncEnabled();
|
||||
#endif
|
||||
#ifdef MOZ_VTUNE
|
||||
enabled |= IsVTuneProfilingActive();
|
||||
enabled |= vtune::IsProfilingActive();
|
||||
#endif
|
||||
if (!enabled)
|
||||
return;
|
||||
@ -180,21 +180,9 @@ SendCodeRangesToProfiler(CodeSegment& cs, const Bytes& bytecode, const Metadata&
|
||||
}
|
||||
#endif
|
||||
#ifdef MOZ_VTUNE
|
||||
if (IsVTuneProfilingActive()) {
|
||||
unsigned method_id = iJIT_GetNewMethodID();
|
||||
if (method_id == 0)
|
||||
return;
|
||||
iJIT_Method_Load method;
|
||||
method.method_id = method_id;
|
||||
method.method_name = name.begin();
|
||||
method.method_load_address = (void*)start;
|
||||
method.method_size = size;
|
||||
method.line_number_size = 0;
|
||||
method.line_number_table = nullptr;
|
||||
method.class_id = 0;
|
||||
method.class_file_name = nullptr;
|
||||
method.source_file_name = nullptr;
|
||||
iJIT_NotifyEvent(iJVM_EVENT_TYPE_METHOD_LOAD_FINISHED, (void*)&method);
|
||||
if (vtune::IsProfilingActive()) {
|
||||
cs.vtune_method_id_ = vtune::GenerateUniqueMethodID();
|
||||
vtune::MarkWasm(cs, name.begin(), (void*)start, size);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@ -261,6 +249,7 @@ CodeSegment::~CodeSegment()
|
||||
if (!bytes_)
|
||||
return;
|
||||
|
||||
|
||||
MOZ_ASSERT(wasmCodeAllocations > 0);
|
||||
wasmCodeAllocations--;
|
||||
|
||||
@ -268,7 +257,11 @@ CodeSegment::~CodeSegment()
|
||||
|
||||
// Match AllocateCodeSegment.
|
||||
uint32_t size = JS_ROUNDUP(length(), ExecutableCodePageSize);
|
||||
#ifdef MOZ_VTUNE
|
||||
vtune::UnmarkBytes(bytes_, size);
|
||||
#endif
|
||||
DeallocateExecutableMemory(bytes_, size);
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -60,6 +60,12 @@ class CodeSegment
|
||||
// The profiling mode may be changed dynamically.
|
||||
bool profilingEnabled_;
|
||||
|
||||
public:
|
||||
#ifdef MOZ_VTUNE
|
||||
unsigned vtune_method_id_; // Zero if unset.
|
||||
#endif
|
||||
|
||||
protected:
|
||||
CodeSegment() { PodZero(this); }
|
||||
template <class> friend struct js::MallocProvider;
|
||||
|
||||
|
@ -5867,7 +5867,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
<p>This license applies to certain files in the directory
|
||||
<span class="path">js/src/vtune</span>.</p>
|
||||
<pre>
|
||||
Copyright (c) 2005-2012 Intel Corporation. All rights reserved.
|
||||
Copyright (c) 2011 Intel Corporation.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
|
Loading…
Reference in New Issue
Block a user