Skip to content

add slabratetop libbpf-tools#3797

Merged
davemarchevsky merged 1 commit intoiovisor:masterfrom
Rtoax:patch-8
Jul 7, 2022
Merged

add slabratetop libbpf-tools#3797
davemarchevsky merged 1 commit intoiovisor:masterfrom
Rtoax:patch-8

Conversation

@Rtoax
Copy link
Copy Markdown
Contributor

@Rtoax Rtoax commented Jan 7, 2022

Total same as slabratetop(8), but add some options params:

$ sudo ./slabratetop -h
Usage: slabratetop [OPTION...]
Trace slab kmem cache alloc by process.

USAGE: slabratetop [-h] [-p PID] [interval] [count]

EXAMPLES:
    slabratetop            # slab rate top, refresh every 1s
    slabratetop -p 181     # only trace PID 181
    slabratetop -s count   # sort columns by count
    slabratetop -r 100     # print 100 rows
    slabratetop 5 10       # 5s summaries, 10 times

  -C, --noclear              Don't clear the screen
  -p, --pid=PID              Process ID to trace
  -r, --rows=ROWS            Maximum rows to print, default 20
  -s, --sort=SORT            Sort columns, default size [name, count, size]
  -v, --verbose              Verbose debug output
  -?, --help                 Give this help list
      --usage                Give a short usage message
  -V, --version              Print program version

Mandatory or optional arguments to long options are also mandatory or optional
for any corresponding short options.

Report bugs to https://github.com/iovisor/bcc/tree/master/libbpf-tools.

print like:

13:29:26 loadavg: 0.06 0.01 0.02 1/556 9961

CACHE                            ALLOCS      BYTES     
names_cache                          86     374272
filp                                 43      27520
vm_area_struct                       87      22968
anon_vma                             32       8704
mm_struct                             3       5760
anon_vma_chain                       55       5280
cred_jar                             19       4864
dentry                               12       4704
page->ptl                            44       4576
UNIX                                  2       4224
proc_inode_cache                      3       3744
xfs_trans                            11       3256
skbuff_head_cache                     8       2560
seq_file                              8       2496
xfs_log_ticket                       10       2480
sighand_cache                         1       2368
signal_cache                          1       1792
xfs_btree_cur                         5       1440
sock_inode_cache                      1       1408
lsm_file_cache                       43       1376

@Rtoax Rtoax changed the title add slabratetop add slabratetop libbpf-tools Jan 7, 2022
Comment thread libbpf-tools/slabratetop.bpf.c Outdated
Comment thread libbpf-tools/slabratetop.bpf.c
Comment thread libbpf-tools/slabratetop.bpf.c Outdated
Comment thread libbpf-tools/slabratetop.bpf.c Outdated
Comment thread libbpf-tools/slabratetop.c Outdated
Comment thread libbpf-tools/slabratetop.bpf.c Outdated
Comment thread libbpf-tools/slabratetop.bpf.c Outdated
Comment thread libbpf-tools/slabratetop.bpf.c Outdated
Comment thread libbpf-tools/slabratetop.h Outdated
@chenhengqi
Copy link
Copy Markdown
Collaborator

Total same as slabratetop(8), but add some options params:

$ sudo ./slabratetop -h
Usage: slabratetop [OPTION...]
Trace slab kmem cache alloc by process.

USAGE: slabratetop [-h] [-p PID] [interval] [count]

EXAMPLES:
    slabratetop            # slab rate top, refresh every 1s
    slabratetop -p 181     # only trace PID 181
    slabratetop -s count   # sort columns by count
    slabratetop -r 100     # print 100 rows
    slabratetop 5 10       # 5s summaries, 10 times

  -C, --noclear              Don't clear the screen
  -p, --pid=PID              Process ID to trace
  -r, --rows=ROWS            Maximum rows to print, default 20
  -s, --sort=SORT            Sort columns, default size [name, count, size]
  -v, --verbose              Verbose debug output
  -?, --help                 Give this help list
      --usage                Give a short usage message
  -V, --version              Print program version

Mandatory or optional arguments to long options are also mandatory or optional
for any corresponding short options.

Report bugs to https://github.com/iovisor/bcc/tree/master/libbpf-tools.

print like:

13:29:26 loadavg: 0.06 0.01 0.02 1/556 9961

