Skip to content

Commit

Permalink
Rename python module name to 'bcc' from 'bpf'
Browse files Browse the repository at this point in the history
* Rename python module to bcc
* Rename python-bpf (deb,rpm) package to python-bcc
* Pending this change, I will likely re-tag 0.1.6, and upload the bcc
  package to pypi.python.org

Signed-off-by: Brenden Blanco <[email protected]>
  • Loading branch information
Brenden Blanco committed Sep 3, 2015
1 parent fb18027 commit c35989d
Show file tree
Hide file tree
Showing 35 changed files with 48 additions and 150 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ detail of how this all works.

First, we should include the BPF class from the bpf module:
```python
from bpf import BPF
from bcc import BPF
```

Since the C code is so short, we will embed it inside the python script.
Expand Down Expand Up @@ -158,7 +158,7 @@ argument). The `get_table` API returns an object that gives dict-style access
to the stats BPF map. The python program could use that handle to modify the
kernel table as well.
```python
from bpf import BPF
from bcc import BPF
from time import sleep
b = BPF(src_file="task_switch.c")
Expand Down
9 changes: 4 additions & 5 deletions SPECS/bcc.el6.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -96,15 +96,14 @@ Summary: Examples for BPF Compiler Collection (BCC)
%description -n libbcc-examples
Examples for BPF Compiler Collection (BCC)

%package -n python-bpf
%package -n python-bcc
Summary: Python bindings for BPF Compiler Collection (BCC)
%description -n python-bpf
%description -n python-bcc
Python bindings for BPF Compiler Collection (BCC)

%files -n python-bpf
%{python_sitelib}/bpf*
%files -n python-bcc
%{python_sitelib}/bcc*
%exclude %{python_sitelib}/*.egg-info
/usr/bin/bpf-run

%files -n libbcc
/usr/lib64/*
Expand Down
9 changes: 4 additions & 5 deletions SPECS/bcc.el7.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,14 @@ Summary: Examples for BPF Compiler Collection (BCC)
%description -n libbcc-examples
Examples for BPF Compiler Collection (BCC)

%package -n python-bpf
%package -n python-bcc
Summary: Python bindings for BPF Compiler Collection (BCC)
%description -n python-bpf
%description -n python-bcc
Python bindings for BPF Compiler Collection (BCC)

%files -n python-bpf
%{python_sitelib}/bpf*
%files -n python-bcc
%{python_sitelib}/bcc*
%exclude %{python_sitelib}/*.egg-info
/usr/bin/bpf-run

%files -n libbcc
/usr/lib64/*
Expand Down
9 changes: 4 additions & 5 deletions SPECS/bcc.f22.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,14 @@ Summary: Examples for BPF Compiler Collection (BCC)
%description -n libbcc-examples
Examples for BPF Compiler Collection (BCC)

%package -n python-bpf
%package -n python-bcc
Summary: Python bindings for BPF Compiler Collection (BCC)
%description -n python-bpf
%description -n python-bcc
Python bindings for BPF Compiler Collection (BCC)

%files -n python-bpf
%{python_sitelib}/bpf*
%files -n python-bcc
%{python_sitelib}/bcc*
%exclude %{python_sitelib}/*.egg-info
/usr/bin/bpf-run

%files -n libbcc
/usr/lib64/*
Expand Down
2 changes: 1 addition & 1 deletion debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Architecture: any
Depends: libbcc
Description: Shared Library for BPF Compiler Collection (BCC)

Package: python-bpf
Package: python-bcc
Architecture: all
Depends: libbcc, python
Description: Python wrappers for BPF Compiler Collection (BCC)
2 changes: 1 addition & 1 deletion examples/bitehist.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#
# 15-Aug-2015 Brendan Gregg Created this.

from bpf import BPF
from bcc import BPF
from ctypes import c_ushort, c_int, c_ulonglong
from time import sleep
from sys import argv
Expand Down
2 changes: 1 addition & 1 deletion examples/disksnoop.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# 11-Aug-2015 Brendan Gregg Created this.

from __future__ import print_function
from bpf import BPF
from bcc import BPF
import sys

REQ_WRITE = 1 # from include/linux/blk_types.h
Expand Down
2 changes: 1 addition & 1 deletion examples/distributed_bridge/tunnel.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Licensed under the Apache License, Version 2.0 (the "License")

from sys import argv
from bpf import BPF
from bcc import BPF
from builtins import input
from ctypes import c_int, c_uint
from http.server import HTTPServer, SimpleHTTPRequestHandler
Expand Down
2 changes: 1 addition & 1 deletion examples/distributed_bridge/tunnel_mesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Licensed under the Apache License, Version 2.0 (the "License")

from sys import argv
from bpf import BPF
from bcc import BPF
from builtins import input
from ctypes import c_int, c_uint
from http.server import HTTPServer, SimpleHTTPRequestHandler
Expand Down
2 changes: 1 addition & 1 deletion examples/hello_world.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# run in project examples directory with:
# sudo ./hello_world.py"

from bpf import BPF
from bcc import BPF

prog = """
int hello(void *ctx) {
Expand Down
2 changes: 1 addition & 1 deletion examples/simple_tc.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Copyright (c) PLUMgrid, Inc.
# Licensed under the Apache License, Version 2.0 (the "License")

from bpf import BPF
from bcc import BPF
from pyroute2 import IPRoute

ipr = IPRoute()
Expand Down
2 changes: 1 addition & 1 deletion examples/task_switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Copyright (c) PLUMgrid, Inc.
# Licensed under the Apache License, Version 2.0 (the "License")

from bpf import BPF
from bcc import BPF
from time import sleep

b = BPF(src_file="task_switch.c")
Expand Down
2 changes: 1 addition & 1 deletion examples/tc_neighbor_sharing.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
# pass() |


from bpf import BPF
from bcc import BPF
from pyroute2 import IPRoute, NetNS, IPDB, NSPopen
from simulation import Simulation
import sys
Expand Down
2 changes: 1 addition & 1 deletion examples/tunnel_monitor/monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Copyright (c) PLUMgrid, Inc.
# Licensed under the Apache License, Version 2.0 (the "License")

from bpf import BPF
from bcc import BPF
from ctypes import c_uint, c_int, c_ulonglong, Structure
import json
from netaddr import IPAddress
Expand Down
2 changes: 1 addition & 1 deletion examples/vfsreadlat.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#
# 15-Aug-2015 Brendan Gregg Created this.

from bpf import BPF
from bcc import BPF
from ctypes import c_ushort, c_int, c_ulonglong
from time import sleep
from sys import argv
Expand Down
2 changes: 1 addition & 1 deletion examples/vlan_learning.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
# phys | veth |
# switch | |

from bpf import BPF
from bcc import BPF
from builtins import input
from pyroute2 import IPRoute, NetNS, IPDB, NSPopen
from random import shuffle
Expand Down
9 changes: 4 additions & 5 deletions src/python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,17 @@ macro(symlink_file SRC DST)
execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink ${SRC} ${DST})
endmacro()

symlink_file(${CMAKE_CURRENT_SOURCE_DIR}/bpf ${CMAKE_CURRENT_BINARY_DIR}/bpf)
symlink_file(${CMAKE_CURRENT_SOURCE_DIR}/bpf-run ${CMAKE_CURRENT_BINARY_DIR}/bpf-run)
symlink_file(${CMAKE_CURRENT_SOURCE_DIR}/bcc ${CMAKE_CURRENT_BINARY_DIR}/bcc)

set(PIP_INSTALLABLE "${CMAKE_CURRENT_BINARY_DIR}/dist/bpf-${REVISION}.tar.gz")
set(PIP_INSTALLABLE "${CMAKE_CURRENT_BINARY_DIR}/dist/bcc-${REVISION}.tar.gz")
configure_file(setup.py.in ${CMAKE_CURRENT_BINARY_DIR}/setup.py @ONLY)
# build the pip installable
add_custom_command(OUTPUT ${PIP_INSTALLABLE}
COMMAND python setup.py sdist
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/bpf/__init__.py ${CMAKE_CURRENT_BINARY_DIR}/setup.py
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/bcc/__init__.py ${CMAKE_CURRENT_BINARY_DIR}/setup.py
)
add_custom_target(bpf_py ALL DEPENDS ${PIP_INSTALLABLE})
add_custom_target(bcc_py ALL DEPENDS ${PIP_INSTALLABLE})

if(EXISTS "/etc/debian_version")
set(PYTHON_FLAGS "${PYTHON_FLAGS} --install-layout deb")
Expand Down
3 changes: 1 addition & 2 deletions src/python/MANIFEST
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# file GENERATED by distutils, do NOT edit
setup.py
bpf/__init__.py
bpf-run
bcc/__init__.py
File renamed without changes.
96 changes: 0 additions & 96 deletions src/python/bpf-run

This file was deleted.

7 changes: 3 additions & 4 deletions src/python/setup.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,11 @@ import sys
if os.environ.get('DESTDIR'):
sys.argv += ['--root', os.environ['DESTDIR']]

setup(name='bpf',
setup(name='bcc',
version='@REVISION@',
description='BPF Loader Library',
author='Brenden Blanco',
author_email='[email protected]',
url='http:https://plumgrid.com',
packages=['bpf'],
scripts=['bpf-run'],
url='https://github.com/iovisor/bcc',
packages=['bcc'],
platforms=['Linux'])
2 changes: 1 addition & 1 deletion tests/cc/test_brb.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@

from ctypes import c_uint
from netaddr import IPAddress, EUI
from bpf import BPF
from bcc import BPF
from pyroute2 import IPRoute, NetNS, IPDB, NSPopen
import sys
from time import sleep
Expand Down
2 changes: 1 addition & 1 deletion tests/cc/test_brb2.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
# 9: OK

from ctypes import c_uint
from bpf import BPF
from bcc import BPF
from pyroute2 import IPRoute, NetNS, IPDB, NSPopen
import sys
from time import sleep
Expand Down
2 changes: 1 addition & 1 deletion tests/cc/test_call1.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from ctypes import c_ushort, c_int, c_ulonglong
from netaddr import IPAddress
from bpf import BPF
from bcc import BPF
from pyroute2 import IPRoute
from socket import socket, AF_INET, SOCK_DGRAM
import sys
Expand Down
2 changes: 1 addition & 1 deletion tests/cc/test_clang.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Copyright (c) PLUMgrid, Inc.
# Licensed under the Apache License, Version 2.0 (the "License")

from bpf import BPF
from bcc import BPF
from unittest import main, TestCase

class TestClang(TestCase):
Expand Down
2 changes: 1 addition & 1 deletion tests/cc/test_stat1.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

from ctypes import c_uint, c_ulong, Structure
from netaddr import IPAddress
from bpf import BPF
from bcc import BPF
from subprocess import check_call
import sys
from unittest import main, TestCase
Expand Down
2 changes: 1 addition & 1 deletion tests/cc/test_trace1.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Licensed under the Apache License, Version 2.0 (the "License")

from ctypes import c_uint, c_ulong, Structure
from bpf import BPF
from bcc import BPF
import os
from time import sleep
import sys
Expand Down
2 changes: 1 addition & 1 deletion tests/cc/test_trace2.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Licensed under the Apache License, Version 2.0 (the "License")

from ctypes import c_uint, c_ulong, Structure
from bpf import BPF
from bcc import BPF
from time import sleep
import sys
from unittest import main, TestCase
Expand Down
2 changes: 1 addition & 1 deletion tests/cc/test_trace3.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Licensed under the Apache License, Version 2.0 (the "License")

from ctypes import c_uint, c_ulong, Structure
from bpf import BPF
from bcc import BPF
from time import sleep
import sys
from unittest import main, TestCase
Expand Down
Loading

0 comments on commit c35989d

Please sign in to comment.