Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.13.1]
### Fixed
- Incorrect offset used when parsing 32 bit profraw generated by LLVM 23.

## [0.13.0]
### Added
- Support for LLVM 23
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "llvm_profparser"
version = "0.13.0"
version = "0.13.1"
authors = ["xd009642 <danielmckenna93@gmail.com>"]
description = "Parsing and interpretation of llvm coverage profiles and generated data"
repository = "https://github.com/xd009642/llvm-profparser"
Expand Down
11 changes: 5 additions & 6 deletions src/instrumentation_profile/raw_profile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -351,12 +351,11 @@ where
let (bytes, data) = ProfileData::<T>::parse(input, &header)?;
debug!("Parsed data section {:?}", data);
data_section.push(data);
// Struct tail padding. In v9/v10 ProfileData ends on a 4-byte field at offset 60,
// so the compiler pads to 64. In v11 (LLVM 23) OffloadDeviceWaveSize shifts
// NumBitmapBytes to offset 68, the struct ends at 72 which is already 8-aligned,
// and the padding moves INSIDE the struct (2 bytes, handled in ProfileData::parse).
// Taking 4 here as well would over-consume and desynchronise every later record.
if version_num > 8 && version_num < 11 {
// ProfileData contains uint64 fields, so its alignment is 8 bytes even when its
// pointer fields are 32-bit. V11's 64-bit layout ends at 72 bytes, but its 32-bit
// layout ends at 52 bytes and therefore retains 4 bytes of tail padding. Missing
// that padding desynchronises every record after the first in wasm profiles.
if version_num > 8 && (version_num < 11 || size_of::<T>() == size_of::<u32>()) {
let (bytes, v) = take(4usize)(bytes)?;
debug!("Got those padding? bytes {:?}", v);
input = bytes;
Expand Down
Binary file not shown.
Loading