diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2019-03-06 10:59:36 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2019-03-06 10:59:36 -0500 |
| commit | 203b6609e0ede49eb0b97008b1150c69e9d2ffd3 (patch) | |
| tree | 7d9c1227eeec17f75b2a827e385387f640a365a6 /tools/perf/scripts/python/net_dropmonitor.py | |
| parent | 3478588b5136966c80c571cf0006f08e9e5b8f04 (diff) | |
| parent | c978b9460fe1d4a1e1effa0abd6bd69b18a098a8 (diff) | |
Merge branch 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull perf updates from Ingo Molnar:
"Lots of tooling updates - too many to list, here's a few highlights:
- Various subcommand updates to 'perf trace', 'perf report', 'perf
record', 'perf annotate', 'perf script', 'perf test', etc.
- CPU and NUMA topology and affinity handling improvements,
- HW tracing and HW support updates:
- Intel PT updates
- ARM CoreSight updates
- vendor HW event updates
- BPF updates
- Tons of infrastructure updates, both on the build system and the
library support side
- Documentation updates.
- ... and lots of other changes, see the changelog for details.
Kernel side updates:
- Tighten up kprobes blacklist handling, reduce the number of places
where developers can install a kprobe and hang/crash the system.
- Fix/enhance vma address filter handling.
- Various PMU driver updates, small fixes and additions.
- refcount_t conversions
- BPF updates
- error code propagation enhancements
- misc other changes"
* 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (238 commits)
perf script python: Add Python3 support to syscall-counts-by-pid.py
perf script python: Add Python3 support to syscall-counts.py
perf script python: Add Python3 support to stat-cpi.py
perf script python: Add Python3 support to stackcollapse.py
perf script python: Add Python3 support to sctop.py
perf script python: Add Python3 support to powerpc-hcalls.py
perf script python: Add Python3 support to net_dropmonitor.py
perf script python: Add Python3 support to mem-phys-addr.py
perf script python: Add Python3 support to failed-syscalls-by-pid.py
perf script python: Add Python3 support to netdev-times.py
perf tools: Add perf_exe() helper to find perf binary
perf script: Handle missing fields with -F +..
perf data: Add perf_data__open_dir_data function
perf data: Add perf_data__(create_dir|close_dir) functions
perf data: Fail check_backup in case of error
perf data: Make check_backup work over directories
perf tools: Add rm_rf_perf_data function
perf tools: Add pattern name checking to rm_rf
perf tools: Add depth checking to rm_rf
perf data: Add global path holder
...
Diffstat (limited to 'tools/perf/scripts/python/net_dropmonitor.py')
| -rwxr-xr-x | tools/perf/scripts/python/net_dropmonitor.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/tools/perf/scripts/python/net_dropmonitor.py b/tools/perf/scripts/python/net_dropmonitor.py index a150164b44a3..212557a02c50 100755 --- a/tools/perf/scripts/python/net_dropmonitor.py +++ b/tools/perf/scripts/python/net_dropmonitor.py | |||
| @@ -1,6 +1,8 @@ | |||
| 1 | # Monitor the system for dropped packets and proudce a report of drop locations and counts | 1 | # Monitor the system for dropped packets and proudce a report of drop locations and counts |
| 2 | # SPDX-License-Identifier: GPL-2.0 | 2 | # SPDX-License-Identifier: GPL-2.0 |
| 3 | 3 | ||
| 4 | from __future__ import print_function | ||
| 5 | |||
| 4 | import os | 6 | import os |
| 5 | import sys | 7 | import sys |
| 6 | 8 | ||
| @@ -50,19 +52,19 @@ def get_sym(sloc): | |||
| 50 | return (None, 0) | 52 | return (None, 0) |
| 51 | 53 | ||
| 52 | def print_drop_table(): | 54 | def print_drop_table(): |
| 53 | print "%25s %25s %25s" % ("LOCATION", "OFFSET", "COUNT") | 55 | print("%25s %25s %25s" % ("LOCATION", "OFFSET", "COUNT")) |
| 54 | for i in drop_log.keys(): | 56 | for i in drop_log.keys(): |
| 55 | (sym, off) = get_sym(i) | 57 | (sym, off) = get_sym(i) |
| 56 | if sym == None: | 58 | if sym == None: |
| 57 | sym = i | 59 | sym = i |
| 58 | print "%25s %25s %25s" % (sym, off, drop_log[i]) | 60 | print("%25s %25s %25s" % (sym, off, drop_log[i])) |
| 59 | 61 | ||
| 60 | 62 | ||
| 61 | def trace_begin(): | 63 | def trace_begin(): |
| 62 | print "Starting trace (Ctrl-C to dump results)" | 64 | print("Starting trace (Ctrl-C to dump results)") |
| 63 | 65 | ||
| 64 | def trace_end(): | 66 | def trace_end(): |
| 65 | print "Gathering kallsyms data" | 67 | print("Gathering kallsyms data") |
| 66 | get_kallsyms_table() | 68 | get_kallsyms_table() |
| 67 | print_drop_table() | 69 | print_drop_table() |
| 68 | 70 | ||
