Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
osv
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Verlässliche Systemsoftware
projects
osv
Commits
c1cc6ec7
Commit
c1cc6ec7
authored
12 years ago
by
Guy Zana
Browse files
Options
Downloads
Plain Diff
Merge branch 'master' of
https://github.com/cloudius-systems/osv
parents
074c8052
5f888167
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
README
+3
-7
3 additions, 7 deletions
README
scripts/loader.py
+44
-0
44 additions, 0 deletions
scripts/loader.py
with
47 additions
and
7 deletions
README
+
3
−
7
View file @
c1cc6ec7
...
...
@@ -55,13 +55,9 @@ To run OSv
Uncomment the "tracing-flags =" line in build.mak, and rebuild.
Run the program until it aborts, then in gdb:
osv syms
set pagination off
set print elements 0
set print array-indexes on
set print pretty on
set logging on
print trace_log
print trace_record_last._M_i % trace_max
osv trace
gdb.txt will contain the the log, the last line contains the array index
of the last trace entry, read backwards from there.
gdb.txt will contain the the trace.
This diff is collapsed.
Click to expand it.
scripts/loader.py
+
44
−
0
View file @
c1cc6ec7
...
...
@@ -316,6 +316,49 @@ def setup_libstdcxx():
main
=
glob
(
gcc
+
'
/usr/share/gdb/auto-load/usr/lib64/libstdc++.so.*.py
'
)[
0
]
execfile
(
main
)
def
dump_trace
():
from
collections
import
defaultdict
trace_log
=
gdb
.
lookup_global_symbol
(
'
trace_log
'
).
value
()
max_trace
=
gdb
.
parse_and_eval
(
'
max_trace
'
)
last
=
gdb
.
lookup_global_symbol
(
'
trace_record_last
'
).
value
()[
'
_M_i
'
]
indents
=
defaultdict
(
int
)
for
i
in
range
(
max_trace
):
tr
=
trace_log
[(
last
+
i
)
%
max_trace
]
type
=
tr
[
'
type
'
]
thread
=
ulong
(
tr
[
'
thread
'
])
if
type
==
0
:
continue
elif
type
==
1
:
annotation
=
'
->
'
indent
=
'
'
*
indents
[
thread
]
indents
[
thread
]
+=
1
elif
type
==
2
:
annotation
=
'
<-
'
indents
[
thread
]
-=
1
if
indents
[
thread
]
<
0
:
indents
[
thread
]
=
0
indent
=
'
'
*
indents
[
thread
]
else
:
delta
=
0
annotation
=
'
??
'
fn
=
tr
[
'
fn
'
]
try
:
block
=
gdb
.
block_for_pc
(
long
(
fn
))
fn_name
=
block
.
function
.
print_name
except
:
fn_name
=
'
???
'
gdb
.
write
(
'
0x%016x %s %s %s
\n
'
%
(
thread
,
indent
,
annotation
,
fn_name
))
class
osv_trace
(
gdb
.
Command
):
def
__init__
(
self
):
gdb
.
Command
.
__init__
(
self
,
'
osv trace
'
,
gdb
.
COMMAND_USER
,
gdb
.
COMPLETE_NONE
)
def
invoke
(
self
,
arg
,
from_tty
):
dump_trace
()
osv
()
osv_heap
()
osv_syms
()
...
...
@@ -324,5 +367,6 @@ osv_info_threads()
osv_thread
()
osv_thread_apply
()
osv_thread_apply_all
()
osv_trace
()
setup_libstdcxx
()
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment