Commit d38d3f19 authored by 4ast's avatar 4ast

Merge pull request #319 from iovisor/cmake_fixes

Updates to use cmake GLOB and libbcc.so.0 in python init
parents f50ca1fa 5bd0eb21
set(EXAMPLE_FILES bitehist.c bitehist_example.txt disksnoop.c file(GLOB C_FILES *.c)
disksnoop_example.txt task_switch.c tcpv4connect tcpv4connect_example.txt file(GLOB PY_FILES *.py)
vfsreadlat.c vfsreadlat_example.txt) file(GLOB TXT_FILES *.txt)
set(EXAMPLE_PROGRAMS bitehist.py disksnoop.py task_switch.py trace_fields.py vfsreadlat.py) install(PROGRAMS ${PY_FILES} DESTINATION share/bcc/examples/tracing)
install(FILES ${EXAMPLE_FILES} DESTINATION share/bcc/examples/tracing) install(FILES ${C_FILES} DESTINATION share/bcc/examples/tracing)
install(PROGRAMS ${EXAMPLE_PROGRAMS} DESTINATION share/bcc/examples/tracing) install(FILES ${TXT_FILES} DESTINATION share/bcc/examples/tracing)
...@@ -3,7 +3,7 @@ Demonstrations of bitehist.py, the Linux eBPF/bcc version. ...@@ -3,7 +3,7 @@ Demonstrations of bitehist.py, the Linux eBPF/bcc version.
This prints a power-of-2 histogram to show the block I/O size distribution. This prints a power-of-2 histogram to show the block I/O size distribution.
A summary is printed after Ctrl-C is hit. A summary is printed after Ctrl-C is hit.
# ./bitehist.py # ./bitehist.py
Tracing... Hit Ctrl-C to end. Tracing... Hit Ctrl-C to end.
^C ^C
kbytes : count distribution kbytes : count distribution
......
Demonstrations of tcpv4connect, the Linux eBPF/bcc version. Demonstrations of tcpv4connect.py, the Linux eBPF/bcc version.
This example traces the kernel function performing active TCP IPv4 connections This example traces the kernel function performing active TCP IPv4 connections
(eg, via a connect() syscall; accept() are passive connections). Some example (eg, via a connect() syscall; accept() are passive connections). Some example
output (IP addresses changed to protect the innocent): output (IP addresses changed to protect the innocent):
# ./tcpv4connect # ./tcpv4connect.py
PID COMM SADDR DADDR DPORT PID COMM SADDR DADDR DPORT
1479 telnet 127.0.0.1 127.0.0.1 23 1479 telnet 127.0.0.1 127.0.0.1 23
1469 curl 10.201.219.236 54.245.105.25 80 1469 curl 10.201.219.236 54.245.105.25 80
......
set(FILES biolatency.8 biosnoop.8 funccount.8 funclatency.8 hardirqs.8 file(GLOB FILES *.8)
killsnoop.8 opensnoop.8 pidpersec.8 softirqs.8 syncsnoop.8 tcpaccept.8
tcpconnect.8 vfscount.8 vfsstat.8)
install(FILES ${FILES} DESTINATION share/bcc/man/man8) install(FILES ${FILES} DESTINATION share/bcc/man/man8)
...@@ -24,7 +24,7 @@ from subprocess import Popen, PIPE ...@@ -24,7 +24,7 @@ from subprocess import Popen, PIPE
import sys import sys
basestring = (unicode if sys.version_info[0] < 3 else str) basestring = (unicode if sys.version_info[0] < 3 else str)
lib = ct.CDLL("libbcc.so") lib = ct.CDLL("libbcc.so.0")
# keep in sync with bpf_common.h # keep in sync with bpf_common.h
lib.bpf_module_create_b.restype = ct.c_void_p lib.bpf_module_create_b.restype = ct.c_void_p
......
set(PROGRAMS biolatency biosnoop funccount funclatency hardirqs killsnoop file(GLOB C_FILES *.c)
opensnoop pidpersec softirqs syncsnoop tcpaccept tcpconnect vfscount vfsstat) file(GLOB PY_FILES *.py)
set(C_FILES pidpersec.c vfscount.c vfsstat.c) file(GLOB TXT_FILES *.txt)
set(EXAMPLE_FILES biolatency_example.txt funclatency_example.txt foreach(FIL ${PY_FILES})
killsnoop_example.txt pidpersec_example.txt syncsnoop_example.txt get_filename_component(FIL_WE ${FIL} NAME_WE)
tcpconnect_example.txt vfsstat_example.txt biosnoop_example.txt install(PROGRAMS ${FIL} DESTINATION share/bcc/tools RENAME ${FIL_WE})
funccount_example.txt hardirqs_example.txt opensnoop_example.txt endforeach()
softirqs_example.txt tcpaccept_example.txt vfscount_example.txt)
install(PROGRAMS ${PROGRAMS} DESTINATION share/bcc/tools)
install(FILES ${C_FILES} DESTINATION share/bcc/tools) install(FILES ${C_FILES} DESTINATION share/bcc/tools)
install(FILES ${EXAMPLE_FILES} DESTINATION share/bcc/tools/doc) install(FILES ${TXT_FILES} DESTINATION share/bcc/tools/doc)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment