LLVM 19.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
17
20
21namespace llvm {
22namespace orc {
23
24/// Log perf jitdump events for each object (see
25/// https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/tools/perf/Documentation/jitdump-specification.txt).
26/// Currently has support for dumping code load records and unwind info records.
28public:
30 ExecutorAddr RegisterPerfStartAddr,
31 ExecutorAddr RegisterPerfEndAddr,
32 ExecutorAddr RegisterPerfImplAddr, bool EmitDebugInfo,
33 bool EmitUnwindInfo);
35
39
41 return Error::success();
42 }
43
45 return Error::success();
46 }
47
49 ResourceKey SrcKey) override {}
50
52 Create(ExecutorProcessControl &EPC, JITDylib &JD, bool EmitDebugInfo,
53 bool EmitUnwindInfo);
54
55private:
57 ExecutorAddr RegisterPerfStartAddr;
58 ExecutorAddr RegisterPerfEndAddr;
59 ExecutorAddr RegisterPerfImplAddr;
60 std::atomic<uint64_t> CodeIndex;
61 bool EmitDebugInfo;
62 bool EmitUnwindInfo;
63};
64
65} // namespace orc
66} // namespace llvm
67
68#endif // LLVM_EXECUTIONENGINE_ORC_PERFSUPPORTPLUGIN_H
RelaxConfig Config
Definition: ELF_riscv.cpp:506
#define G(x, y, z)
Definition: MD5.cpp:56
Lightweight error class with error context and mandatory checking.
Definition: Error.h:160
static ErrorSuccess success()
Create a success value.
Definition: Error.h:334
Tagged union holding either a T or a Error.
Definition: Error.h:474
Represents an address in the executor process.
ExecutorProcessControl supports interaction with a JIT target process.
Represents a JIT'd dynamic library.
Definition: Core.h:989
Tracks responsibility for materialization, and mediates interactions between MaterializationUnits and...
Definition: Core.h:555
Plugin instances can be added to the ObjectLinkingLayer to receive callbacks when code is loaded or e...
Log perf jitdump events for each object (see https://git.kernel.org/pub/scm/linux/kernel/git/torvalds...
Error notifyFailed(MaterializationResponsibility &MR) override
void modifyPassConfig(MaterializationResponsibility &MR, jitlink::LinkGraph &G, jitlink::PassConfiguration &Config) override
static Expected< std::unique_ptr< PerfSupportPlugin > > Create(ExecutorProcessControl &EPC, JITDylib &JD, 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:53
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18