CACHE                            ALLOCS      BYTES     
names_cache                          86     374272
filp                                 43      27520
vm_area_struct                       87      22968
anon_vma                             32       8704
mm_struct                             3       5760
anon_vma_chain                       55       5280
cred_jar                             19       4864
dentry                               12       4704
page->ptl                            44       4576
UNIX                                  2       4224
proc_inode_cache                      3       3744
xfs_trans                            11       3256
skbuff_head_cache                     8       2560
seq_file                              8       2496
xfs_log_ticket                       10       2480
sighand_cache                         1       2368
signal_cache                          1       1792
xfs_btree_cur                         5       1440
sock_inode_cache                      1       1408
lsm_file_cache                       43       1376

LGTM. One more request, please squash your commits and add this to your commit message.

@Rtoax
Copy link
Copy Markdown
Contributor Author

Rtoax commented Jan 10, 2022

Total same as slabratetop(8), but add some options params:

$ sudo ./slabratetop -h
Usage: slabratetop [OPTION...]
Trace slab kmem cache alloc by process.

USAGE: slabratetop [-h] [-p PID] [interval] [count]

EXAMPLES:
    slabratetop            # slab rate top, refresh every 1s
    slabratetop -p 181     # only trace PID 181
    slabratetop -s count   # sort columns by count
    slabratetop -r 100     # print 100 rows
    slabratetop 5 10       # 5s summaries, 10 times

  -C, --noclear              Don't clear the screen
  -p, --pid=PID              Process ID to trace
  -r, --rows=ROWS            Maximum rows to print, default 20
  -s, --sort=SORT            Sort columns, default size [name, count, size]
  -v, --verbose              Verbose debug output
  -?, --help                 Give this help list
      --usage                Give a short usage message
  -V, --version              Print program version

Mandatory or optional arguments to long options are also mandatory or optional
for any corresponding short options.

Report bugs to https://github.com/iovisor/bcc/tree/master/libbpf-tools.

print like:

13:29:26 loadavg: 0.06 0.01 0.02 1/556 9961

CACHE                            ALLOCS      BYTES     
names_cache                          86     374272
filp                                 43      27520
vm_area_struct                       87      22968
anon_vma                             32       8704
mm_struct                             3       5760
anon_vma_chain                       55       5280
cred_jar                             19       4864
dentry                               12       4704
page->ptl                            44       4576
UNIX                                  2       4224
proc_inode_cache                      3       3744
xfs_trans                            11       3256
skbuff_head_cache                     8       2560
seq_file                              8       2496
xfs_log_ticket                       10       2480
sighand_cache                         1       2368
signal_cache                          1       1792
xfs_btree_cur                         5       1440
sock_inode_cache                      1       1408
lsm_file_cache                       43       1376

LGTM. One more request, please squash your commits and add this to your commit message.

Fix in a53b445

@Rtoax
Copy link
Copy Markdown
Contributor Author

Rtoax commented Jan 25, 2022

Total same as slabratetop(8), but add some options params:

$ sudo ./slabratetop -h
Usage: slabratetop [OPTION...]
Trace slab kmem cache alloc by process.

USAGE: slabratetop [-h] [-p PID] [interval] [count]

EXAMPLES:
    slabratetop            # slab rate top, refresh every 1s
    slabratetop -p 181     # only trace PID 181
    slabratetop -s count   # sort columns by count
    slabratetop -r 100     # print 100 rows
    slabratetop 5 10       # 5s summaries, 10 times

  -C, --noclear              Don't clear the screen
  -p, --pid=PID              Process ID to trace
  -r, --rows=ROWS            Maximum rows to print, default 20
  -s, --sort=SORT            Sort columns, default size [name, count, size]
  -v, --verbose              Verbose debug output
  -?, --help                 Give this help list
      --usage                Give a short usage message
  -V, --version              Print program version

Mandatory or optional arguments to long options are also mandatory or optional
for any corresponding short options.

Report bugs to https://github.com/iovisor/bcc/tree/master/libbpf-tools.

print like:

13:29:26 loadavg: 0.06 0.01 0.02 1/556 9961

CACHE                            ALLOCS      BYTES     
names_cache                          86     374272
filp                                 43      27520
vm_area_struct                       87      22968
anon_vma                             32       8704
mm_struct                             3       5760
anon_vma_chain                       55       5280
cred_jar                             19       4864
dentry                               12       4704
page->ptl                            44       4576
UNIX                                  2       4224
proc_inode_cache                      3       3744
xfs_trans                            11       3256
skbuff_head_cache                     8       2560
seq_file                              8       2496
xfs_log_ticket                       10       2480
sighand_cache                         1       2368
signal_cache                          1       1792
xfs_btree_cur                         5       1440
sock_inode_cache                      1       1408
lsm_file_cache                       43       1376

