janestreet / janestreet/magic-trace

Allow tracing kernel threads

Open
#226 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement good first issue
Dominant language
OCaml
Stars
6.3k
Forks
209
PR merge metrics
No merged PRs in 30d

Description

Currently, tracing them fails because we can't open `/proc/$pid/exe`, but we can figure out if we're looking at a kernel thread (its parent's PID should be 2), and use vmlinux instead.

Contributor guide

Open the contributing guide

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 locating the tracing code that opens /proc/$pid/exe and determines the executable for a traced process. Check how a parent PID of 2 identifies a kernel thread, then use vmlinux for that case. Done means kernel threads can be traced without the /proc/$pid/exe failure while normal process tracing continues to work.

Written by the indexing model from the issue text.

Assessment

Tech stack
ocaml
Domain
observability, operating-systems
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.