Skip to content

Instantly share code, notes, and snippets.

Avatar

Austin Clements aclements

  • Google
View GitHub Profile
@aclements
aclements / madv_free.go
Created Oct 29, 2018
Tool for experimenting with MADV_FREE
View madv_free.go
// You may want to first disable transparent huge pages:
//
// echo never | sudo tee /sys/kernel/mm/transparent_hugepage/enabled
package main
import (
"flag"
"fmt"
"io/ioutil"
@aclements
aclements / trigger-error.go
Created Jul 18, 2017
Plot GC pacer trigger error function
View trigger-error.go
// Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import (
"image/color"
"math"
"os"
@aclements
aclements / pacer.py
Last active Jul 21, 2017
Plot gcpacertrace log
View pacer.py
# Read gcpacertrace log from stdin and plot pacing.
import sys
import subprocess
gp = subprocess.Popen(["gnuplot", "-persist", "-e", """
set xrange [0:2];
set yrange [0:1];
set xlabel "Heap ratio (h)";
set ylabel "GC CPU (u_a)";
@aclements
aclements / btg.py
Created May 24, 2017
Failed attempt at using GDB unwinders for Go core files
View btg.py
try:
from gdb.unwinder import Unwinder, register_unwinder
except ImportError:
Unwinder = None
if Unwinder is not None:
class FrameID(object):
def __init__(self, sp, pc):
self.sp = sp
self.pc = pc
@aclements
aclements / popcnt_test.go
Created Mar 17, 2017
Benchmark of different ways to guard the POPCNT instruction
View popcnt_test.go
// Requires https://go-review.googlesource.com/c/38320
package popcnt
import (
"math/bits"
"testing"
)
var sink interface{}
@aclements
aclements / getg.py
Created Jan 9, 2017
$getg() function for gdb
View getg.py
import gdb
_Gdead = 6
class SliceValue:
"""Wrapper for slice values."""
def __init__(self, val):
self.val = val
@aclements
aclements / corewithpcsp.py
Last active Jan 17, 2017
Clone a core file with a new PC/SP for thread 1
View corewithpcsp.py
import gdb
import re
import tempfile
import os
import subprocess
import shutil
import struct
NOTE_HDR = struct.Struct("III")
USER_REGS = struct.Struct(27*"Q")
@aclements
aclements / findpath.py
Created Oct 23, 2016
GDB Python script for Go to find a path from a GC root to an object
View findpath.py
# Compute the object graph of a Go heap and find the path from a root
# to a target address.
import gdb
import collections
class SliceValue:
"""Wrapper for slice values."""
def __init__(self, val):
@aclements
aclements / 17503-eliminate-rescan.md
Created Oct 18, 2016
Preview of proposal go/golang#17503
View 17503-eliminate-rescan.md

Proposal: Eliminate STW stack re-scanning

Author(s): Austin Clements, Rick Hudson

Last updated: 2016-10-18

Discussion at https://golang.org/issue/17503.

Abstract

View go1-1.7-386.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
You can’t perform that action at this time.