Skip to content

Instantly share code, notes, and snippets.

View dechamps's full-sized avatar

Etienne Dechamps dechamps

View GitHub Profile
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <sys/mman.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
static const size_t FILE_SIZE = 512;
configure.ac:37: installing `config/config.guess'
configure.ac:37: installing `config/config.sub'
configure.ac:40: installing `config/install-sh'
configure.ac:40: installing `config/missing'
cmd/mount_zfs/Makefile.am: installing `config/depcomp'
checking metadata... yes
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking whether to enable maintainer-specific portions of Makefiles... no
vdev_raidz_io_start(WRITE, 0, 2243584, 512): DVA[0]=<0:223c00:400> DVA[1]=<0:301f800:400> DVA[2]=<0:5e15000:400> [L0 DMU objset] fletcher4 lzjb LE contiguous unique triple size=800L/200P birth=11L/11P fill=44 cksum=1101c183f2:6028c5c42e1:119b8efc307a3:239cfd476e26cb
vdev_raidz_io_start(WRITE, 1, 2243584, 512): DVA[0]=<0:223c00:400> DVA[1]=<0:301f800:400> DVA[2]=<0:5e15000:400> [L0 DMU objset] fletcher4 lzjb LE contiguous unique triple size=800L/200P birth=11L/11P fill=44 cksum=1101c183f2:6028c5c42e1:119b8efc307a3:239cfd476e26cb
vdev_raidz_io_start(WRITE, 0, 50460672, 512): DVA[0]=<0:223c00:400> DVA[1]=<0:301f800:400> DVA[2]=<0:5e15000:400> [L0 DMU objset] fletcher4 lzjb LE contiguous unique triple size=800L/200P birth=11L/11P fill=44 cksum=1101c183f2:6028c5c42e1:119b8efc307a3:239cfd476e26cb
vdev_raidz_io_start(WRITE, 1, 50460672, 512): DVA[0]=<0:223c00:400> DVA[1]=<0:301f800:400> DVA[2]=<0:5e15000:400> [L0 DMU objset] fletcher4 lzjb LE contiguous unique triple size=800L/200P birth=11
@dechamps
dechamps / closer-look.txt
Created October 6, 2012 10:54
Conflicting writes debugging session #1
(gdb) thread 81
(gdb) frame 3
(gdb) print *zio
$1 = {io_bookmark = {zb_objset = 51, zb_object = 169, zb_level = 0, zb_blkid = 84861110386}, io_prop = {zp_checksum = ZIO_CHECKSUM_INHERIT,
zp_compress = ZIO_COMPRESS_INHERIT, zp_type = DMU_OT_NONE, zp_level = 0 '\000', zp_copies = 0 '\000', zp_dedup = 0 '\000',
zp_dedup_verify = 0 '\000'}, io_type = ZIO_TYPE_WRITE, io_child_type = ZIO_CHILD_VDEV, io_cmd = 0, io_priority = 10 '\n',
io_reexecute = 0 '\000', io_state = "\001", io_txg = 1320, io_spa = 0x259eac0, io_bp = 0x0, io_bp_override = 0x0, io_bp_copy = {blk_dva = {{
dva_word = {0, 0}}, {dva_word = {0, 0}}, {dva_word = {0, 0}}}, blk_prop = 0, blk_pad = {0, 0}, blk_phys_birth = 0, blk_birth = 0,
blk_fill = 0, blk_cksum = {zc_word = {0, 0, 0, 0}}}, io_parent_list = {list_size = 48, list_offset = 16, list_head = {
list_next = 0x7f2bcccf9820, list_prev = 0x7f2bcccf9820}}, io_child_list = {list_size = 48, list_offset = 32, list_head = {
@dechamps
dechamps / threads.txt
Created October 6, 2012 11:16
ZFS conflicting writes #2
Thread 111 (Thread 0x7f2bc9e5f700 (LWP 9379)):
#0 pthread_cond_timedwait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S:216
#1 0x00007f2bcd1df4f1 in cv_timedwait (cv=0x7f2bcd54d200, mp=0x7f2bcd54d1c0, abstime=27179666) at ../../lib/libzpool/kernel.c:481
#2 0x00007f2bcd1ec900 in arc_adapt_thread () at ../../module/zfs/arc.c:2215
#3 0x00007f2bcd1db3b2 in zk_thread_helper (arg=0x151c540) at ../../lib/libzpool/kernel.c:135
#4 0x00007f2bcc93bb50 in start_thread (arg=<optimized out>) at pthread_create.c:304
#5 0x00007f2bcc68670d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#6 0x0000000000000000 in ?? ()
Thread 110 (Thread 0x7f2bc9e53700 (LWP 9380)):
@dechamps
dechamps / msync-multisize.c
Created November 9, 2013 19:42
Sample program that exhibits extremely slow msync() on ZFS.
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <sys/mman.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <fcntl.h>
#include <unistd.h>
FSTYP -- zfs
PLATFORM -- Linux/x86_64 zyklos 3.11-1-amd64
MKFS_OPTIONS -- -f -O mountpoint=legacy /dev/sdi2
MOUNT_OPTIONS -- /dev/sdi2 /scratch
generic/001 2s ... 2s
generic/002 0s ... 0s
generic/005 1s ... 0s
generic/006 1s ... 0s
generic/007 1s ... 1s
@dechamps
dechamps / tap-win32-test.c
Last active December 7, 2020 00:20
TAP-Win32 trivial test program
#include <stdio.h>
#include <stdlib.h>
#include <Windows.h>
#include "tap-windows.h"
static void winerror(const char* message)
{
int err = GetLastError();
fprintf(stderr, "%s: (%d) ", message, err);
grub-probe: info: cannot open `/boot/grub/device.map': No such file or directory.
grub-probe: info: /dev/sdd1 is not present.
grub-probe: info: Looking for /dev/sdd1.
grub-probe: info: /dev/sdd is a parent of /dev/sdd1.
grub-probe: info: /dev/sdd1 starts from 2048.
grub-probe: info: opening the device hostdisk//dev/sdd.
grub-core/kern/disk.c:196: Opening `hostdisk//dev/sdd'...
grub-probe: info: drive = 0.
grub-probe: info: the size of hostdisk//dev/sdd is 5860533168.
grub-core/kern/disk.c:196: Opening `hostdisk//dev/sdd'...
@dechamps
dechamps / lux.json
Created October 14, 2017 14:13
Domoticz V3.8153 LUX sensor JSON output
{
"ActTime": 1507990266,
"ServerTime": "2017-10-14 15:11:06",
"Sunrise": "07:24",
"Sunset": "18:08",
"result": [
{
"AddjMulti": 1,
"AddjMulti2": 1,
"AddjValue": 0,