Skip to content

Instantly share code, notes, and snippets.

View giraldeau's full-sized avatar
🔨
working

Francis Giraldeau giraldeau

🔨
working
View GitHub Profile
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include <execinfo.h>
volatile static int *x = NULL;
volatile static int action = 0;
void bt()
{
#!/bin/sh -x
DBG=/sys/kernel/debug/tracing
do_echo() {
echo $1 | sudo tee $DBG/$2
}
do_echo function current_tracer
do_echo perf_event_overflow set_ftrace_filter
do_echo 1 tracing_on
do_echo 1 options/func_stack_trace
/*
* mmapbench.c
*
* Created on: Aug 7, 2015
* Author: francis
*/
#include <stdio.h>
#include <stdlib.h>
int do_syscall_read_long(void *args)
{
FILE *f = args;
int i;
long val;
for (i = 0; i < (PAGE_SIZE / sizeof(val)); i++) {
val = 0;
int ret = read(f->_fileno, &val, sizeof(val));
#!/usr/bin/env python3
import os
import sys
import babeltrace.reader
import babeltrace.common
import pprint
import shutil
from os.path import join, dirname, abspath
#define __kernel
#define __global
void saxpy_cpu(float *y,
float *x,
float a,
int n)
{
for (int i = 0; i < n; i++) {
y[i] = a * x[i] + y[i];
console.log("loading...")
var OSRM = require('osrm');
var osrm = new OSRM("geofabrik/canada-latest.osrm");
console.log("begin")
var coord = [];
coord.push([45.5370569, -73.5708777]);
coord.push([46.0243857, -73.439845]);
@giraldeau
giraldeau / events-lttng=2.7-linux=4.2.json
Last active November 17, 2015 01:37
output for lttng 2.7 and linux 4.2
{
"linux": {
"sysname": "Linux",
"nodename": "berta",
"release": "4.2.0-18-generic",
"version": "#22-Ubuntu SMP Fri Nov 6 18:25:50 UTC 2015",
"machine": "x86_64",
"domainname": "(none)"
},
"lttng": {
OpenJDK 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0
!SESSION 2016-01-06 12:23:37.998 -----------------------------------------------
eclipse.buildId=unknown
java.version=1.8.0_66-internal
java.vendor=Oracle Corporation
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_CA
Framework arguments: -version 3 -port 38628 -testLoaderClass org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader -loaderpluginname org.eclipse.jdt.junit4.runtime -test org.eclipse.cdt.core.model.tests.BinaryTests:testFoo -application org.eclipse.pde.junit.runtime.uitestapplication -product org.eclipse.sdk.ide -testpluginname org.eclipse.cdt.core.tests
Command-line arguments: -os linux -ws gtk -arch x86_64 -consoleLog -consolelog -version 3 -port 38628 -testLoaderClass org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader -loaderpluginname org.eclipse.jdt.junit4.runtime -test org.eclipse.cdt.core.model.tests.BinaryTests:testFoo -application org.eclipse.pde.junit.runtime.uitestapplicat
@Test
public void readBundleResource() throws IOException {
Bundle bundle = CTestPlugin.getDefault().getBundle();
URL entry = bundle.getEntry("resources/elf/build.log");
URL resource = bundle.getResource("resources/elf/build.log");
System.out.println(entry);
System.out.println(resource);
try (InputStream s1 = entry.openStream()) {