mirror of
https://github.com/JakeHillion/object-introspection.git
synced 2024-11-09 21:24:14 +00:00
9e2b48d713
Summary: Changes jitlog to use a memfd, an anonymous in memory file descriptor, rather than a file on disk. Also clean up this fd at the end of an OID run rather than leaving it in the hope it's valid next time. A previous attempt to land this used a `char*` from the OID process space in the remote target syscall. Somehow this works with our integration test target, but not globally. Changed to use the previous behaviour of putting the syscall arg in the empty text segment. In doing this I noticed that the text segment wouldn't be initialised at this point on a fresh process, so we were copying into effectively an uninitialised address. Move the jit log fd setup to after the segment setup accordingly. Test plan: - CI - Tested on an integration test target as before. Works. - Created a new target that definitely doesn't have this string in (simple for loop). Failed before, works now. Example: ```sh $ OID_TEST_ARGS='-fjit-logging' stest OidIntegration.simple_struct ... I1121 02:57:36.136890 500897 OIDebugger.cpp:269] Outputting JIT logs: I1121 02:57:36.136896 500897 OIDebugger.cpp:272] JITLOG: SimpleStruct @00007ffc639be180 I1121 02:57:36.136899 500897 OIDebugger.cpp:272] JITLOG: a @00007ffc639be180 I1121 02:57:36.136901 500897 OIDebugger.cpp:272] JITLOG: obj @00007ffc639be180 I1121 02:57:36.136904 500897 OIDebugger.cpp:272] JITLOG: b @00007ffc639be184 I1121 02:57:36.136905 500897 OIDebugger.cpp:272] JITLOG: obj @00007ffc639be184 I1121 02:57:36.136907 500897 OIDebugger.cpp:272] JITLOG: c @00007ffc639be188 I1121 02:57:36.136909 500897 OIDebugger.cpp:272] JITLOG: obj @00007ffc639be188 I1121 02:57:36.136911 500897 OIDebugger.cpp:278] Finished outputting JIT logs. ... ``` |
||
---|---|---|
.. | ||
exporters | ||
support | ||
type_graph | ||
types/test | ||
CMakeLists.txt | ||
CodeGen.cpp | ||
CodeGen.h | ||
Config.cpp | ||
Config.h | ||
ContainerInfo.cpp | ||
ContainerInfo.h | ||
ContainerTypeEnum.h | ||
Descs.cpp | ||
Descs.h | ||
DrgnUtils.cpp | ||
DrgnUtils.h | ||
EnumBitset.h | ||
Features.cpp | ||
Features.h | ||
FuncGen.cpp | ||
FuncGen.h | ||
Headers.h | ||
IntrospectionResult.cpp | ||
Metrics.cpp | ||
Metrics.h | ||
OICache.cpp | ||
OICache.h | ||
OICodeGen.cpp | ||
OICodeGen.h | ||
OICompiler.cpp | ||
OICompiler.h | ||
OID.cpp | ||
OIDebugger.cpp | ||
OIDebugger.h | ||
OIGenerator.cpp | ||
OIGenerator.h | ||
OILexer.h | ||
OILexer.l | ||
OILibrary.cpp | ||
OILibraryImpl.cpp | ||
OILibraryImpl.h | ||
OIOpts.h | ||
OIParser.h | ||
OIParser.yy | ||
OITraceCode.cpp | ||
PaddingHunter.cpp | ||
PaddingHunter.h | ||
Portability.h | ||
Serialize.cpp | ||
Serialize.h | ||
SymbolService.cpp | ||
SymbolService.h | ||
Syscall.h | ||
TimeUtils.h | ||
TrapInfo.h | ||
TreeBuilder.cpp | ||
TreeBuilder.h | ||
TypeHierarchy.h | ||
X86InstDefs.h |