All Projects → udzura → rbbcc

udzura / rbbcc

Licence: Apache-2.0 license
BCC port for MRI - this is unofficial bonsai project.

Programming Languages

ruby
36898 projects - #4 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to rbbcc

Bpftrace
High-level tracing language for Linux eBPF
Stars: ✭ 4,526 (+9957.78%)
Mutual labels:  tracing, ebpf, bcc
uprobe-http-tracer
uprobe-based HTTP tracer for Go binaries
Stars: ✭ 45 (+0%)
Mutual labels:  tracing, ebpf, bcc
bpfbox
🐝 BPFBox 📦 Exploring process confinement in eBPF
Stars: ✭ 93 (+106.67%)
Mutual labels:  ebpf, bcc
ebpfpub
ebpfpub is a generic function tracing library for Linux that supports tracepoints, kprobes and uprobes.
Stars: ✭ 86 (+91.11%)
Mutual labels:  tracing, ebpf
pwru
Packet, where are you? -- Linux kernel networking debugger
Stars: ✭ 694 (+1442.22%)
Mutual labels:  tracing, ebpf
sockdump
Dump unix domain socket traffic with bpf
Stars: ✭ 160 (+255.56%)
Mutual labels:  ebpf, bcc
ipftrace
[Deplicated] Now we have more sophisticated (and compact) implementation in ipftrace2 repository. Please check it as well.
Stars: ✭ 60 (+33.33%)
Mutual labels:  tracing, ebpf
el7-bpf-specs
RPM specs for building bpf related tools on CentOS 7
Stars: ✭ 38 (-15.56%)
Mutual labels:  ebpf, bcc
Ebpf exporter
Prometheus exporter for custom eBPF metrics
Stars: ✭ 829 (+1742.22%)
Mutual labels:  tracing, ebpf
Hubble
Hubble - Network, Service & Security Observability for Kubernetes using eBPF
Stars: ✭ 1,245 (+2666.67%)
Mutual labels:  tracing, ebpf
Ebpf
eBPF Utilities, Maps, and more
Stars: ✭ 238 (+428.89%)
Mutual labels:  tracing, ebpf
lmp
LMP is a supermarket
Stars: ✭ 228 (+406.67%)
Mutual labels:  ebpf, bcc
Tracepkt
Trace a ping packet journey across network interfaces and namespace on recent Linux. Supports IPv4 and IPv6.
Stars: ✭ 176 (+291.11%)
Mutual labels:  tracing, ebpf
Bpfd
Framework for running BPF programs with rules on Linux as a daemon. Container aware.
Stars: ✭ 396 (+780%)
Mutual labels:  tracing, ebpf
Weaver
Trace Go program execution with uprobes and eBPF
Stars: ✭ 174 (+286.67%)
Mutual labels:  tracing, ebpf
Ipftrace2
A packet oriented Linux kernel function call tracer
Stars: ✭ 193 (+328.89%)
Mutual labels:  tracing, ebpf
Zipkin
Zipkin is a distributed tracing system
Stars: ✭ 14,969 (+33164.44%)
Mutual labels:  tracing
Opencensus Node
A stats collection and distributed tracing framework
Stars: ✭ 249 (+453.33%)
Mutual labels:  tracing
Csharp Netcore
OpenTracing instrumentation for .NET Core & .NET 5 apps
Stars: ✭ 225 (+400%)
Mutual labels:  tracing
Mulog
μ/log is a micro-logging library that logs events and data, not words!
Stars: ✭ 222 (+393.33%)
Mutual labels:  tracing

RbBCC

Gem Version CI Status

RbBCC is a port of BCC in MRI. See iovisor project page.

Movie

This gem requires libbcc.so. Please install it following BCC's instruction.

Installation

Add this line to your application's Gemfile:

gem 'rbbcc'

And then execute:

$ bundle

Or install it yourself as:

$ gem install rbbcc

Usage

require 'rbbcc' 

code = <<CLANG
int kprobe__sys_clone(void *ctx)
{
  bpf_trace_printk("Hello, World!\\n");
  return 0;
}
CLANG
RbBCC::BCC.new(text: code).trace_print

See examples (both in rbbcc and BCC)

Trying with docker

udzura/rbbcc:${version} is available.

  • On generic linux:
$ docker run --privileged \
    -v/lib/modules:/lib/modules \
    -v/sys:/sys \
    -v/usr/src:/usr/src \
    -v`pwd`:/opt \
    -ti \
    udzura/rbbcc:0.0.2 /opt/hello_world.rb
Found fnc: kprobe__sys_clone
Attach: p_sys_clone

            bash-20113 [000] ....   377.602655: 0x00000001: Hello, World!
            bash-20113 [000] ....   385.367309: 0x00000001: Hello, World!
            bash-20113 [000] ....   391.203779: 0x00000001: Hello, World!
            curl-20316 [001] ....   391.218226: 0x00000001: Hello, World!
            bash-20113 [000] ....   402.528271: 0x00000001: Hello, World!
 docker-containe-20236 [000] ....   403.090058: 0x00000001: Hello, World!
...
  • On Docker for Mac:
    • Docker for Mac host does not have heders file in /usr/src, so you should extract headers in each container inside.
### I have prepared an example Dockerfile
$ docker build -t udzura/rbbcc:0.0.2-dfm -f Dockerfile.dfm-example .
$ docker run --privileged \
    -v/lib/modules:/lib/modules \
    -v`pwd`/examples:/opt \
    -ti \
    udzura/rbbcc:0.0.2-dfm /opt/hello_world.rb
...
 containerd-shim-4932  [002] d...  1237.795421: : Hello, World!
           httpd-4958  [000] d...  1237.795666: : Hello, World!
           httpd-4958  [000] d...  1237.795794: : Hello, World!
           httpd-4967  [000] d...  1237.795988: : Hello, World!
           httpd-4967  [000] d...  1237.796211: : Hello, World!
           httpd-4967  [000] d...  1237.796289: : Hello, World!
           httpd-4967  [000] d...  1237.796325: : Hello, World!
           <...>-5025  [003] d...  1237.796956: : Hello, World!
            runc-5025  [003] d...  1237.797133: : Hello, World!
           httpd-4967  [000] d...  1237.797156: : Hello, World!
           httpd-4967  [000] d...  1237.797198: : Hello, World!
           httpd-4967  [000] d...  1237.797340: : Hello, World!
            runc-5025  [003] d...  1237.797464: : Hello, World!

Documents

See docs/ for getting started and tutorial.

Development

After checking out the repo, run bin/setup to install dependencies. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/udzura/rbbcc.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].