Skip to content

Instantly share code, notes, and snippets.

Avatar

Dale Hamel dalehamel

View GitHub Profile
View mcsnoop.bt
BEGIN
{
printf("%-20s %10s %10s %10s\n", "MEMCACHED KEY", "CALLS", "OBJSIZE", "REQ/s");
@start = nsecs;
}
// NOTE - this presently omits incr, decr, and delete because they have a
// different signature
View gist:4cff58ba68ed4cc3904635fc54bfe629
#
# Automatically generated file; DO NOT EDIT.
# Linux/x86 5.0.0 Kernel Configuration
#
#
# Compiler: gcc (Gentoo 8.2.0-r6 p1.7) 8.2.0
#
CONFIG_CC_IS_GCC=y
CONFIG_GCC_VERSION=80200
View 000001 ruby-install command
# First install https://github.com/postmodern/ruby-install
# Patches are below just download them
# After you have installed with ruby-install, you can chruby to use it
ruby-install ruby 2.6.3 -p 0001-RubyVM-InstructionSequence-eval_with.patch -p 0002-Update-iseq.eval-to-accept-optional-binding-Feature-.patch
View gist:e46f1b8a380231722e9c1bf68236a5a5
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
test_libbcc is a Catch v1.4.0 host application.
Run with -? for options
-------------------------------------------------------------------------------
test bpf stack_id table
-------------------------------------------------------------------------------
/home/dale.hamel/workspace/bcc/tests/cc/test_bpf_table.cc:226
...............................................................................
View gist:fc72583d7aaf29c8cb2e3e6d6a9a17eb
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
test_libbcc is a Catch v1.4.0 host application.
Run with -? for options
-------------------------------------------------------------------------------
test bpf stack_id table
-------------------------------------------------------------------------------
/home/dale.hamel/workspace/bcc/tests/cc/test_bpf_table.cc:226
...............................................................................
View gist:74dac2ec39a97e71ffde3f229000179a
#!/usr/bin/env ruby
require 'ruby-static-tracing'
DEBUG = ENV['DEBUG']
t = StaticTracing::Tracepoint.new('global', 'hello_nsec', Integer, String)
p = StaticTracing::Provider.fetch(t.provider)
p.enable
l = StaticTracing.nsec
View readelf --notes on ruby
Displaying notes found in: .note.ABI-tag
Owner Data size Description
GNU 0x00000010 NT_GNU_ABI_TAG (ABI version tag)
OS: Linux, ABI: 2.6.24
Displaying notes found in: .note.gnu.build-id
Owner Data size Description
GNU 0x00000014 NT_GNU_BUILD_ID (unique build ID bitstring)
Build ID: 2fda2cc264d59b38763507fa44cf79f94636aed2
@dalehamel
dalehamel / fetch-linux-headers.sh
Last active Jan 27, 2019
Fetch containeros linux headers
View fetch-linux-headers.sh
#!/bin/bash
LSB_FILE="/mnt/root/etc/lsb-release"
OS_RELEASE_FILE="/mnt/root/etc/os-release"
generate_headers()
{
echo "Generating kernel headers"
cd ${SOURCES_DIR}
zcat /proc/config.gz > .config
@dalehamel
dalehamel / tcpacceptqsnoop.bt
Created Nov 24, 2018
Re-implement several tcp.* utils from iovisor/bcc in bpftrace (with some limitations)
View tcpacceptqsnoop.bt
#!/usr/bin/env bpftrace
/*
Watches for all ipv4 tcp accepts, displays:
- remote and local addresses of the accepted connection
- accept queue size and maximum
*/
#include <linux/tcp.h>
View gist:2cbe83e142cf45cfc4cb5511264ba309
---
src/clang_parser.cpp | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/src/clang_parser.cpp b/src/clang_parser.cpp
index 6adb5f0..5b47555 100644
--- a/src/clang_parser.cpp
+++ b/src/clang_parser.cpp
@@ -221,10 +221,23 @@ void ClangParser::parse(ast::Program *program, StructMap &structs)