Skip to content

Instantly share code, notes, and snippets.

View KaiHa's full-sized avatar

Kai KaiHa

  • Lower Saxony, Germany
View GitHub Profile

Bpftrace, Sysdig & Systemtap

Bpftrace

Some experiments with the limited BPF stack size

The BPF stack used by bpftrace for storing the strings is only 512 bytes in size. Therefore it needs some consideration on which value to set BPFTRACE_STRLEN (max 200).

{ pkgs ? import /home/kai/sw/nixpkgs {} }:
let
jdk = pkgs.callPackage <nixpkgs/pkgs/development/compilers/openjdk/8.nix> {
bootjdk = pkgs.callPackage <nixpkgs/pkgs/development/compilers/openjdk/bootstrap.nix> { version = "8"; };
minimal = true;
inherit (pkgs.gnome2) GConf gnome_vfs;
};
fhs = pkgs.buildFHSUserEnv {
name = "android-env";
@KaiHa
KaiHa / ghc-aclocal.m4.patch
Created June 14, 2016 13:24
Changes to make aclocal.m4 aware of the hadrian '_build' directory
diff --git a/aclocal.m4 b/aclocal.m4
index dcc3448..05c4cc6 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -945,7 +945,8 @@ else
fi;
changequote([, ])dnl
])
-if test ! -f compiler/parser/Parser.hs || test ! -f compiler/cmm/CmmParse.hs
+if test ! \( -f compiler/parser/Parser.hs -o -f _build/stage1/compiler/Parser.hs \) \
@KaiHa
KaiHa / attachgdb.lua
Created July 1, 2015 09:01
A simple sysdig chisel to try to attach gdb to a short lived process
-- This is a sysdig chisel
description = "attach gdb to a spawned process"
short_description = "attach gdb to a spawned process"
category = "misc"
-- Chisel argument list
args = {}
@KaiHa
KaiHa / parseLaTeX.hs
Created February 27, 2015 18:47
A simple LaTeX parser.
{-# LANGUAGE OverloadedStrings #-}
import Text.LaTeX.Base.Parser
import qualified Data.Text.IO as T
import qualified Text.LaTeX.Base.Syntax as S
main :: IO ()
main = do
content <- T.readFile "test.tex"
case parseLaTeX content of