Skip to content

Instantly share code, notes, and snippets.

@awreece
awreece / make_trace.sh
Created May 14, 2012 05:01
Go memory allocation tracing
#!/bin/dash
ltrace -x runtime.mallocgc -f -ttt -o malloc.trace $@
python parse.py malloc.trace
@awreece
awreece / gist:2691893
Created May 14, 2012 05:15
uiktest crash
x protocol write error: write unix /tmp/.X11-unix/X0: broken pipe
panic: runtime error: send on closed channel
goroutine 12 [running]:
code.google.com/p/jamslam-x-go-binding/xgb.(*Conn).request(0x1885e000, 0x18a5a2a0, 0x10, 0x10, 0x0, ...)
/tmp/src/code.google.com/p/jamslam-x-go-binding/xgb/xgb.go:200 +0x5d
code.google.com/p/jamslam-x-go-binding/xgb.(*Conn).sendRequest(0x1885e000, 0x0, 0xb59dad64, 0x1, 0x1, ...)
/tmp/src/code.google.com/p/jamslam-x-go-binding/xgb/xgb.go:212 +0x54
code.google.com/p/jamslam-x-go-binding/xgb.(*Conn).CreatePixmap(0x1885e000, 0x3800018, 0x380000a, 0xb1, 0x14001e0, ...)
/tmp/src/code.google.com/p/jamslam-x-go-binding/xgb/xproto.go:2685 +0x3bf
@awreece
awreece / command
Created May 14, 2012 05:55
Thats interesting
$ GOMAXPROCS=8 ltrace -ttt -f -x runtime.mallocgc -o malloc.trace go get -v github.com/petar/GoLLRB/llrb
void sub_2648(void) {
rax = *(rsi + 0x8);
rbx = rdi;
if (*(rsi + 0x8) != 0x0) {
r14 = rsi;
rdi = rax;
do {
putenv(rdi);
rdi = *(r14 + 0x10);
r14 = r14 + 0x8;
Delivered-To: [email protected]
Received: by 10.68.32.231 with SMTP id m7csp157647pbi;
Wed, 30 May 2012 01:51:25 -0700 (PDT)
Received: by 10.50.34.200 with SMTP id b8mr332113igj.50.1338367885297;
Wed, 30 May 2012 01:51:25 -0700 (PDT)
Return-Path: <[email protected]>
Received: from mx2.andrew.cmu.edu (MX2.ANDREW.CMU.EDU. [128.2.11.36])
by mx.google.com with ESMTPS id bd9si18883889icb.2.2012.05.30.01.51.24
(version=TLSv1/SSLv3 cipher=OTHER);
areece@indium:~$ klist
Credentials cache: FILE:/tmp/krb5cc_1680_g18655
Principal: [email protected]
Issued Expires Principal
Jun 4 22:37:29 Jun 5 08:37:29 krbtgt/[email protected]
Jun 4 22:37:29 Jun 5 08:37:29 afs/[email protected]
void ar_free(void* ptr) {
assertf(malloc_initialized, "Free called before initialization");
assert_notnull(ptr);
slab_t* slab = ptr_to_slab(ptr);
assert_notnull(slab);
tcache_t* cache = get_tcache();
// Avoid false sharing by only caching blocks from our arena.
$ sudo ls /var/lib/quassel/
quasselCert.pem quasselcore.conf
$ sudo cat /var/lib/quassel/quasselcore.conf
[Config]
Version=1
$ sudo view /var/lib/quassel/quasselCert.pem
$ sudo quasselcore --add-user --configdir=/var/lib/quassel
#ifdef FOO
if (x) {
#else
if (x_config) {
#endif
}
FLAG_INT(nthreads, 1, "Number of threads to use");
FLAG_INT(nops, 10000000, "Number of operations to run");
FLAG_BOOL(baseline, false, "Run baseline with dummy malloc");
FLAG_BOOL(libc, false, "Run with libc malloc");
FLAG_BOOL(locked, false, "Run with locked malloc");
FLAG_BOOL(simple_out, false, "Print simple (machine parseable) output");