接前一篇文章:BCC介绍
上一篇文章中已提到,BCC的github地址是:https://github.com/iovisor/bcc。
页面如下所示:

打开终端,创建好要存放BCC源码的目录,进入此目录。
然后,在终端下输入以下命令进行BCC源码下载:
git clone https://github.com/iovisor/bcc.git
实际命令及过程如下所示:
- ~/eBPF/BCC$ git clone https://github.com/iovisor/bcc.git
- 正克隆到 'bcc'...
- remote: Enumerating objects: 28172, done.
- remote: Counting objects: 100% (4480/4480), done.
- remote: Compressing objects: 100% (565/565), done.
- remote: Total 28172 (delta 4035), reused 3938 (delta 3914), pack-reused 23692
- 接收对象中: 100% (28172/28172), 19.11 MiB | 137.00 KiB/s, 完成.
- 处理 delta 中: 100% (18732/18732), 完成.

- ~/eBPF/BCC/bcc$ tree
- .
- ├── cmake
- │ ├── bump_version.cmake
- │ ├── clang_libs.cmake
- │ ├── CmakeUninstall.cmake.in
- │ ├── FindCompilerFlag.cmake
- │ ├── FindKernelHeaders.cmake
- │ ├── FindLibBpf.cmake
- │ ├── FindLibDebuginfod.cmake
- │ ├── FindLibElf.cmake
- │ ├── FindLibLzma.cmake
- │ ├── FindLuaJIT.cmake
- │ ├── GetGitRevisionDescription.cmake
- │ ├── GetGitRevisionDescription.cmake.in
- │ ├── static_libstdc++.cmake
- │ └── version.cmake
- ├── CMakeLists.txt
- ├── CODEOWNERS
- ├── CONTRIBUTING-SCRIPTS.md
- ├── debian
- │ ├── bcc-lua.install
- │ ├── bcc-tools.install
- │ ├── changelog
- │ ├── compat
- │ ├── control
- │ ├── copyright
- │ ├── docs
- │ ├── libbcc-examples.install
- │ ├── libbcc.install
- │ ├── python3-bcc.install
- │ ├── python-bcc.install
- │ ├── rules
- │ └── source
- │ └── format
- ├── docker
- │ ├── build
- │ │ ├── Dockerfile.fedora
- │ │ └── Dockerfile.ubuntu
- │ ├── Dockerfile.debian
- │ └── Dockerfile.ubuntu
- ├── docs
- │ ├── kernel_config.md
- │ ├── kernel-versions.md
- │ ├── reference_guide.md
- │ ├── special_filtering.md
- │ ├── tutorial_bcc_python_developer.md
- │ └── tutorial.md
- ├── examples
- │ ├── cgroupid
- │ │ ├── cgroupid.c
- │ │ ├── Dockerfile
- │ │ └── Makefile
- │ ├── CMakeLists.txt
- │ ├── cpp
- │ │ ├── CGroupTest.cc
- │ │ ├── CMakeLists.txt
- │ │ ├── CPUDistribution.cc
- │ │ ├── FollyRequestContextSwitch.cc
- │ │ ├── HelloWorld.cc
- │ │ ├── KFuncExample.cc
- │ │ ├── KModRetExample.cc
- │ │ ├── LLCStat.cc
- │ │ ├── pyperf
- │ │ │ ├── CMakeLists.txt
- │ │ │ ├── Py36Offsets.cc
- │ │ │ ├── PyPerfBPFProgram.cc
- │ │ │ ├── PyPerf.cc
- │ │ │ ├── PyPerfDefaultPrinter.cc
- │ │ │ ├── PyPerfDefaultPrinter.h
- │ │ │ ├── PyPerfLoggingHelper.cc
- │ │ │ ├── PyPerfLoggingHelper.h
- │ │ │ ├── PyPerfSampleProcessor.h
- │ │ │ ├── PyPerfType.h
- │ │ │ ├── PyPerfUtil.cc
- │ │ │ └── PyPerfUtil.h
- │ │ ├── RandomRead.cc
- │ │ ├── RecordMySQLQuery.cc
- │ │ ├── SkLocalStorageIterator.cc
- │ │ ├── TaskIterator.cc
- │ │ ├── TCPSendStack.cc
- │ │ └── UseExternalMap.cc
- │ ├── hello_world.py
- │ ├── local_storage
- │ │ ├── inode_storage.py
- │ │ └── task_storage.py
- │ ├── lua
- │ │ ├── bashreadline.c
- │ │ ├── bashreadline.lua
- │ │ ├── CMakeLists.txt
- │ │ ├── kprobe-latency.lua
- │ │ ├── kprobe-write.lua
- │ │ ├── memleak.lua
- │ │ ├── offcputime.lua
- │ │ ├── sock-parse-dns.lua
- │ │ ├── sock-parse-http.lua
- │ │ ├── sock-protolen.lua
- │ │ ├── sock-proto.lua
- │ │ ├── strlen_count.lua
- │ │ ├── task_switch.lua
- │ │ ├── tracepoint-offcputime.lua
- │ │ ├── uprobe-readline.lua
- │ │ ├── uprobe-readline-perf.lua
- │ │ ├── uprobe-tailkt.lua
- │ │ └── usdt_ruby.lua
- │ ├── networking
- │ │ ├── CMakeLists.txt
- │ │ ├── distributed_bridge
- │ │ │ ├── CMakeLists.txt
- │ │ │ ├── main.py
- │ │ │ ├── simulation.py -> ../simulation.py
- │ │ │ ├── tunnel.c
- │ │ │ ├── tunnel_mesh.c
- │ │ │ ├── tunnel_mesh.py
- │ │ │ └── tunnel.py
- │ │ ├── dns_matching
- │ │ │ ├── dns_matching.c
- │ │ │ └── dns_matching.py
- │ │ ├── http_filter
- │ │ │ ├── CMakeLists.txt
- │ │ │ ├── http-parse-complete.c
- │ │ │ ├── http-parse-complete.py
- │ │ │ ├── http-parse-simple.c
- │ │ │ ├── http-parse-simple.py
- │ │ │ └── README.md
- │ │ ├── neighbor_sharing
- │ │ │ ├── CMakeLists.txt
- │ │ │ ├── README.txt
- │ │ │ ├── simulation.py -> ../simulation.py
- │ │ │ ├── tc_neighbor_sharing.c
- │ │ │ └── tc_neighbor_sharing.py
- │ │ ├── net_monitor.py
- │ │ ├── simple_tc.py
- │ │ ├── simulation.py
- │ │ ├── sockmap.py
- │ │ ├── tc_perf_event.py
- │ │ ├── tcp_mon_block
- │ │ │ ├── README.md
- │ │ │ ├── screenshots
- │ │ │ │ ├── 1.JPG
- │ │ │ │ └── 2.JPG
- │ │ │ └── src
- │ │ │ ├── allow_list.json
- │ │ │ ├── http_client.py
- │ │ │ ├── tcp_mon_block.c
- │ │ │ ├── tcp_mon_block.py
- │ │ │ └── web_server.py
- │ │ ├── tunnel_monitor
- │ │ │ ├── chord.png
- │ │ │ ├── CMakeLists.txt
- │ │ │ ├── main.py
- │ │ │ ├── monitor.c
- │ │ │ ├── monitor.py
- │ │ │ ├── README.md
- │ │ │ ├── setup.sh
- │ │ │ ├── simulation.py -> ../simulation.py
- │ │ │ ├── traffic.sh
- │ │ │ └── vxlan.jpg
- │ │ ├── vlan_filter
- │ │ │ ├── data-plane-tracing.c
- │ │ │ ├── data-plane-tracing.py
- │ │ │ ├── README.md
- │ │ │ ├── scenario.jpg
- │ │ │ ├── test_setup.sh
- │ │ │ └── test_traffic.sh
- │ │ ├── vlan_learning
- │ │ │ ├── CMakeLists.txt
- │ │ │ ├── README.txt
- │ │ │ ├── simulation.py -> ../simulation.py
- │ │ │ ├── vlan_learning.c
- │ │ │ └── vlan_learning.py
- │ │ └── xdp
- │ │ ├── CMakeLists.txt
- │ │ ├── xdp_drop_count.py
- │ │ ├── xdp_macswap_count.py
- │ │ ├── xdp_redirect_cpu.py
- │ │ └── xdp_redirect_map.py
- │ ├── perf
- │ │ └── ipc.py
- │ ├── ringbuf
- │ │ ├── ringbuf_output.py
- │ │ └── ringbuf_submit.py
- │ ├── tracing
- │ │ ├── biolatpcts_example.txt
- │ │ ├── biolatpcts.py
- │ │ ├── bitehist_example.txt
- │ │ ├── bitehist.py
- │ │ ├── CMakeLists.txt
- │ │ ├── dddos_example.txt
- │ │ ├── dddos.py
- │ │ ├── disksnoop_example.txt
- │ │ ├── disksnoop.py
- │ │ ├── hello_fields.py
- │ │ ├── hello_perf_output.py
- │ │ ├── hello_perf_output_using_ns.py
- │ │ ├── kvm_hypercall.py
- │ │ ├── kvm_hypercall.txt
- │ │ ├── mallocstacks.py
- │ │ ├── mysqld_query_example.txt
- │ │ ├── mysqld_query.py
- │ │ ├── nflatency.py
- │ │ ├── nodejs_http_server_example.txt
- │ │ ├── nodejs_http_server.py
- │ │ ├── stack_buildid_example.py
- │ │ ├── stacksnoop_example.txt
- │ │ ├── stacksnoop.py
- │ │ ├── strlen_count.py
- │ │ ├── strlen_hist_ifunc.py
- │ │ ├── strlen_hist.py
- │ │ ├── strlen_snoop.py
- │ │ ├── sync_timing.py
- │ │ ├── task_switch.c
- │ │ ├── task_switch.py
- │ │ ├── tcpv4connect_example.txt
- │ │ ├── tcpv4connect.py
- │ │ ├── trace_fields.py
- │ │ ├── trace_perf_output.py
- │ │ ├── undump_example.txt
- │ │ ├── undump.py
- │ │ ├── urandomread_example.txt
- │ │ ├── urandomread-explicit.py
- │ │ ├── urandomread.py
- │ │ ├── vfsreadlat.c
- │ │ ├── vfsreadlat_example.txt
- │ │ └── vfsreadlat.py
- │ └── usdt_sample
- │ ├── CMakeLists.txt
- │ ├── scripts
- │ │ ├── bpf_text_shared.c
- │ │ ├── lat_avg.py
- │ │ ├── lat_dist.py
- │ │ └── latency.py
- │ ├── usdt_sample_app1
- │ │ ├── CMakeLists.txt
- │ │ └── main.cpp
- │ ├── usdt_sample_lib1
- │ │ ├── CMakeLists.txt
- │ │ ├── include
- │ │ │ └── usdt_sample_lib1
- │ │ │ └── lib1.h
- │ │ └── src
- │ │ ├── lib1.cpp
- │ │ ├── lib1_sdt.d
- │ │ └── lib1_sdt.h
- │ ├── usdt_sample.md
- │ └── usdt_sample.sh
- ├── FAQ.txt
- ├── images
- │ ├── bcc_tracing_tools_2016.png
- │ ├── bcc_tracing_tools_2017.png
- │ ├── bcc_tracing_tools_2019.png
- │ ├── logo1.png
- │ ├── logo1.svg
- │ ├── logo2.png
- │ └── logo2.svg
- ├── INSTALL.md
- ├── introspection
- │ ├── bps.c
- │ ├── bps_example.txt
- │ └── CMakeLists.txt
- ├── libbpf-tools
- │ ├── arm64
- │ │ ├── vmlinux_608.h
- │ │ └── vmlinux.h -> vmlinux_608.h
- │ ├── bashreadline.bpf.c
- │ ├── bashreadline.c
- │ ├── bashreadline.h
- │ ├── bindsnoop.bpf.c
- │ ├── bindsnoop.c
- │ ├── bindsnoop.h
- │ ├── biolatency.bpf.c
- │ ├── biolatency.c
- │ ├── biolatency.h
- │ ├── biopattern.bpf.c
- │ ├── biopattern.c
- │ ├── biopattern.h
- │ ├── biosnoop.bpf.c
- │ ├── biosnoop.c
- │ ├── biosnoop.h
- │ ├── biostacks.bpf.c
- │ ├── biostacks.c
- │ ├── biostacks.h
- │ ├── biotop.bpf.c
- │ ├── biotop.c
- │ ├── biotop.h
- │ ├── bitesize.bpf.c
- │ ├── bitesize.c
- │ ├── bitesize.h
- │ ├── bits.bpf.h
- │ ├── blazesym
- │ ├── blk_types.h
- │ ├── bpftool
- │ ├── btf_helpers.c
- │ ├── btf_helpers.h
- │ ├── cachestat.bpf.c
- │ ├── cachestat.c
- │ ├── capable.bpf.c
- │ ├── capable.c
- │ ├── capable.h
- │ ├── compat.bpf.h
- │ ├── compat.c
- │ ├── compat.h
- │ ├── core_fixes.bpf.h
- │ ├── cpudist.bpf.c
- │ ├── cpudist.c
- │ ├── cpudist.h
- │ ├── cpufreq.bpf.c
- │ ├── cpufreq.c
- │ ├── cpufreq.h
- │ ├── drsnoop.bpf.c
- │ ├── drsnoop.c
- │ ├── drsnoop_example.txt
- │ ├── drsnoop.h
- │ ├── errno_helpers.c
- │ ├── errno_helpers.h
- │ ├── execsnoop.bpf.c
- │ ├── execsnoop.c
- │ ├── execsnoop.h
- │ ├── exitsnoop.bpf.c
- │ ├── exitsnoop.c
- │ ├── exitsnoop.h
- │ ├── filelife.bpf.c
- │ ├── filelife.c
- │ ├── filelife.h
- │ ├── filetop.bpf.c
- │ ├── filetop.c
- │ ├── filetop.h
- │ ├── fsdist.bpf.c
- │ ├── fsdist.c
- │ ├── fsdist.h
- │ ├── fsslower.bpf.c
- │ ├── fsslower.c
- │ ├── fsslower.h
- │ ├── funclatency.bpf.c
- │ ├── funclatency.c
- │ ├── funclatency.h
- │ ├── gethostlatency.bpf.c
- │ ├── gethostlatency.c
- │ ├── gethostlatency.h
- │ ├── hardirqs.bpf.c
- │ ├── hardirqs.c
- │ ├── hardirqs.h
- │ ├── javagc.bpf.c
- │ ├── javagc.c
- │ ├── javagc.h
- │ ├── kernel.config
- │ ├── klockstat.bpf.c
- │ ├── klockstat.c
- │ ├── klockstat.h
- │ ├── ksnoop.bpf.c
- │ ├── ksnoop.c
- │ ├── ksnoop.h
- │ ├── llcstat.bpf.c
- │ ├── llcstat.c
- │ ├── llcstat.h
- │ ├── loongarch
- │ │ ├── vmlinux_602.h
- │ │ └── vmlinux.h -> vmlinux_602.h
- │ ├── Makefile
- │ ├── Makefile.btfgen
- │ ├── map_helpers.c
- │ ├── map_helpers.h
- │ ├── maps.bpf.h
- │ ├── mdflush.bpf.c
- │ ├── mdflush.c
- │ ├── mdflush.h
- │ ├── memleak.bpf.c
- │ ├── memleak.c
- │ ├── memleak.h
- │ ├── mountsnoop.bpf.c
- │ ├── mountsnoop.c
- │ ├── mountsnoop.h
- │ ├── numamove.bpf.c
- │ ├── numamove.c
- │ ├── offcputime.bpf.c
- │ ├── offcputime.c
- │ ├── offcputime.h
- │ ├── oomkill.bpf.c
- │ ├── oomkill.c
- │ ├── oomkill.h
- │ ├── opensnoop.bpf.c
- │ ├── opensnoop.c
- │ ├── opensnoop.h
- │ ├── powerpc
- │ │ ├── vmlinux_600.h
- │ │ └── vmlinux.h -> vmlinux_600.h
- │ ├── readahead.bpf.c
- │ ├── readahead.c
- │ ├── readahead.h
- │ ├── README.md
- │ ├── riscv
- │ │ ├── vmlinux_602.h
- │ │ └── vmlinux.h -> vmlinux_602.h
- │ ├── runqlat.bpf.c
- │ ├── runqlat.c
- │ ├── runqlat.h
- │ ├── runqlen.bpf.c
- │ ├── runqlen.c
- │ ├── runqlen.h
- │ ├── runqslower.bpf.c
- │ ├── runqslower.c
- │ ├── runqslower_example.txt
- │ ├── runqslower.h
- │ ├── sigsnoop.bpf.c
- │ ├── sigsnoop.c
- │ ├── sigsnoop_example.txt
- │ ├── sigsnoop.h
- │ ├── slabratetop.bpf.c
- │ ├── slabratetop.c
- │ ├── slabratetop.h
- │ ├── softirqs.bpf.c
- │ ├── softirqs.c
- │ ├── softirqs.h
- │ ├── solisten.bpf.c
- │ ├── solisten.c
- │ ├── solisten.h
- │ ├── stat.h
- │ ├── statsnoop.bpf.c
- │ ├── statsnoop.c
- │ ├── statsnoop.h
- │ ├── syscall_helpers.c
- │ ├── syscall_helpers.h
- │ ├── syscount.bpf.c
- │ ├── syscount.c
- │ ├── syscount.h
- │ ├── tcpconnect.bpf.c
- │ ├── tcpconnect.c
- │ ├── tcpconnect.h
- │ ├── tcpconnlat.bpf.c
- │ ├── tcpconnlat.c
- │ ├── tcpconnlat.h
- │ ├── tcplife.bpf.c
- │ ├── tcplife.c
- │ ├── tcplife.h
- │ ├── tcppktlat.bpf.c
- │ ├── tcppktlat.c
- │ ├── tcppktlat_example.txt
- │ ├── tcppktlat.h
- │ ├── tcprtt.bpf.c
- │ ├── tcprtt.c
- │ ├── tcprtt.h
- │ ├── tcpstates.bpf.c
- │ ├── tcpstates.c
- │ ├── tcpstates.h
- │ ├── tcpsynbl.bpf.c
- │ ├── tcpsynbl.c
- │ ├── tcpsynbl.h
- │ ├── tcptop.bpf.c
- │ ├── tcptop.c
- │ ├── tcptop.h
- │ ├── tcptracer.bpf.c
- │ ├── tcptracer.c
- │ ├── tcptracer.h
- │ ├── trace_helpers.c
- │ ├── trace_helpers.h
- │ ├── uprobe_helpers.c
- │ ├── uprobe_helpers.h
- │ ├── vfsstat.bpf.c
- │ ├── vfsstat.c
- │ ├── vfsstat.h
- │ ├── wakeuptime.bpf.c
- │ ├── wakeuptime.c
- │ ├── wakeuptime.h
- │ └── x86
- │ ├── vmlinux_518.h
- │ └── vmlinux.h -> vmlinux_518.h
- ├── LICENSE.txt
- ├── LINKS.md
- ├── man
- │ ├── CMakeLists.txt
- │ └── man8
- │ ├── argdist.8
- │ ├── bashreadline.8
- │ ├── bindsnoop.8
- │ ├── biolatency.8
- │ ├── biolatpcts.8
- │ ├── biopattern.8
- │ ├── biosnoop.8
- │ ├── biotop.8
- │ ├── bitesize.8
- │ ├── bpflist.8
- │ ├── bps.8
- │ ├── btrfsdist.8
- │ ├── btrfsslower.8
- │ ├── cachestat.8
- │ ├── cachetop.8
- │ ├── capable.8
- │ ├── CMakeLists.txt
- │ ├── cobjnew.8 -> uobjnew.8
- │ ├── compactsnoop.8
- │ ├── cpudist.8
- │ ├── cpuunclaimed.8
-
- ……
-
- │ ├── tcpsynbl.bpf.c
- │ ├── tcpsynbl.c
- │ ├── tcpsynbl.h
- │ ├── tcptop.bpf.c
- │ ├── tcptop.c
- │ ├── tcptop.h
- │ ├── tcptracer.bpf.c
- │ ├── tcptracer.c
- │ ├── tcptracer.h
- │ ├── trace_helpers.c
- │ ├── trace_helpers.h
- │ ├── uprobe_helpers.c
- │ ├── uprobe_helpers.h
- │ ├── vfsstat.bpf.c
- │ ├── vfsstat.c
- │ ├── vfsstat.h
- │ ├── wakeuptime.bpf.c
- │ ├── wakeuptime.c
- │ ├── wakeuptime.h
- │ └── x86
- │ ├── vmlinux_518.h
- │ └── vmlinux.h -> vmlinux_518.h
- ├── LICENSE.txt
- ├── LINKS.md
- ├── man
- │ ├── CMakeLists.txt
- │ └── man8
- │ ├── argdist.8
- │ ├── bashreadline.8
- │ ├── bindsnoop.8
- │ ├── biolatency.8
- │ ├── biolatpcts.8
- │ ├── biopattern.8
- │ ├── biosnoop.8
- │ ├── biotop.8
- │ ├── bitesize.8
- │ ├── bpflist.8
- │ ├── bps.8
- │ ├── btrfsdist.8
- │ ├── btrfsslower.8
- │ ├── cachestat.8
- │ ├── cachetop.8
- │ ├── capable.8
- │ ├── CMakeLists.txt
- │ ├── cobjnew.8 -> uobjnew.8
- │ ├── compactsnoop.8
- │ ├── cpudist.8
- │ ├── cpuunclaimed.8
- 82 directories, 1102 files
至此,BCC源码下载完成。