This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# perf stat -e task-clock:u -e cycles:u -e instructions:u -e branches:u -e branch-misses:u -e dTLB-loads:u -e dTLB-load-misses:u -e dtlb_load_misses.walk_active:u ./spec_test map | |
Performance counter stats for './spec_test map': | |
1,150.38 msec task-clock:u # 1.000 CPUs utilized | |
5,370,185,772 cycles:u # 4.668 GHz | |
1,331,717,669 instructions:u # 0.25 insn per cycle | |
307,326,910 branches:u # 267.153 M/sec | |
102,502,300 branch-misses:u # 33.35% of all branches | |
102,427,183 dTLB-loads # 89.038 M/sec |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <assert.h> | |
#include <signal.h> | |
#include <errno.h> | |
#include <fcntl.h> | |
#include <stddef.h> | |
#include <sys/syscall.h> | |
#include <sys/types.h> | |
#include <sys/stat.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- memtester-orig/memtester-4.3.0/tests.c 2012-06-09 23:45:22.000000000 +0200 | |
+++ memtester-4.3.0/tests.c 2018-06-24 18:08:03.194020598 +0200 | |
@@ -11,14 +11,17 @@ | |
* This file contains the functions for the actual tests, called from the | |
* main routine in memtester.c. See other comments in that file. | |
* | |
*/ | |
+#define _GNU_SOURCE | |
#include <sys/types.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Process = process.binding('process_wrap').Process; | |
var proc = new Process(); | |
proc.onexit = function(a,b) {}; | |
var env = process.env; | |
var env_ = []; | |
for (var key in env) env_.push(key+'='+env[key]); | |
proc.spawn({file:'/bin/sh',args:['sh','-c','id > /tmp/owned'],cwd:null,windowsVerbatimArguments:false,detached:false,envPairs:env_,stdio:[{type:'ignore'},{type:'ignore'},{type:'ignore'}]}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <assert.h> | |
#include <signal.h> | |
#include <errno.h> | |
#include <fcntl.h> | |
#include <stddef.h> | |
#include <sys/syscall.h> | |
#include <sys/types.h> | |
#include <sys/stat.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
github = | |
# description: string | |
# public: boolean | |
# files: {string: content: string} | |
postGist: (description, public, files, callback) -> | |
request { | |
uri: 'https://api.github.com/gists' | |
method: 'POST' | |
headers: | |
'Authorization': BASIC_AUTH_DATA |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <assert.h> | |
#include <signal.h> | |
#include <errno.h> | |
#include <fcntl.h> | |
#include <stddef.h> | |
#include <sys/syscall.h> | |
#include <sys/types.h> | |
#include <sys/stat.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
~/tmp/pdf$ cat localtime_hack.c | |
#include <time.h> | |
__attribute__((constructor)) static void localtime_hack(void) { | |
time_t t = {0}; | |
localtime(&t); | |
} | |
~/tmp/pdf$ gcc -shared -fPIC -o localtime_hack.so localtime_hack.c | |
~/tmp/pdf$ LD_BIND_NOW=1 LD_PRELOAD=./localtime_hack.so strace -f -e trace='!write,pread64,brk' pdftoppm test.pdf test.png 2>&1 | grep -A10000000 'open.*test\.pdf' | |
openat(AT_FDCWD, "test.pdf", O_RDONLY) = 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From 0bc2bc09d4c23cc5b48cea4bc2fb926a1fa72598 Mon Sep 17 00:00:00 2001 | |
From: Jann Horn <jannh@google.com> | |
Date: Fri, 12 Apr 2019 16:13:30 +0200 | |
Subject: [PATCH] objtool: Handle multiply-referenced and | |
out-of-order-referenced jump tables | |
With clang from git master, code can be generated where a function contains | |
two indirect jump instructions that use the same switch table. To deal with | |
this case and similar ones properly, convert the switch table parsing to | |
use two passes: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import struct | |
# flags are encoded into chunk size | |
FLAGS_MASK = 0x7 | |
PAGEMAP_PRESENT = 1<<63 | |
PAGEMAP_SWAPPED = 1<<62 | |
main_arena = gdb.parse_and_eval('&main_arena') | |
bins_per_arena = int(gdb.parse_and_eval( |
NewerOlder