[Feature] Join Free Pascal and Delphi (Linux) profile frames to the functions they ran

Open
#6,344 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@Laex is already working on this.

Since Nov 26, 2026.

  • #6359 by @Laex — open

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
25/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Stale
Tech stack
python
Domain
backend

Research direction

Read the linked guide at docs/architecture/runtime-evidence-languages.md#joining-profile-frames and inspect packages/core/src/repowise/core/frame_resolver.py, especially the language check and _go join. Use the issue’s reproduction to confirm current behavior, then study the fixture and class metrics work for Pascal name spellings and case handling. Done means Pascal frames join to one routine at the stated 95% bar, with other language behavior unchanged; an open pull request is already linked.

Written by the indexing model from the issue text.

Description

enhancement help wanted

@Laex, offering this to you first since you built the Pascal support here. If you want it, just leave a comment and it's yours; otherwise it's open to anyone.

Guide: follow Adding a language to runtime evidence: joining profile frames. It covers the change to frame_resolver.py, the join order, the fixture and the acceptance bar.

Summary

evidence add reads pprof profiles with file and line per frame, and .pas/.pp/.dpr/.lpr frames are tagged pascal, but the resolver joins only Go, Python and JavaScript.

packages/core/src/repowise/core/frame_resolver.py:36, :264

FrameLanguage = Literal["go", "python", "javascript"]
...
if frame.language not in ("go", "python", "javascript"):
    return "unsupported_language"

Mechanism

  • A Free Pascal (or Delphi Linux64) binary built with DWARF (-gw3) can be profiled with perf record -g and converted by perf_to_profile (google/perf_data_converter) into pprof that carries source file and line. The pprof reader keeps both (profile_formats/pprof.py:160-188).
  • _go (:303) is the precedent: span by line, second signal from the name, nested functions folded.

Repro

# one.py PATH LANG NAME: one indexed symbol, one frame inside it
import sys
from repowise.core.frame_resolver import ProfileFrame, resolve_frames
from repowise.core.workspace.repo_index import IndexedSymbol
path, lang, fn = sys.argv[1:4]
sym = IndexedSymbol(f"{path}::{fn}", fn, fn, "method", "", path, 1, 20, "public", lang)
r = resolve_frames([ProfileFrame(f"/repo/{path}", 5, lang, fn)], root="/repo", symbols_by_file={path: [sym]})
print(r.skipped)

python one.py src/cart.pas pascal Total:

{'unsupported_language': 1}

Done looks like

  • Add pascal to FrameLanguage and a _pascal join: span by line, then a second signal from the frame name. FPC's assembler names join unit, class and method with $_$-style separators; read the real spellings off the fixture.
  • Match out-of-line methods (TCart.Total) case-insensitively, as the class metrics work does. Fold nested procedures into their parent.
  • Must not change: other languages.

Tests

A small FPC program profiled with perf and converted with perf_to_profile, checked in as .pb.gz with sources. At least 95% of repo samples join to one routine.

Dominant language
Python
Stars
7.1k
Forks
756
Avg merge
21h 5m
Merged PRs (30d)
797

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from repowise-dev/repowise

All issues in repowise-dev/repowise

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.