Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
ZEO
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
ZEO
Commits
f24d0b86
Commit
f24d0b86
authored
Oct 14, 2002
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add the same recovering behavior as for stat.py.
parent
2fcdaaa0
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
5 deletions
+20
-5
src/ZEO/simul.py
src/ZEO/simul.py
+20
-5
No files found.
src/ZEO/simul.py
View file @
f24d0b86
...
@@ -97,13 +97,28 @@ def main():
...
@@ -97,13 +97,28 @@ def main():
sim
.
printheader
()
sim
.
printheader
()
# Read trace file, simulating cache behavior
# Read trace file, simulating cache behavior
offset
=
0
records
=
0
f_read
=
f
.
read
struct_unpack
=
struct
.
unpack
while
1
:
while
1
:
# Read a record
# Read a record
and decode it
r
=
f
.
read
(
24
)
r
=
f
_read
(
8
)
if
len
(
r
)
<
24
:
if
len
(
r
)
<
8
:
break
break
# Decode it
offset
+=
8
ts
,
code
,
oid
,
serial
=
struct
.
unpack
(
">ii8s8s"
,
r
)
ts
,
code
=
struct_unpack
(
">ii"
,
r
)
if
ts
==
0
:
# Must be a misaligned record caused by a crash
print
"Skipping 8 bytes at offset"
,
offset
-
8
continue
r
=
f_read
(
16
)
if
len
(
r
)
<
16
:
break
offset
+=
16
records
+=
1
oid
,
serial
=
struct_unpack
(
">8s8s"
,
r
)
# Decode the code
dlen
,
version
,
code
,
current
=
(
code
&
0x7fffff00
,
dlen
,
version
,
code
,
current
=
(
code
&
0x7fffff00
,
code
&
0x80
,
code
&
0x80
,
code
&
0x7e
,
code
&
0x7e
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment