Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
bcc
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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
bcc
Commits
2bf3ff3d
Commit
2bf3ff3d
authored
Feb 08, 2017
by
Sasha Goldshtein
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
stacksnoop: Migrate to new symbols API and remove addresses
parent
b9f8f4ac
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
40 deletions
+37
-40
tools/old/stacksnoop.py
tools/old/stacksnoop.py
+1
-4
tools/stacksnoop.py
tools/stacksnoop.py
+2
-2
tools/stacksnoop_example.txt
tools/stacksnoop_example.txt
+34
-34
No files found.
tools/old/stacksnoop.py
View file @
2bf3ff3d
...
...
@@ -119,10 +119,7 @@ while 1:
(
task
,
pid
,
cpu
,
flags
,
ts
,
msg
)
=
b
.
trace_fields
()
if
msg
!=
""
:
(
reg
,
addr
)
=
msg
.
split
(
" "
)
if
offset
:
ip
=
b
.
ksymaddr
(
int
(
addr
,
16
))
else
:
ip
=
b
.
ksym
(
int
(
addr
,
16
))
ip
=
b
.
ksym
(
int
(
addr
,
16
),
show_address
=
offset
)
msg
=
msg
+
" "
+
ip
if
verbose
:
print
(
"%-18.9f %-12.12s %-6d %-3d %s"
%
(
ts
,
task
,
pid
,
cpu
,
msg
))
...
...
tools/stacksnoop.py
View file @
2bf3ff3d
...
...
@@ -120,8 +120,8 @@ def print_event(cpu, data, size):
print
(
"%-18.9f %s"
%
(
ts
,
function
))
for
addr
in
stack_traces
.
walk
(
event
.
stack_id
):
sym
=
b
.
ksym
addr
(
addr
)
if
offset
else
b
.
ksym
(
addr
)
print
(
"
\
t
%
016x %s"
%
(
addr
,
sym
)
)
sym
=
b
.
ksym
(
addr
,
show_address
=
offset
)
print
(
"
\
t
%
s"
%
sym
)
print
()
...
...
tools/stacksnoop_example.txt
View file @
2bf3ff3d
...
...
@@ -8,12 +8,12 @@ to see how they were invoked. For example, tracing the submit_bio() call:
# ./stacksnoop submit_bio
TIME(s) SYSCALL
3592.838736000 submit_bio
ffffffff813bd961
submit_bio
ffffffff81257c12
submit_bh
ffffffff81301948
jbd2_journal_commit_transaction
ffffffff8130653a
kjournald2
ffffffff810a2df8
kthread
ffffffff8183a122
ret_from_fork
submit_bio
submit_bh
jbd2_journal_commit_transaction
kjournald2
kthread
ret_from_fork
This shows that submit_bio() was called by submit_bh(), which was called
by jbd2_journal_commit_transaction(), and so on.
...
...
@@ -28,12 +28,12 @@ The -v option includes more fields, including the on-CPU process (COMM and PID):
# ./stacksnoop -v submit_bio
TIME(s) COMM PID CPU SYSCALL
3734.855027000 jbd2/dm-0-8 313 0 submit_bio
ffffffff813bd961
submit_bio
ffffffff81257c12
submit_bh
ffffffff81301948
jbd2_journal_commit_transaction
ffffffff8130653a
kjournald2
ffffffff810a2df8
kthread
ffffffff8183a122
ret_from_fork
submit_bio
submit_bh
jbd2_journal_commit_transaction
kjournald2
kthread
ret_from_fork
This identifies the application issuing the sync syscall: the jbd2 process
(COMM column).
...
...
@@ -45,30 +45,30 @@ process:
# ./stacksnoop -v second_overflow
TIME(s) COMM PID CPU SYSCALL
3837.526433000 <idle> 0 1 second_overflow
ffffffff810fac41
second_overflow
ffffffff81102320
tick_do_update_jiffies64
ffffffff81102bf0
tick_irq_enter
ffffffff810882ac
irq_enter
ffffffff8183c7df
smp_apic_timer_interrupt
ffffffff8183aae2
apic_timer_interrupt
ffffffff81038f9e
default_idle
ffffffff8103979f
arch_cpu_idle
ffffffff810c69da
default_idle_call
ffffffff810c6cd7
cpu_startup_entry
ffffffff81051cbe
start_secondary
second_overflow
tick_do_update_jiffies64
tick_irq_enter
irq_enter
smp_apic_timer_interrupt
apic_timer_interrupt
default_idle
arch_cpu_idle
default_idle_call
cpu_startup_entry
start_secondary
3838.526953000 <idle> 0 1 second_overflow
ffffffff810fac41
second_overflow
ffffffff81102320
tick_do_update_jiffies64
ffffffff81102bf0
tick_irq_enter
ffffffff810882ac
irq_enter
ffffffff8183c7df
smp_apic_timer_interrupt
ffffffff8183aae2
apic_timer_interrupt
ffffffff81038f9e
default_idle
ffffffff8103979f
arch_cpu_idle
ffffffff810c69da
default_idle_call
ffffffff810c6cd7
cpu_startup_entry
ffffffff81051cbe
start_secondary
second_overflow
tick_do_update_jiffies64
tick_irq_enter
irq_enter
smp_apic_timer_interrupt
apic_timer_interrupt
default_idle
arch_cpu_idle
default_idle_call
cpu_startup_entry
start_secondary
This fires every second (see TIME(s)), and is from tick_do_update_jiffies64().
...
...
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