Commit b7bf09c
committed
Functionality that will be shared, moved from TraceStream.cc
- Moved into util.cc
- Added forward_to to skip trace data to some arbitrary point in time
Getters required to expose data
We need to be able to expose this data so it can
be serialized.
Find original exe for ReplayTask
Digs out original executable image that this task was forked
from, or in the case of exec, exec'd on.
This is required for persistent checkpointing, so that the names in the
proc fs corresponds to a correct name at replay time (i.e. has the same
behavior/looks the same in proc fs as a normal replay). The thread name is
not what should be showing up in /proc/tid/comm, but the actual
executable. So we need to be able to find this "original exe" of the
task.
Check if Event is checkpointable
Required for the create checkpoints command, etc. to determine what
events in the trace are checkpointable, when not having a live session.
In future commits/PRs, remove the static function in ReplaySession.cc`
that does the same thing and use this member function on Event instead.
Additional proc fs query paths
Gets additional proc fs paths for a task, in this case
/mem. Required for persistent checkpointing to figure out
on how to handle mappings and what to serialize (and what not to
serialize).
Lifted CloneCompletion out of Session
The function extract_name will also be required for setting up syscall
buffer stuff in coming commits.
Getters/setters required for PCP
Need to be able to set this data when restoring an address space.
Persistent checkpointing
Added persistent checkpoint schema for capnproto rr_pcp.capnp,
as well a compile command for it in CMakeLists.txt, that works like
the other one (rr_trace.capnp)
CheckpointInfo and MarkData types works as intermediaries between a
serialized checkpoint and a deserialized "live" one. MarkData is used for
copying the contents of Mark, InternalMark, ProtoMark and it's various
data into, for serialization as well when deserializing, to reconstruct
those types.
The reasoning for adding MarkData is to not intrude in Mark/InternalMark/ProtoMark
interface and possibly break some guarantees or invariants they provide.
If something goes wrong now, it's constrained only to persistent
checkpointing not reconstituting a session properly.
GDB spawned by RR now has 2 additional commands, write-checkpoints, which
serializes any checkpoints set by the `checkpoint` command and
load-checkpoints.
Added the rr create-checkpoints command which create persistent checkpoints
on a specified interval, which it attempts to honor as closely as possible.
RerunCommand and ReplayCommand are now aware of PCPs.
Replay sessions get spawned from persistent checkpoints if they
exist on disk when using `-g <evt>` or when using `-f <pid>` and that
"task" was created some time after a persistent checkpoint.
Added the --ignore-pcp flag to these commands, which ignores pcps
and spawns sessions normally.
fixup for can_checkpoint_at
Restored comments, that existed in static function in ReplaySession.cc
Change all use of this to Event::can_checkpoint_at
Removed static can_checkpoint_at in ReplaySession.cc
Fix preferred include & unnecessary check for partial init
Since checkpoints are partially initialized, checking that they are is pointless.
Added cmake command looping over trace files per request by @khuey
remove init check of member variables.
Move extract_name from Session into util.h.
Removed stream_util, moved contents to util.h
make ignore-pcp not take up '-i'
Moved responsibility of de/ser into FdTable and FileMonitor
Deserializing and serializing an FdTable is now performed by the class itself instead of in a free function
FileMonitor has a public member function that is used for serialization.
Each derived type that requires special/additional logic, extends
the virtual member function serialize_type.
Remove skipMonitoringMappedFd
not necessary for serialization, as FdTable is separately restored.
Refactor task OS-name setting
Task::copy_state sets the OS name of a task in the same fashion that
persistent checkpointing sets name. Refactored this functionality into
Task::set_name.
Also removed the unnecessary `update_prname` from Task::copy_state.
update_prname is not a "write to tracee"-operation but a "read from tracee"-operation; and since
we already know what name we want to set Task::prname to, we skip this reading from the tracee
in Task::copy_state and just set it to the parameter passed in to Task::set_name
Add const qualifier
Fixes #3678
Refactor so that marks_with_checkpoints is just changed in one place, not arbitrarily access it. Ref counts had the same changes in a previous commit.
Fixes a bug for loaded persistent checkpoints where the re-created checkpoints did not get their reference counting correct.
This closes #3678
Fixed pread-related bug
pread may or may not read the requested size. This was not
taken into account for. If the data is large,
we probably can't read it, in one go.
Fixed signed overflow
Added the first test for persistent checkpoints
Address missing arch() serialization
Previous work assumed everything as native. That doesn't work when
debugging a 32-bit mode application on a 64-bit machine. That means some
`SupportedArch` fields needs to be serialized as well, so that if the
process was a 32-bit application it gets re-created correctly. This was
instantly made visible by the provided test (although it did not test it
explicitly).
Fix issues so that ARM test passes
Changed test
On arm, we start in a different place than _start (some
assembly, possibly handrolled), which made setting a breakpoint at 48
wrong, so had to put the filename:line number.
Tests should pass now.
`create-checkpoints` should handle "latest-trace"
Create checkpoints command need the actual trace dir resolved, so we let `TraceReader` handle that for us.1 parent 42f7589 commit b7bf09c
File tree
62 files changed
+3093
-274
lines changed- src
- test
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
62 files changed
+3093
-274
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
582 | 582 | | |
583 | 583 | | |
584 | 584 | | |
585 | | - | |
586 | | - | |
587 | | - | |
588 | | - | |
589 | | - | |
590 | | - | |
591 | | - | |
592 | | - | |
593 | | - | |
594 | | - | |
595 | | - | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
596 | 605 | | |
597 | 606 | | |
598 | 607 | | |
| |||
604 | 613 | | |
605 | 614 | | |
606 | 615 | | |
| 616 | + | |
607 | 617 | | |
608 | 618 | | |
609 | 619 | | |
610 | 620 | | |
611 | 621 | | |
612 | 622 | | |
613 | 623 | | |
| 624 | + | |
614 | 625 | | |
615 | 626 | | |
616 | 627 | | |
| |||
648 | 659 | | |
649 | 660 | | |
650 | 661 | | |
| 662 | + | |
651 | 663 | | |
652 | 664 | | |
653 | 665 | | |
| |||
688 | 700 | | |
689 | 701 | | |
690 | 702 | | |
| 703 | + | |
691 | 704 | | |
692 | 705 | | |
693 | 706 | | |
| |||
1542 | 1555 | | |
1543 | 1556 | | |
1544 | 1557 | | |
| 1558 | + | |
1545 | 1559 | | |
1546 | 1560 | | |
1547 | 1561 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
554 | 554 | | |
555 | 555 | | |
556 | 556 | | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
557 | 562 | | |
558 | 563 | | |
559 | 564 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
662 | 662 | | |
663 | 663 | | |
664 | 664 | | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
665 | 673 | | |
666 | 674 | | |
667 | 675 | | |
| |||
801 | 809 | | |
802 | 810 | | |
803 | 811 | | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
804 | 815 | | |
805 | 816 | | |
806 | 817 | | |
| |||
879 | 890 | | |
880 | 891 | | |
881 | 892 | | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
882 | 902 | | |
883 | 903 | | |
884 | 904 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
23 | 30 | | |
24 | 31 | | |
25 | 32 | | |
| |||
0 commit comments