Skip to content

Instantly share code, notes, and snippets.

0 38573.1 1 14831.6 2 7893.16 3 625.987 4 26.1359 5 10.9159 6 9.23542 7 9.08501 8 9.07054 9 9.06913

package main
import (
"fmt"
"github.com/golang/protobuf/proto"
pb "github.com/taskgraph/taskgraph/example/bwmf/proto"
"io/ioutil"
"os"
"strconv"
)
package main
import (
"fmt"
"github.com/golang/protobuf/proto"
pb "github.com/taskgraph/taskgraph/example/bwmf/proto"
"io/ioutil"
"os"
"strconv"
)
#include <math.h>
#include <signal.h>
#include <unistd.h>
#include <sys/time.h>
#define INTERVAL 50000
#define SAMPLES 200
int sleep_interval[SAMPLES];
@5kg
5kg / time.c
Created January 16, 2014 01:50
#include <stdio.h>
#include <limits.h>
#include <time.h>
int main()
{
time_t lo = 0x0, hi = LONG_MAX, mid;
while (lo < hi) {
mid = lo + (hi-lo)/2;
if (ctime(&mid))
diff --git a/src/common/hashtable/rculfhash.h b/src/common/hashtable/rculfhash.h
index 17cf6db..601feea 100644
--- a/src/common/hashtable/rculfhash.h
+++ b/src/common/hashtable/rculfhash.h
@@ -34,6 +34,11 @@
#include "urcu-flavor.h"
+static int __attribute__((noinline)) __is_null_pointer(unsigned long v)
+{
Program terminated with signal 11, Segmentation fault.
#0 0x00007f59aeb1c45e in __printf_fp () from /usr/lib/libc.so.6
(gdb) bt
#0 0x00007f59aeb1c45e in __printf_fp () from /usr/lib/libc.so.6
#1 0x00007f59aeb1b185 in vfprintf () from /usr/lib/libc.so.6
#2 0x00007f59aeb207b9 in printf () from /usr/lib/libc.so.6
#3 0x0000000000400534 in main ()
#include <dyninst/BPatch.h>
int main (int argc, const char* argv[]) {
BPatch bpatch;
BPatch_process *proc = bpatch.processAttach(argv[1], atoi(argv[2]));
proc->detach(true);
return 0;
}
@5kg
5kg / run
Last active December 23, 2015 02:59
➜ test ./run
Session auto-20130915-214809 created.
Traces will be written in /home/zifeitong/lttng-traces/auto-20130915-214809
UST event test:call_foo created in channel channel0
Tracing started for session auto-20130915-214809
Hello World!
I am foo()
I am foo()
I am foo()
I am foo()
a.out: file format elf64-x86-64
Disassembly of section .init:
00000000004003e0 <_init>:
4003e0: 48 83 ec 08 sub $0x8,%rsp
4003e4: 48 8b 05 75 06 20 00 mov 0x200675(%rip),%rax # 600a60 <_DYNAMIC+0x1d0>
4003eb: 48 85 c0 test %rax,%rax