Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

Commit

Permalink
Merge pull request #20035 from echesakovMSFT/CrossBitnessLinuxPerfMap
Browse files Browse the repository at this point in the history
Make Hostx64/arm crossgen /CreatePerfMap behave the same as Hostarm/arm crossgen
  • Loading branch information
echesakov authored Sep 20, 2018
2 parents 520e089 + 93344b8 commit 3d2e9cc
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/vm/compile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4499,7 +4499,7 @@ HRESULT __stdcall CreatePdb(CORINFO_ASSEMBLY_HANDLE hAssembly, BSTR pNativeImage
{
pModule = moduleIterator.GetModule();

if (pModule->HasNativeImage() || pModule->IsReadyToRun())
if (pModule->HasNativeOrReadyToRunImage())
{
#if !defined(NO_NGENPDB)
IfFailThrow(pdbWriter.WritePDBDataForModule(pModule));
Expand Down
14 changes: 12 additions & 2 deletions src/vm/perfmap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,16 @@
#include "perfinfo.h"
#include "pal.h"

// The code addresses are actually native image offsets during crossgen. Print
// them as 32-bit numbers for consistent output when cross-targeting and to
// make the output more compact.

#ifdef CROSSGEN_COMPILE
#define FMT_CODE_ADDR "%08x"
#else
#define FMT_CODE_ADDR "%p"
#endif

PerfMap * PerfMap::s_Current = nullptr;

// Initialize the map for the process - called from EEStartupHelper.
Expand Down Expand Up @@ -173,7 +183,7 @@ void PerfMap::LogMethod(MethodDesc * pMethod, PCODE pCode, size_t codeSize)
// Build the map file line.
StackScratchBuffer scratch;
SString line;
line.Printf("%p %x %s\n", pCode, codeSize, fullMethodSignature.GetANSI(scratch));
line.Printf(FMT_CODE_ADDR " %x %s\n", pCode, codeSize, fullMethodSignature.GetANSI(scratch));

// Write the line.
WriteLine(line);
Expand Down Expand Up @@ -253,7 +263,7 @@ void PerfMap::LogStubs(const char* stubType, const char* stubOwner, PCODE pCode,

// Build the map file line.
SString line;
line.Printf("%p %x stub<%d> %s<%s>\n", pCode, codeSize, ++(s_Current->m_StubsMapped), stubType, stubOwner);
line.Printf(FMT_CODE_ADDR " %x stub<%d> %s<%s>\n", pCode, codeSize, ++(s_Current->m_StubsMapped), stubType, stubOwner);

// Write the line.
s_Current->WriteLine(line);
Expand Down
2 changes: 1 addition & 1 deletion src/vm/readytoruninfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ static bool AcquireImage(Module * pModule, PEImageLayout * pLayout, READYTORUN_H

// Found an eager fixup section. Check the signature of each fixup in this section.
PVOID *pFixups = (PVOID *)((PBYTE)pLayout->GetBase() + pCurSection->Section.VirtualAddress);
DWORD nFixups = pCurSection->Section.Size / sizeof(PVOID);
DWORD nFixups = pCurSection->Section.Size / TARGET_POINTER_SIZE;
DWORD *pSignatures = (DWORD *)((PBYTE)pLayout->GetBase() + pCurSection->Signatures);
for (DWORD i = 0; i < nFixups; i++)
{
Expand Down

0 comments on commit 3d2e9cc

Please sign in to comment.