Commit d0b993bb authored by grt's avatar grt Committed by Commit bot

Stop recording UMA metrics for known reloc types.

Known types occur very frequently. As it happens, we don't need to know
how prevalent unknown ones are in relation to known types.

BUG=412045
R=robertshield@chromium.org

Review URL: https://codereview.chromium.org/559633002

Cr-Commit-Position: refs/heads/master@{#294037}
parent e7487946
...@@ -164,23 +164,27 @@ bool EnumRelocsCallback(const base::win::PEImage& mem_peimage, ...@@ -164,23 +164,27 @@ bool EnumRelocsCallback(const base::win::PEImage& mem_peimage,
if (!AddrIsInCodeSection(address, mem_code_addr, code_size)) if (!AddrIsInCodeSection(address, mem_code_addr, code_size))
return true; return true;
UMA_HISTOGRAM_SPARSE_SLOWLY("SafeBrowsing.ModuleBaseRelocation", type);
switch (type) { switch (type) {
case IMAGE_REL_BASED_HIGHLOW: { case IMAGE_REL_BASED_ABSOLUTE: // 0
AddBytesCorrectedByReloc(reinterpret_cast<uintptr_t>(address), state);
break;
}
case IMAGE_REL_BASED_ABSOLUTE:
// Absolute type relocations are a noop, sometimes used to pad a section // Absolute type relocations are a noop, sometimes used to pad a section
// of relocations. // of relocations.
break; break;
default: { case IMAGE_REL_BASED_HIGHLOW: // 3
// The base relocation applies all 32 bits of the difference to the 32-bit
// field at offset.
AddBytesCorrectedByReloc(reinterpret_cast<uintptr_t>(address), state);
break;
case IMAGE_REL_BASED_DIR64: // 10
// The base relocation applies the difference to the 64-bit field at
// offset.
// TODO(robertshield): Handle this type of reloc.
break;
default:
// TODO(robertshield): Find a reliable description of the behaviour of the // TODO(robertshield): Find a reliable description of the behaviour of the
// remaining types of relocation and handle them. // remaining types of relocation and handle them.
UMA_HISTOGRAM_SPARSE_SLOWLY("SafeBrowsing.ModuleBaseRelocation", type);
state->unknown_reloc_type = true; state->unknown_reloc_type = true;
break; break;
}
} }
return true; return true;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment