search for: xray_instr_map

Displaying 18 results from an estimated 18 matches for "xray_instr_map".

2016 Jun 23
2
Building an array in a section from multiple object files
...ough is I'd like to be able to reference the whole array with a single symbol (or two, one to mark the start and the other to mark the end). I'm trying to get this to work initially on x86 and Linux (ELF). What I've got currently in http://reviews.llvm.org/D19904 creates this section (.xray_instr_map) and defines two globals in that section named "__xray_instr_map" and "__xray_instr_map_end". The problem inevitably with this approach is that having multiple object files have these definitions cause issues with multiple definition violations at link time. I *think* the solut...
2016 Jun 23
2
Building an array in a section from multiple object files
Awesome, thanks Peter! Cheers On Thu, Jun 23, 2016 at 10:35 AM Peter Collingbourne <peter at pcc.me.uk> wrote: > If you give your section a valid C identifier name, i.e. something like > "xray_instr_map" (no period), the linker will synthesize symbols named > "__start_xray_instr_map" and "__stop_xray_instr_map", which will point to > the start and end of the combined section. > > Peter > > On Thu, Jun 23, 2016 at 10:26 AM, Dean Michael Berris via llvm-dev...
2016 Jun 27
0
Building an array in a section from multiple object files
Just to close this out, I've updated http://reviews.llvm.org/D19904 to use named ELF groups per-function, and have the runtime library use __start_xray_instr_map and __stop_xray_instr_map as weak symbols from the C++ side. I've sent a patch to make creating these COMDAT/Group sections easier when lowering through the MCStreamer interface ( http://reviews.llvm.org/D21743). Cheers On Fri, Jun 24, 2016 at 4:23 AM Dean Michael Berris <dberris at google...
2017 Nov 21
2
question about xray tls data initialization
...ortunately I haven't enough knowledge about linker and the runtime, and finally built executable didn't run. I'd like to share my changes here , hopes somebody help me to make it run on windows. in AsmPrinter, copy/paster xray for coff target InstMap = OutContext.getCOFFSection("xray_instr_map", 0, SectionKind::getReadOnlyWithRel()); FnSledIndex = OutContext.getCOFFSection("xray_fn_idx", 0,SectionKind::getReadOnlyWithRel()); in XRayArgs , allow windows platform to use xray args. with this, generated code seems have sled and xray parts. in xray runtime, bool atomic_compa...
2017 Aug 15
3
[XRay] Alternatives to relocations in .text section
...deleting those sections. Before going any further, let me give a backgrounder on what XRay does today. Background ========== XRay has two side tables we use at runtime to identify the location of the sleds for the functions that are instrumented. These are named "xray_fn_idx" and "xray_instr_map". We emit information in these sections that refer to labels that are emitted in the .text section (or in function-specific sections, when building with -ffunction-sections). To keep the entries in these sections alive from the linker's perspective, we emit references in the .text section...
2017 Jan 09
2
Removed a call to EmitXRayTable() from ARMAsmPrinter
...ch at gmail.com> wrote: > Hi Dean, > > I have seen that you removed the following code from ARMAsmPrinter.cpp in > revision 290858: > // Emit the XRay table for this function. > EmitXRayTable(); > > Was this done by mistake or on purpose? > > Without this call, xray_instr_map gets empty in the executable, so that > XRay doesn't patch anything. While implementing the tail call handling, I > am reverting this change (I mean, just returning the call to > emitXRayTable() where it was), or are there reasons I shouldn't? > > Cheers, > Serge > ----...
2017 Nov 16
2
question about xray tls data initialization
I'm learning the xray library and try if it can be built on windows, in xray_fdr_logging_impl.h line 152 , comment written as // Using pthread_once(...) to initialize the thread-local data structures but at line 175, 183, code written as thread_local pthread_key_t key; // Ensure that we only actually ever do the pthread initialization once. thread_local bool UNUSED Unused = [] {
2016 Jun 27
1
Building an array in a section from multiple object files
Dean Michael Berris via llvm-dev <llvm-dev at lists.llvm.org> writes: > Just to close this out, I've updated http://reviews.llvm.org/D19904 to use > named ELF groups per-function, and have the runtime library use > __start_xray_instr_map and __stop_xray_instr_map as weak symbols from the > C++ side. In case you're not aware, the __start_/__stop_ trick isn't portable. You may want to look at compiler-rt/lib/profile/InstrProfilingPlatform*.c. There, we do the __start_ trick for linux and freebsd, a similar trick for darwi...
2017 Jan 09
2
Removed a call to EmitXRayTable() from ARMAsmPrinter
...uary 9, 2017 11:50 PM To: Serge Rogatch Cc: Dean Michael Berris; LLVM Developers; Oleg Ranevskyy Subject: Re: [llvm-dev] Removed a call to EmitXRayTable() from ARMAsmPrinter On 9 January 2017 at 20:47, Serge Rogatch via llvm-dev <llvm-dev at lists.llvm.org> wrote: >> Without this call, xray_instr_map gets empty in the executable, so that >> XRay doesn't patch anything. While implementing the tail call handling, I am >> reverting this change (I mean, just returning the call to emitXRayTable() >> where it was), or are there reasons I shouldn't? Any reason why no tests w...
2017 Nov 23
2
question about xray tls data initialization
...aybe you can send some patches to review, > preferably through the LLVM Phabricator instance? You can have me or Reid > (who knows more about COFF and the Windows stuff) as reviewers. > > in AsmPrinter, copy/paster xray for coff target > > InstMap = OutContext.getCOFFSection("xray_instr_map", 0, > SectionKind::getReadOnlyWithRel()); > FnSledIndex = OutContext.getCOFFSection("xray_fn_idx", > 0,SectionKind::getReadOnlyWithRel()); > > in XRayArgs , allow windows platform to use xray args. with this, > generated code seems have sled and xray parts. > &g...
2016 Aug 05
2
XRay: Demo on x86_64/Linux almost done; some questions.
...sInstrument; unsigned char Padding[14]; // Need 32 bytes }; And the peer code in llvm/trunk/lib/Target/X86/X86MCInstLower.cpp : void X86AsmPrinter::EmitXRayTable() { if (Sleds.empty()) return; if (Subtarget->isTargetELF()) { auto *Section = OutContext.getELFSection( "xray_instr_map", ELF::SHT_PROGBITS, ELF::SHF_ALLOC | ELF::SHF_GROUP | ELF::SHF_MERGE, 0, CurrentFnSym->getName()); auto PrevSection = OutStreamer->getCurrentSectionOnly(); OutStreamer->SwitchSection(Section); for (const auto &Sled : Sleds) { OutStreamer->Emit...
2019 Feb 02
2
[llvm-xray] llvm-xray cannot log every functions
...As the official document said, I put on instruction threshold flag to 1, and is using the most recently released version of clang-9 that is built from source together with compiler-rt built with source. 2. I built it using command "make", and checked with objdump that there is xray_instr_map: ./matrix: file format elf64-x86-64 Sections: Idx Name Size VMA LMA File off Algn 27 xray_instr_map 00000100 0000000000637ac0 0000000000637ac0 00037ac0 2**0 CO...
2017 Jan 10
2
Removed a call to EmitXRayTable() from ARMAsmPrinter
...Dean Michael Berris; LLVM Developers; Oleg Ranevskyy >> Subject: Re: [llvm-dev] Removed a call to EmitXRayTable() from ARMAsmPrinter >> >> On 9 January 2017 at 20:47, Serge Rogatch via llvm-dev >> <llvm-dev at lists.llvm.org> wrote: >>>> Without this call, xray_instr_map gets empty in the executable, so that >>>> XRay doesn't patch anything. While implementing the tail call handling, I am >>>> reverting this change (I mean, just returning the call to emitXRayTable() >>>> where it was), or are there reasons I shouldn't? &g...
2016 Aug 23
2
[XRay][RFC] Tooling for XRay Trace Analysis
...more analysis implementations without being tied to the log format. # Proposed Solution In [1] I've gone ahead and implemented a tool, currently named 'llvm-xray' which supports sub-commands to do the following: - `llvm-xray extract <xray-instrumented binary>` : Converts the xray_instr_map in the binary into something more human and machine-readable text (currently does JSON, but I understand YAML is already supported better in LLVM). - `llvm-xray account <xray trace> -m <xray-instrumented binary>` : Performs function call accounting with basic statistics. In the near...
2016 Aug 04
2
XRay: Demo on x86_64/Linux almost done; some questions.
> On 4 Aug 2016, at 06:27, Serge Rogatch <serge.rogatch at gmail.com> wrote: > > Hi Dean, > > I have a question about the following piece of code in compiler-rt/trunk/lib/xray/xray_trampoline_x86.S : > movq _ZN6__xray19XRayPatchedFunctionE(%rip), %rax > testq %rax, %rax > je .Ltmp0 > > // assume that %r10d has the function id. > movl %r10d,
2016 Jul 04
4
[XRay] RFC: LLVM-side Changes for nop-sleds
...reshold=N), that then insert the pseudo-instructions to the machine instructions that get lowered appropriately. While lowering, we keep track of the instrumentation points marked by the lowered pseudo-instructions and generate a per-function COMDAT/ELF Group section, merged into a special section (xray_instr_map). We only currently implement the lowering for x86_64 ELF. All these changes are implemented in http://reviews.llvm.org/D19904. Challenges ========= This implementation approach poses two major challenges just on the LLVM (core) side of the implementation: 1) The pseudo-instructions need to be...
2016 Aug 08
2
XRay: Demo on x86_64/Linux almost done; some questions.
...e peer code in llvm/trunk/lib/Target/X86/X86MCInstLower.cpp : > > > > void X86AsmPrinter::EmitXRayTable() { > > if (Sleds.empty()) > > return; > > if (Subtarget->isTargetELF()) { > > auto *Section = OutContext.getELFSection( > > "xray_instr_map", ELF::SHT_PROGBITS, > > ELF::SHF_ALLOC | ELF::SHF_GROUP | ELF::SHF_MERGE, 0, > > CurrentFnSym->getName()); > > auto PrevSection = OutStreamer->getCurrentSectionOnly(); > > OutStreamer->SwitchSection(Section); > > for (const au...
2016 Sep 09
2
[XRay][RFC] Tooling for XRay Trace Analysis
...without being tied to the log format. > > # Proposed Solution > > In [1] I've gone ahead and implemented a tool, currently named 'llvm-xray' which supports sub-commands to do the following: > > - `llvm-xray extract <xray-instrumented binary>` : Converts the xray_instr_map in the binary into something more human and machine-readable text (currently does JSON, but I understand YAML is already supported better in LLVM). > - `llvm-xray account <xray trace> -m <xray-instrumented binary>` : Performs function call accounting with basic statistics. > &g...