rust-lang / rust-lang/rustc-perf

Adding `lightswitch` as a profile tool

Open
#2,518 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
733
Forks
189
Avg merge
10h 52m
Merged PRs (30d)
43

Description

Hi,

Would you be open / interested in adding lightswitch as one of the available profilers? I thought of posting here after lurking in Rust's zulip and seeing some mentions of the issues of dealing with other profilers (cc @bal-e).

The TL;DR is:

  • x86_64 and arm64 Linux only, frame pointers not necessary;
  • support deeper stacks thanks to not using PERF_SAMPLE_STACK_USER, as of now, no limits in terms of process stack, and up to 200 user + kernel frames;
  • various output modes, including to the Firefox profiler, SVG flamegraph, Perfetto, and others;
  • written in Rust :)

I think right now the biggest blocker compared to other profilers is that it doesn't accept a command to run and profile, it can either profiler the whole box of the specified pids. This is something I am planning on adding soon and can prioritise if this would be useful.

Contributor guide

No contributing guide indexed for this repository

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.

Research direction

Start by reviewing rustc-perf's existing profiler integrations and the lightswitch profiler entry points, including src/bpf/profiler.h. Clarify whether lightswitch must first support profiling a command, then define how it should be exposed and how its supported Linux architectures and output modes are handled. Done means lightswitch is available through rustc-perf with the agreed invocation and verified output.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
performance
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.