LLVM 22.0.0git
PerfSupportPlugin.h
Go to the documentation of this file.
1//===----- PerfSupportPlugin.h ----- Utils for perf support -----*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// Handles support for registering code with perf
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef LLVM_EXECUTIONENGINE_ORC_PERFSUPPORTPLUGIN_H
14#define LLVM_EXECUTIONENGINE_ORC_PERFSUPPORTPLUGIN_H
15
18
21
22namespace llvm {
23namespace orc {
24
25/// Log perf jitdump events for each object (see
26/// https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/tools/perf/Documentation/jitdump-specification.txt).
27/// Currently has support for dumping code load records and unwind info records.
29public:
31 ExecutorAddr RegisterPerfStartAddr,
32 ExecutorAddr RegisterPerfEndAddr,
33 ExecutorAddr RegisterPerfImplAddr, bool EmitDebugInfo,
34 bool EmitUnwindInfo);
36
39 jitlink::PassConfiguration &Config) override;
40
44
46 return Error::success();
47 }
48
50 ResourceKey SrcKey) override {}
51
53 Create(ExecutorProcessControl &EPC, JITDylib &JD, bool EmitDebugInfo,
54 bool EmitUnwindInfo);
55
56private:
58 ExecutorAddr RegisterPerfStartAddr;
59 ExecutorAddr RegisterPerfEndAddr;
60 ExecutorAddr RegisterPerfImplAddr;
61 std::atomic<uint64_t> CodeIndex;
62 bool EmitDebugInfo;
63 bool EmitUnwindInfo;
64};
65
66} // namespace orc
67} // namespace llvm
68
69#endif // LLVM_EXECUTIONENGINE_ORC_PERFSUPPORTPLUGIN_H
#define LLVM_ABI
Definition Compiler.h:213
static void EmitUnwindInfo(MCStreamer &streamer, WinEH::FrameInfo *info)
#define G(x, y, z)
Definition MD5.cpp:56
Lightweight error class with error context and mandatory checking.
Definition Error.h:159
static ErrorSuccess success()
Create a success value.
Definition Error.h:336
Tagged union holding either a T or a Error.
Definition Error.h:485
Represents an address in the executor process.
ExecutorProcessControl supports interaction with a JIT target process.
Represents a JIT'd dynamic library.
Definition Core.h:902
Plugin instances can be added to the ObjectLinkingLayer to receive callbacks when code is loaded or e...
Tracks responsibility for materialization, and mediates interactions between MaterializationUnits and...
Definition Core.h:576
Error notifyFailed(MaterializationResponsibility &MR) override
void modifyPassConfig(MaterializationResponsibility &MR, jitlink::LinkGraph &G, jitlink::PassConfiguration &Config) override
PerfSupportPlugin(ExecutorProcessControl &EPC, ExecutorAddr RegisterPerfStartAddr, ExecutorAddr RegisterPerfEndAddr, ExecutorAddr RegisterPerfImplAddr, bool EmitDebugInfo, bool EmitUnwindInfo)
Error notifyRemovingResources(JITDylib &JD, ResourceKey K) override
void notifyTransferringResources(JITDylib &JD, ResourceKey DstKey, ResourceKey SrcKey) override
uintptr_t ResourceKey
Definition Core.h:75
This is an optimization pass for GlobalISel generic memory operations.