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
6497a84e
Commit
6497a84e
authored
Feb 06, 2016
by
Brendan Gregg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bitesize nits
parent
baebe807
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
18 deletions
+15
-18
tools/bitesize.py
tools/bitesize.py
+4
-4
tools/bitesize_example.txt
tools/bitesize_example.txt
+11
-14
No files found.
tools/bitesize.py
100644 → 100755
View file @
6497a84e
...
...
@@ -4,8 +4,8 @@
# For Linux, uses BCC, eBPF. See .c file.
#
# USAGE: bitesize
# Ctrl-C will print the partially gathered histogram then exit.
#
# Ctrl-C will print the partially gathered histogram then exit.
#
# Copyright (c) 2016 Allan McAleavy
# Licensed under the Apache License, Version 2.0 (the "License")
...
...
@@ -46,7 +46,7 @@ int do_count (struct pt_regs *ctx, struct request *req)
struct val_t *valp;
valp = commbyreq.lookup(&req);
if (
valp == 0) {
if (valp == 0) {
return 0;
}
...
...
@@ -55,7 +55,7 @@ int do_count (struct pt_regs *ctx, struct request *req)
bpf_probe_read(&key.name, sizeof(key.name),valp->name);
dist.increment(key);
}
return 0;
return 0;
}
"""
...
...
@@ -72,4 +72,4 @@ dist = b.get_table("dist")
try
:
sleep
(
99999999
)
except
KeyboardInterrupt
:
dist
.
print_log2_hist
(
"Kbytes"
,
"Process Name
:
"
)
dist
.
print_log2_hist
(
"Kbytes"
,
"Process Name"
)
tools/bitesize_example.txt
View file @
6497a84e
Example of BCC tool bitesize.py
Examples of bitesize.py, the Linux bcc/eBPF version.
The aim of this tool is to show I/O distribution for requested block sizes, by process name.
...
...
@@ -6,13 +7,13 @@ The aim of this tool is to show I/O distribution for requested block sizes, by p
Tracing... Hit Ctrl-C to end.
^C
Process Name
:
= 'kworker/u128:1'
Process Name = 'kworker/u128:1'
Kbytes : count distribution
0 -> 1 : 1 |******************** |
2 -> 3 : 0 | |
4 -> 7 : 2 |****************************************|
Process Name
:
= 'bitesize.py'
Process Name = 'bitesize.py'
Kbytes : count distribution
0 -> 1 : 0 | |
2 -> 3 : 0 | |
...
...
@@ -23,7 +24,7 @@ Process Name: = 'bitesize.py'
64 -> 127 : 0 | |
128 -> 255 : 1 |****************************************|
Process Name
:
= 'dd'
Process Name = 'dd'
Kbytes : count distribution
0 -> 1 : 3 | |
2 -> 3 : 0 | |
...
...
@@ -37,13 +38,13 @@ Process Name: = 'dd'
512 -> 1023 : 0 | |
1024 -> 2047 : 488 |****************************************|
Process Name
:
= 'jbd2/dm-1-8'
Process Name = 'jbd2/dm-1-8'
Kbytes : count distribution
0 -> 1 : 0 | |
2 -> 3 : 0 | |
4 -> 7 : 1 |****************************************|
Process Name
:
= 'cat'
Process Name = 'cat'
Kbytes : count distribution
0 -> 1 : 1 | |
2 -> 3 : 0 | |
...
...
@@ -55,19 +56,19 @@ Process Name: = 'cat'
128 -> 255 : 0 | |
256 -> 511 : 1924 |****************************************|
Process Name
:
= 'ntpd'
Process Name = 'ntpd'
Kbytes : count distribution
0 -> 1 : 0 | |
2 -> 3 : 0 | |
4 -> 7 : 104 |****************************************|
Process Name
:
= 'vmtoolsd'
Process Name = 'vmtoolsd'
Kbytes : count distribution
0 -> 1 : 0 | |
2 -> 3 : 0 | |
4 -> 7 : 1 |****************************************|
Process Name
:
= 'bash'
Process Name = 'bash'
Kbytes : count distribution
0 -> 1 : 0 | |
2 -> 3 : 0 | |
...
...
@@ -75,7 +76,7 @@ Process Name: = 'bash'
8 -> 15 : 0 | |
16 -> 31 : 2 |****************************************|
Process Name
:
= 'jbd2/sdb-8'
Process Name = 'jbd2/sdb-8'
Kbytes : count distribution
0 -> 1 : 0 | |
2 -> 3 : 0 | |
...
...
@@ -86,7 +87,3 @@ Process Name: = 'jbd2/sdb-8'
We can see from above that there was a dd command being run which generated 488 IOPS between 1MB and 2MB, we can also see the
cat command generating 1924 IOPS between 256Kb and 512Kb.
See also systemtap version:
https://github.com/brendangregg/systemtap-lwtools/blob/master/disk/bitesize-nd.stp
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