Skip to content

Instantly share code, notes, and snippets.

@RichardBarrell
RichardBarrell / perf_annotate_output.txt
Created April 4, 2013 22:07
Interesting output from "perf annotate" - it seems that whenever I use a synchronising instruction, "perf record" accidentally attributes the sync instruction's ticks to the instruction immediately *after* the lock or mfence.
Percent | Source code & Disassembly of rev26_2
------------------------------------------------
:
:
:
: Disassembly of section .text:
:
: 0000000000400760 <paws>:
: void paws() {
: #ifdef USE_A_POSIX_BARRIER
@RichardBarrell
RichardBarrell / client-connect.c
Created December 18, 2011 05:05
My (mildly-embarrassing) openvpn config
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/wait.h>
int run(char **argv, char **envp) {
pid_t chipr = fork();
if (chipr == 0) {