Unify python executables to use `#!/usr/bin/env python` shebang (#2102)
authorAlexey Ivanov <SaveTheRbtz@GMail.com>
Thu, 3 Jan 2019 21:46:38 +0000 (13:46 -0800)
committeryonghong-song <ys114321@gmail.com>
Thu, 3 Jan 2019 21:46:38 +0000 (13:46 -0800)
* fixed shebangs in tools (and lib)

* fixed shebangs in examples

* do not mangle shebangs in rpm spec

* renamed style-check.sh to c-style-check.sh

* factored out python linter to a separate file

* added shebang validation to the py-style-check

* added shebangs to all python executables

118 files changed:
.travis.yml
SPECS/bcc.spec
examples/networking/dns_matching/dns_matching.py
examples/networking/http_filter/http-parse-complete.py
examples/networking/http_filter/http-parse-simple.py
examples/networking/simple_tc.py
examples/networking/vlan_filter/data-plane-tracing.py
examples/tracing/bitehist.py
examples/tracing/disksnoop.py
examples/tracing/mallocstacks.py
examples/tracing/mysqld_query.py
examples/tracing/nodejs_http_server.py
examples/tracing/stacksnoop.py
examples/tracing/strlen_count.py
examples/tracing/strlen_hist.py
examples/tracing/strlen_snoop.py
examples/tracing/sync_timing.py
examples/tracing/task_switch.py
examples/tracing/tcpv4connect.py
examples/tracing/urandomread-explicit.py
examples/tracing/urandomread.py
examples/tracing/vfsreadlat.py
examples/usdt_sample/scripts/lat_avg.py
examples/usdt_sample/scripts/lat_dist.py
examples/usdt_sample/scripts/latency.py
scripts/c-style-check.sh [moved from scripts/style-check.sh with 100% similarity]
scripts/py-style-check.sh [new file with mode: 0755]
tests/CMakeLists.txt
tools/bashreadline.py
tools/biolatency.py
tools/biosnoop.py
tools/biotop.py
tools/bitesize.py
tools/bpflist.py
tools/btrfsdist.py
tools/btrfsslower.py
tools/cachestat.py
tools/capable.py
tools/cpudist.py
tools/cpuunclaimed.py
tools/criticalstat.py
tools/dbslower.py
tools/dbstat.py
tools/dcsnoop.py
tools/dcstat.py
tools/execsnoop.py
tools/ext4dist.py
tools/ext4slower.py
tools/filelife.py
tools/fileslower.py
tools/filetop.py
tools/funccount.py
tools/funclatency.py
tools/funcslower.py
tools/gethostlatency.py
tools/hardirqs.py
tools/killsnoop.py
tools/lib/ucalls.py
tools/lib/uflow.py
tools/lib/ugc.py
tools/lib/uobjnew.py
tools/lib/ustat.py
tools/lib/uthreads.py
tools/llcstat.py
tools/mdflush.py
tools/mysqld_qslower.py
tools/nfsdist.py
tools/nfsslower.py
tools/offcputime.py
tools/offwaketime.py
tools/old/bashreadline.py
tools/old/biosnoop.py
tools/old/filelife.py
tools/old/gethostlatency.py
tools/old/killsnoop.py
tools/old/offcputime.py
tools/old/offwaketime.py
tools/old/opensnoop.py
tools/old/profile.py
tools/old/softirqs.py
tools/old/stackcount.py
tools/old/stacksnoop.py
tools/old/statsnoop.py
tools/old/syncsnoop.py
tools/old/tcpaccept.py
tools/old/tcpconnect.py
tools/old/wakeuptime.py
tools/opensnoop.py
tools/pidpersec.py
tools/profile.py
tools/runqlat.py
tools/runqlen.py
tools/runqslower.py
tools/shmsnoop.py
tools/slabratetop.py
tools/sofdsnoop.py
tools/softirqs.py
tools/sslsniff.py
tools/statsnoop.py
tools/syncsnoop.py
tools/tcpaccept.py
tools/tcpconnect.py
tools/tcpconnlat.py
tools/tcpdrop.py
tools/tcplife.py
tools/tcpretrans.py
tools/tcpstates.py
tools/tcpsubnet.py
tools/tcptop.py
tools/tcptracer.py
tools/ttysnoop.py
tools/vfscount.py
tools/vfsstat.py
tools/wakeuptime.py
tools/xfsdist.py
tools/xfsslower.py
tools/zfsdist.py
tools/zfsslower.py

index dd36669..9835547 100644 (file)
@@ -3,5 +3,6 @@ install:
   - sudo apt-get install -y python-pip
   - sudo pip install pep8
 script:
+  - set -euo pipefail
   - ./scripts/check-helpers.sh
-  - find tools/ -type f -name "*.py" | xargs pep8 -r --show-source --ignore=E123,E125,E126,E127,E128,E302
+  - ./scripts/py-style-check.sh
index f74bb61..691ab3d 100644 (file)
@@ -88,10 +88,6 @@ popd
 %install
 pushd build
 make install/strip DESTDIR=%{buildroot}
-# mangle shebangs
-find %{buildroot}/usr/share/bcc/{tools,examples} -type f -exec \
-    sed -i -e '1 s|^#!/usr/bin/python$|#!'%{__python}'|' \
-           -e '1 s|^#!/usr/bin/env python$|#!'%{__python}'|' {} \;
 
 %package -n libbcc
 Summary: Shared Library for BPF Compiler Collection (BCC)
index 943dca5..c8625cd 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 
 from __future__ import print_function
 from bcc import BPF
index f1e5e0a..1218cb2 100644 (file)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 #
 #Bertrone Matteo - Polytechnic of Turin
 #November 2015
index b702393..1fad0d8 100644 (file)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 #
 #Bertrone Matteo - Polytechnic of Turin
 #November 2015
index ec0a3e7..4dd8aa5 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 # Copyright (c) PLUMgrid, Inc.
 # Licensed under the Apache License, Version 2.0 (the "License")
 
index efaa7f1..975552f 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 from __future__ import print_function
 from bcc import BPF
 
index c8c7f7a..410424b 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 #
 # bitehist.py  Block I/O size histogram.
 #              For Linux, uses BCC, eBPF. Embedded C.
index ed3dd81..c30ac0a 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 #
 # disksnoop.py Trace block device I/O: basic version of iosnoop.
 #              For Linux, uses BCC, eBPF. Embedded C.
index 2f3eb25..4820447 100644 (file)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 #
 # mallocstacks  Trace malloc() calls in a process and print the full
 #               stack trace for all callsites.
index 15ff297..cf877d1 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 #
 # mysqld_query    Trace MySQL server queries. Example of USDT tracing.
 #                 For Linux, uses BCC, BPF. Embedded C.
index 1017de5..367e9d7 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 #
 # nodejs_http_server    Basic example of node.js USDT tracing.
 #                       For Linux, uses BCC, BPF. Embedded C.
index bced93f..d16b59d 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 #
 # stacksnoop    Trace a kernel function and print all kernel stack traces.
 #               For Linux, uses BCC, eBPF, and currently x86_64 only. Inline C.
index 49d7080..103464f 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 #
 # strlen_count  Trace strlen() and print a frequency count of strings.
 #               For Linux, uses BCC, eBPF. Embedded C.
index dda1cb2..4652c4a 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 
 #
 # strlen_hist.py   Histogram of system-wide strlen return values
index c3c7199..44be1ac 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 #
 # strlen_snoop  Trace strlen() library function for a given PID.
 #               For Linux, uses BCC, eBPF. Embedded C.
index 675ad14..a00bf5a 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 #
 # sync_timing.py    Trace time between syncs.
 #                   For Linux, uses BCC, eBPF. Embedded C.
index 161edfb..46d43ba 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 # Copyright (c) PLUMgrid, Inc.
 # Licensed under the Apache License, Version 2.0 (the "License")
 
index 8a89469..5b03717 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 #
 # tcpv4connect Trace TCP IPv4 connect()s.
 #              For Linux, uses BCC, eBPF. Embedded C.
index 448ffdf..7be545a 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 #
 # urandomread-explicit  Example of instrumenting a kernel tracepoint.
 #                       For Linux, uses BCC, BPF. Embedded C.
index 319db2c..80ea9de 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 #
 # urandomread  Example of instrumenting a kernel tracepoint.
 #              For Linux, uses BCC, BPF. Embedded C.
index b2c4156..f4daae5 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 #
 # vfsreadlat.py                VFS read latency distribution.
 #                      For Linux, uses BCC, eBPF. See .c file.
index be473d1..36c4dbb 100755 (executable)
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
 import argparse
 from time import sleep, strftime
 from sys import argv
index af13e89..647f295 100755 (executable)
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
 import argparse
 from time import sleep, strftime
 from sys import argv
index 4170592..d46f2ef 100755 (executable)
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
 import argparse
 from time import sleep
 from sys import argv
diff --git a/scripts/py-style-check.sh b/scripts/py-style-check.sh
new file mode 100755 (executable)
index 0000000..d8c5ece
--- /dev/null
@@ -0,0 +1,17 @@
+#!/bin/bash
+
+set -euo pipefail
+
+# TODO: stop ignoring this. Maybe autopep8 existing stuff?
+find tools -type f -name "*.py" | xargs pep8 -r --show-source --ignore=E123,E125,E126,E127,E128,E302 || \
+    echo "pep8 run failed, please fix it" >&2
+
+NO_PROPER_SHEBANG="$(find tools examples -type f -executable -name '*.py' | xargs grep -L '#!/usr/bin/env python')"
+if [ -n "$NO_PROPER_SHEBANG" ]; then
+    echo "bad shebangs found:"
+    echo "$NO_PROPER_SHEBANG"
+    echo
+    echo "either add proper shebang or remove executable bit" >&2
+
+    exit 1
+fi
index 86abec9..11960a7 100644 (file)
@@ -4,7 +4,7 @@ configure_file(wrapper.sh.in "${CMAKE_CURRENT_BINARY_DIR}/wrapper.sh" @ONLY)
 
 set(TEST_WRAPPER ${CMAKE_CURRENT_BINARY_DIR}/wrapper.sh)
 
-add_test(NAME style-check COMMAND ${CMAKE_SOURCE_DIR}/scripts/style-check.sh)
+add_test(NAME style-check COMMAND ${CMAKE_SOURCE_DIR}/scripts/c-style-check.sh)
 set_tests_properties(style-check PROPERTIES PASS_REGULAR_EXPRESSION ".*")
 
 if(ENABLE_CLANG_JIT)
index da9c1b7..3d74c93 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 #
 # bashreadline  Print entered bash commands from all running shells.
 #               For Linux, uses BCC, eBPF. Embedded C.
index 68aa577..0c6b6bc 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 # @lint-avoid-python-3-compatibility-imports
 #
 # biolatency    Summarize block device I/O latency as a histogram.
index 259a81b..51b3a7f 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 # @lint-avoid-python-3-compatibility-imports
 #
 # biosnoop  Trace block device I/O and print details including issuing PID.
index b2b5089..2aab1fc 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 # @lint-avoid-python-3-compatibility-imports
 #
 # biotop  block device (disk) I/O by process.
index f70f091..e57185d 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 #
 # bitehist.py   Block I/O size histogram.
 #               For Linux, uses BCC, eBPF. See .c file.
index f73e945..85220b6 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 #
 # bpflist   Display processes currently using BPF programs and maps,
 #           pinned BPF programs and maps, and enabled probes.
index 4659ab4..a0aeb24 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 # @lint-avoid-python-3-compatibility-imports
 #
 # btrfsdist  Summarize btrfs operation latency.
index 0a59820..cff61b8 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 # @lint-avoid-python-3-compatibility-imports
 #
 # btrfsslower  Trace slow btrfs operations.
index b00c804..90a55b0 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 #
 # cachestat     Count cache kernel function calls.
 #               For Linux, uses BCC, eBPF. See .c file.
index 65ffa77..368f4b0 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 # @lint-avoid-python-3-compatibility-imports
 #
 # capable   Trace security capabilitiy checks (cap_capable()).
index 4d7c9eb..9e61341 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 # @lint-avoid-python-3-compatibility-imports
 #
 # cpudist   Summarize on- and off-CPU time per task as a histogram.
index b862bad..c899398 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 # @lint-avoid-python-3-compatibility-imports
 #
 # cpuunclaimed   Sample CPU run queues and calculate unclaimed idle CPU.
index 68c16f7..38c318d 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 # @lint-avoid-python-3-compatibility-imports
 #
 # criticalstat  Trace long critical sections (IRQs or preemption disabled)
index 24e6394..a42df87 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 #
 # dbslower      Trace MySQL and PostgreSQL queries slower than a threshold.
 #
index a89b097..1d98436 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 #
 # dbstat        Display a histogram of MySQL and PostgreSQL query latencies.
 #
index 4c37571..1452191 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 # @lint-avoid-python-3-compatibility-imports
 #
 # dcsnoop   Trace directory entry cache (dcache) lookups.
index 5ecddd1..2009a19 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 # @lint-avoid-python-3-compatibility-imports
 #
 # dcstat   Directory entry cache (dcache) stats.
index 0c2c065..e27e50e 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 # @lint-avoid-python-3-compatibility-imports
 #
 # execsnoop Trace new processes via exec() syscalls.
index bc797fb..b71cfda 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 # @lint-avoid-python-3-compatibility-imports
 #
 # ext4dist  Summarize ext4 operation latency.
index 16b56ec..344e68f 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 # @lint-avoid-python-3-compatibility-imports
 #
 # ext4slower  Trace slow ext4 operations.
index f66f00b..4095273 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 # @lint-avoid-python-3-compatibility-imports
 #
 # filelife    Trace the lifespan of short-lived files.
index ce7132a..0515242 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 # @lint-avoid-python-3-compatibility-imports
 #
 # fileslower  Trace slow synchronous file reads and writes.
index 4c7a28a..e9f67a2 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 # @lint-avoid-python-3-compatibility-imports
 #
 # filetop  file reads and writes by process.
index 69dd01c..fcb96b8 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 # @lint-avoid-python-3-compatibility-imports
 #
 # funccount Count functions, tracepoints, and USDT probes.
index 3f08a7e..f23d8f0 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 # @lint-avoid-python-3-compatibility-imports
 #
 # funclatency   Time functions and print latency as a histogram.
index 283c801..2143583 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 # @lint-avoid-python-3-compatibility-imports
 #
 # funcslower  Trace slow kernel or user function calls.
index 8d07e23..84c7988 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 #
 # gethostlatency  Show latency for getaddrinfo/gethostbyname[2] calls.
 #                 For Linux, uses BCC, eBPF. Embedded C.
index 589a890..1f5983a 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 # @lint-avoid-python-3-compatibility-imports
 #
 # hardirqs  Summarize hard IRQ (interrupt) event time.
index 16221a2..ce03d37 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 # @lint-avoid-python-3-compatibility-imports
 #
 # killsnoop Trace signals issued by the kill() syscall.
index 352e4d7..3b90b91 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 # @lint-avoid-python-3-compatibility-imports
 #
 # ucalls  Summarize method calls in high-level languages and/or system calls.
index 63fab87..2bfe36b 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 # @lint-avoid-python-3-compatibility-imports
 #
 # uflow  Trace method execution flow in high-level languages.
index 8841d5f..77f125e 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 # @lint-avoid-python-3-compatibility-imports
 #
 # ugc  Summarize garbage collection events in high-level languages.
index 85f5768..8159f9a 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 # @lint-avoid-python-3-compatibility-imports
 #
 # uobjnew  Summarize object allocations in high-level languages.
index 1edc985..ef29d76 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 # @lint-avoid-python-3-compatibility-imports
 #
 # ustat  Activity stats from high-level languages, including exceptions,
index 90d0a74..00dd68b 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 # @lint-avoid-python-3-compatibility-imports
 #
 # uthreads  Trace thread creation/destruction events in high-level languages.
index ec2c1f8..b491543 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 #
 # llcstat.py Summarize cache references and cache misses by PID.
 #            Cache reference and cache miss are corresponding events defined in
index 485635d..507614b 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 # @lint-avoid-python-3-compatibility-imports
 #
 # mdflush  Trace md flush events.
index ab23b5b..5737d18 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 #
 # mysqld_qslower    MySQL server queries slower than a threshold.
 #                   For Linux, uses BCC, BPF. Embedded C.
index ff78506..e3317a4 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 # @lint-avoid-python-3-compatibility-imports
 #
 # nfsdist   Summarize NFS operation latency
index 32e91c7..8113eff 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 # @lint-avoid-python-3-compatibility-imports
 #
 # nfsslower     Trace slow NFS operations
index d84ae52..6440260 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 #
 # offcputime    Summarize off-CPU time by stack trace
 #               For Linux, uses BCC, eBPF.
index 38a9ff2..3c4f0f3 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 #
 # offwaketime   Summarize blocked time by kernel off-CPU stack + waker stack
 #               For Linux, uses BCC, eBPF.
index 571b662..c4b8ec2 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 #
 # bashreadline  Print entered bash commands from all running shells.
 #               For Linux, uses BCC, eBPF. Embedded C.
index 37ee3f9..96db56b 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 # @lint-avoid-python-3-compatibility-imports
 #
 # biosnoop  Trace block device I/O and print details including issuing PID.
index 075be08..af64b53 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 # @lint-avoid-python-3-compatibility-imports
 #
 # filelife    Trace the lifespan of short-lived files.
index 7d32cb8..4d87c83 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 #
 # gethostlatency  Show latency for getaddrinfo/gethostbyname[2] calls.
 #                 For Linux, uses BCC, eBPF. Embedded C.
index ddf9d5a..e2d4cb5 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 # @lint-avoid-python-3-compatibility-imports
 #
 # killsnoop Trace signals issued by the kill() syscall.
index 38d12a2..dc89063 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 #
 # offcputime    Summarize off-CPU time by kernel stack trace
 #               For Linux, uses BCC, eBPF.
index 3b5bb36..b5fdd0f 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 #
 # offwaketime   Summarize blocked time by kernel off-CPU stack + waker stack
 #               For Linux, uses BCC, eBPF.
index 5df3b41..3736ec2 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 # @lint-avoid-python-3-compatibility-imports
 #
 # opensnoop Trace open() syscalls.
index e308208..f0328d2 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 # @lint-avoid-python-3-compatibility-imports
 #
 # profile  Profile CPU usage by sampling stack traces at a timed interval.
index 3b40b1a..30495bc 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 # @lint-avoid-python-3-compatibility-imports
 #
 # softirqs  Summarize soft IRQ (interrupt) event time.
index 108c800..6eee27f 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 #
 # stackcount    Count kernel function calls and their stack traces.
 #               For Linux, uses BCC, eBPF.
index 9fcc12b..238ab82 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 #
 # stacksnoop    Trace a kernel function and print all kernel stack traces.
 #               For Linux, uses BCC, eBPF, and currently x86_64 only. Inline C.
index ad54ac7..82128c2 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 # @lint-avoid-python-3-compatibility-imports
 #
 # statsnoop Trace stat() syscalls.
index cae57ea..b14309d 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 # @lint-avoid-python-3-compatibility-imports
 #
 # syncsnoop Trace sync() syscall.
index 8125eaa..cc0c240 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 # @lint-avoid-python-3-compatibility-imports
 #
 # tcpaccept Trace TCP accept()s.
index 579a85f..e0a59e9 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 # @lint-avoid-python-3-compatibility-imports
 #
 # tcpconnect    Trace TCP connect()s.
index 783c7ff..512e4f4 100644 (file)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 #
 # wakeuptime    Summarize sleep to wakeup time by waker kernel stack
 #               For Linux, uses BCC, eBPF.
index 2a00737..1a68f69 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 # @lint-avoid-python-3-compatibility-imports
 #
 # opensnoop Trace open() syscalls.
index c449004..aff1219 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 # @lint-avoid-python-3-compatibility-imports
 #
 # pidpersec Count new processes (via fork).
index d1d3d26..084ac63 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 # @lint-avoid-python-3-compatibility-imports
 #
 # profile  Profile CPU usage by sampling stack traces at a timed interval.
index 9fd4064..9c56d22 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 # @lint-avoid-python-3-compatibility-imports
 #
 # runqlat   Run queue (scheduler) latency as a histogram.
index b56a591..4ff515d 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 # @lint-avoid-python-3-compatibility-imports
 #
 # runqlen    Summarize scheduler run queue length as a histogram.
index 7af12e5..da8d486 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 # @lint-avoid-python-3-compatibility-imports
 #
 # runqslower    Trace long process scheduling delays.
index ef99064..db42967 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 # @lint-avoid-python-3-compatibility-imports
 #
 # shmsnoop Trace shm*() syscalls.
index 101c585..ab6c08c 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 # @lint-avoid-python-3-compatibility-imports
 #
 # slabratetop  Summarize kmem_cache_alloc() calls.
index d6e131e..8256481 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 # @lint-avoid-python-3-compatibility-imports
 #
 # sofdsnoop traces file descriptors passed via socket
index 1e2daf5..10ebc38 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 # @lint-avoid-python-3-compatibility-imports
 #
 # softirqs  Summarize soft IRQ (interrupt) event time.
index 265e87f..f7bc117 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 #
 # sslsniff  Captures data on read/recv or write/send functions of OpenSSL,
 #           GnuTLS and NSS
index 516eda2..9e585be 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 # @lint-avoid-python-3-compatibility-imports
 #
 # statsnoop Trace stat() syscalls.
index 708fbc4..eb892ba 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 # @lint-avoid-python-3-compatibility-imports
 #
 # syncsnoop Trace sync() syscall.
index e278075..d8ef4eb 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 # @lint-avoid-python-3-compatibility-imports
 #
 # tcpaccept Trace TCP accept()s.
index 13c987b..e1f4461 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 # @lint-avoid-python-3-compatibility-imports
 #
 # tcpconnect    Trace TCP connect()s.
index 9f25f0f..92dc2c1 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 # @lint-avoid-python-3-compatibility-imports
 #
 # tcpconnlat    Trace TCP active connection latency (connect).
index ca89be6..82f66a7 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 # @lint-avoid-python-3-compatibility-imports
 #
 # tcpdrop   Trace TCP kernel-dropped packets/segments.
index 4639582..e7d29d4 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 # @lint-avoid-python-3-compatibility-imports
 #
 # tcplife   Trace the lifespan of TCP sessions and summarize.
index 47ac8c1..442fd3e 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 # @lint-avoid-python-3-compatibility-imports
 #
 # tcpretrans    Trace or count TCP retransmits and TLPs.
index 4a21f02..736de97 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 # -*- coding: utf-8 -*-
 # @lint-avoid-python-3-compatibility-imports
 #
index 5f2a806..bf944e1 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 # @lint-avoid-python-3-compatibility-imports
 #
 # tcpsubnet   Summarize TCP bytes sent to different subnets.
index e1eb241..a8451d2 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 # @lint-avoid-python-3-compatibility-imports
 #
 # tcptop    Summarize TCP send/recv throughput by host.
index cc92c3f..8f272eb 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 #
 # tcpv4tracer   Trace TCP connections.
 #               For Linux, uses BCC, eBPF. Embedded C.
index 07f272f..aa18d24 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 # @lint-avoid-python-3-compatibility-imports
 #
 # ttysnoop   Watch live output from a tty or pts device.
index 10c6b1e..285cd8b 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 # @lint-avoid-python-3-compatibility-imports
 #
 # vfscount  Count VFS calls ("vfs_*").
index 1764c60..4a55f8c 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 # @lint-avoid-python-3-compatibility-imports
 #
 # vfsstat   Count some VFS calls.
index 18e70e4..68e8857 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 #
 # wakeuptime    Summarize sleep to wakeup time by waker kernel stack
 #               For Linux, uses BCC, eBPF.
index f409f90..1a7fdd9 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 # @lint-avoid-python-3-compatibility-imports
 #
 # xfsdist  Summarize XFS operation latency.
index b79527b..5b4e0a2 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 # @lint-avoid-python-3-compatibility-imports
 #
 # xfsslower  Trace slow XFS operations.
index 6b29b99..9330739 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 # @lint-avoid-python-3-compatibility-imports
 #
 # zfsdist  Summarize ZFS operation latency.
index 7bf160b..6f0382a 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 # @lint-avoid-python-3-compatibility-imports
 #
 # zfsslower  Trace slow ZFS operations.