rr-debugger / rr-debugger/rr

Create a separate file for associating rr events with arbitrary strings (-M on steroids)

Open
#1,688 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
10.7k
Forks
662
Avg merge
2d 3h
Merged PRs (30d)
2

Description

The -M switch for rr record is very useful in associating stdio output with rr event numbers.

However, while the output [rr pid event-number] being prepended is useful, I would like something more advanced: I want to be able to save such associations in a custom file and not mix it with stdio.

My goal is to build a machine readable file associating event ids with some string output (and write a script/program to read that back later)

So if I want to do something like (in my tracee code)

fprintf(fd, "Some string here");

It could save

[rr 9875 123]Some string here

to the file fd.

rr -M does that but it (1) changes stdio output (2) will produce a whole lot of extraneous junk if I want to do a lot of event-output associations.

An implementation approach here would be to have some sort of special file fd perhaps. When rr detects that you're writing to that special file (only), it will prepend [rr pid event-id] just like it does for the stdio monitor. It would not do prepending to any other file.

Any suggestions on how I could do this?

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 tracing rr record's existing -M handling and the path used to associate stdio output with rr events. Define how a tracee can write to a separate special file without changing other output, then verify that the file contains machine-readable event IDs and the associated strings without unrelated stdio text.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, linux
Domain
devtools, operating-systems
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.