Skip to content

Instantly share code, notes, and snippets.

Avatar

Dale Hamel dalehamel

View GitHub Profile
@dalehamel
dalehamel / argp-header.patch
Created Jan 8, 2020
Argp android build diff
View argp-header.patch
diff -Naur argp_sources/gllib/argp.h argp_sources/gllib/argp.h.new
--- argp_sources/gllib/argp.h 2019-02-19 20:38:53.000000000 +0000
+++ argp_sources/gllib/argp.h.new 2020-01-08 16:21:42.843277973 +0000
@@ -19,6 +19,17 @@
#ifndef _ARGP_H
#define _ARGP_H
+#ifndef ARGP_EI
+# define ARGP_EI inline
+#endif
@dalehamel
dalehamel / Dockerfile
Last active Nov 27, 2019
mctop bcc/bpftrace implementations
View Dockerfile
FROM alpine:3.10 as builder
# ensure SASL's "libplain.so" is installed as per https://github.com/memcached/memcached/wiki/SASLHowto
RUN apk add --no-cache cyrus-sasl-plain wget binutils
ENV MEMCACHED_VERSION 1.5.19
ENV MEMCACHED_SHA1 14e6a02e743838696fcb620edf6a2fd7e60cabec
# Get dtrace dependencies for alpine in a kinda hacky way
RUN mkdir /build && cd /build && wget http://launchpadlibrarian.net/251391227/systemtap-sdt-dev_2.9-2ubuntu2_amd64.deb && \
View ebpf error
bpf: Failed to load program: Permission denied
0: (b7) r3 = 0
1: (7b) *(u64 *)(r10 -8) = r3
last_idx 1 first_idx 0
regs=8 stack=0 before 0: (b7) r3 = 0
2: (7b) *(u64 *)(r10 -16) = r3
3: (7b) *(u64 *)(r10 -24) = r3
4: (7b) *(u64 *)(r10 -32) = r3
5: (7b) *(u64 *)(r10 -40) = r3
6: (7b) *(u64 *)(r10 -48) = r3
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: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: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: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