LGTM. One more request, please squash your commits and add this to your commit message.

@Rtoax
Copy link
Copy Markdown
Contributor Author

Rtoax commented Apr 12, 2022

Total same as slabratetop(8), but add some options params:

$ sudo ./slabratetop -h
Usage: slabratetop [OPTION...]
Trace slab kmem cache alloc by process.

USAGE: slabratetop [-h] [-p PID] [interval] [count]

EXAMPLES:
    slabratetop            # slab rate top, refresh every 1s
    slabratetop -p 181     # only trace PID 181
    slabratetop -s count   # sort columns by count
    slabratetop -r 100     # print 100 rows
    slabratetop 5 10       # 5s summaries, 10 times

  -C, --noclear              Don't clear the screen
  -p, --pid=PID              Process ID to trace
  -r, --rows=ROWS            Maximum rows to print, default 20
  -s, --sort=SORT            Sort columns, default size [name, count, size]
  -v, --verbose              Verbose debug output
  -?, --help                 Give this help list
      --usage                Give a short usage message
  -V, --version              Print program version

Mandatory or optional arguments to long options are also mandatory or optional
for any corresponding short options.

Report bugs to https://github.com/iovisor/bcc/tree/master/libbpf-tools.

print like:

13:29:26 loadavg: 0.06 0.01 0.02 1/556 9961

CACHE                            ALLOCS      BYTES     
names_cache                          86     374272
filp                                 43      27520
vm_area_struct                       87      22968
anon_vma                             32       8704
mm_struct                             3       5760
anon_vma_chain                       55       5280
cred_jar                             19       4864
dentry                               12       4704
page->ptl                            44       4576
UNIX                                  2       4224
proc_inode_cache                      3       3744
xfs_trans                            11       3256
skbuff_head_cache                     8       2560
seq_file                              8       2496
xfs_log_ticket                       10       2480
sighand_cache                         1       2368
signal_cache                          1       1792
xfs_btree_cur                         5       1440
sock_inode_cache                      1       1408
lsm_file_cache                       43       1376

LGTM. One more request, please squash your commits and add this to your commit message.

I just squash commits and modify commit message.

Total same as [slabratetop(8)](https://github.com/iovisor/bcc/blob/master/tools/slabratetop.py),
but add some options params:

```bash
$ sudo ./slabratetop -h
Usage: slabratetop [OPTION...]
Trace slab kmem cache alloc by process.

USAGE: slabratetop [-h] [-p PID] [interval] [count]

EXAMPLES:
    slabratetop            # slab rate top, refresh every 1s
    slabratetop -p 181     # only trace PID 181
    slabratetop -s count   # sort columns by count
    slabratetop -r 100     # print 100 rows
    slabratetop 5 10       # 5s summaries, 10 times

  -C, --noclear              Don't clear the screen
  -p, --pid=PID              Process ID to trace
  -r, --rows=ROWS            Maximum rows to print, default 20
  -s, --sort=SORT            Sort columns, default size [name, count, size]
  -v, --verbose              Verbose debug output
  -?, --help                 Give this help list
      --usage                Give a short usage message
  -V, --version              Print program version

Mandatory or optional arguments to long options are also mandatory or optional
for any corresponding short options.

Report bugs to https://github.com/iovisor/bcc/tree/master/libbpf-tools.
```

print like:

```bash
13:29:26 loadavg: 0.06 0.01 0.02 1/556 9961

CACHE                            ALLOCS      BYTES
names_cache                          86     374272
filp                                 43      27520
vm_area_struct                       87      22968
anon_vma                             32       8704
mm_struct                             3       5760
anon_vma_chain                       55       5280
cred_jar                             19       4864
dentry                               12       4704
page->ptl                            44       4576
UNIX                                  2       4224
proc_inode_cache                      3       3744
xfs_trans                            11       3256
skbuff_head_cache                     8       2560
seq_file                              8       2496
xfs_log_ticket                       10       2480
sighand_cache                         1       2368
signal_cache                          1       1792
xfs_btree_cur                         5       1440
sock_inode_cache                      1       1408
lsm_file_cache                       43       1376
```
@davemarchevsky davemarchevsky merged commit fbc1540 into iovisor:master Jul 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants