feat: add column field to Line message#80
Merged
Conversation
The pprof spec's Line message carries an optional column (field 3) that current google/pprof tooling reads and prints (file:line:column), but this library neither encoded nor decoded it. Add `column` to the Line message — LineInput type, constructor, length, encode (field 3, varint), and decode — mirroring the existing `line` field handling. Motivation: Node.js profiles of bundled/minified server code (e.g. Next.js server chunks) place every function on generated line 1, so the column is the only discriminator between functions. Without a column on Line, downstream backend deobfuscation collapses every frame to column 0 and cannot resolve them. Also add `int64 column = 3` to the reference testing proto so the protobuf.js interop test round-trips the new field, and extend the Line encode/decode test case with a column value. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This was referenced Jul 21, 2026
gyuheon0h
approved these changes
Jul 21, 2026
This was referenced Jul 24, 2026
Merged
szegedi
added a commit
that referenced
this pull request
Jul 24, 2026
The pprof spec's Line message carries an optional column (field 3) that current google/pprof tooling reads and prints (file:line:column), but this library neither encoded nor decoded it. Add `column` to the Line message — LineInput type, constructor, length, encode (field 3, varint), and decode — mirroring the existing `line` field handling. Motivation: Node.js profiles of bundled/minified server code (e.g. Next.js server chunks) place every function on generated line 1, so the column is the only discriminator between functions. Without a column on Line, downstream backend deobfuscation collapses every frame to column 0 and cannot resolve them. Also add `int64 column = 3` to the reference testing proto so the protobuf.js interop test round-trips the new field, and extend the Line encode/decode test case with a column value.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds the optional
columnfield (field 3) to the pprofLinemessage:LineInputtype, constructor,length, encode (varint, tag0x18), and decode — mirroring the existingline(field 2) handling.The pprof spec
Linemessage carriescolumnas field 3, and currentgoogle/pproftooling reads and prints it (go tool pprofrendersfile:line:column). This library did not encode or decode it, so any column set on aLinewas silently dropped on the wire.The reason we don't have it here is that it's a fairly recent addition in google/pprof#818 and was only merged into the spec in January 2024.
Changes
src/index.ts—columnon theLinemessage (type, ctor,length, encode, decode).testing/proto/profile.proto— addint64 column = 3;to the referenceLineso the protobuf.js interop test round-trips the field; regeneratedprofile.js/profile.d.tswere hand-edited to add only the column field in the existing codegen style (avoiding the unrelated churn a fullnpm run protoproduces with the current protobuf.js version).src/index.test.ts— extend theLineencode/decode/construct case with acolumnvalue.Testing
npm test— 76/76 pass, including the protobuf.js interop round-trip with the new field.