Skip to content

Instantly share code, notes, and snippets.

View eborisch's full-sized avatar

Eric A. Borisch eborisch

View GitHub Profile
@eborisch
eborisch / zpool_raw_stats.patch
Last active June 11, 2018 22:02
Patch to add -p switch to output raw (not averaged) counters on parsable (tab-separated) lines. Also -H (no header.)
Index: cddl/contrib/opensolaris/cmd/zpool/zpool_main.c
===================================================================
--- cddl/contrib/opensolaris/cmd/zpool/zpool_main.c (revision 327490)
+++ cddl/contrib/opensolaris/cmd/zpool/zpool_main.c (working copy)
@@ -233,7 +233,7 @@
"[-R root] [-F [-n]]\n"
"\t <pool | id> [newpool]\n"));
case HELP_IOSTAT:
- return (gettext("\tiostat [-v] [-T d|u] [pool] ... [interval "
+ return (gettext("\tiostat [-Hpv] [-T d|u] [pool] ... [interval "
@eborisch
eborisch / bash_sleep_snippet.sh
Created October 27, 2017 21:53
Replacement for sleep in bash scripts...
#!/bin/bash
# A replacement for sleep that doesn't use an external program and is
# interrupted nicely. (Doesn't wait for sleep to exit, doesn't leave
# a sleep runnning.)
# This fifo only exists long enough to open it R/W as fd 9.
fifo="/tmp/.sleep.fifo.$$"
mkfifo "${fifo}" && exec 9<>"${fifo}" && rm -f ${fifo} || \
echo "ERROR MAKING FIFO [$fifo]!!"
@eborisch
eborisch / gist:ef6ff539ed572c8a4204a72180990a0b
Created June 16, 2017 20:38
clang -ffast-math and -fno-finite-math-only
I'm having issue with clang; it doesn't appear to honor -ffast-math with -fno-finite-math-only:
Test file: (nanfunc.c)
int testfunc(float dut) {return dut == dut;}
Reproducing: (Should be able to do without -O3; haven't retried.)
> clang -O3 -c nanfunc.c -o nanfunc.o
> clang -O3 -ffast-math -c nanfunc.c -o nanfunc_fast.o
> clang -O3 -ffast-math -fno-finite-math-only -c nanfunc.c -o nanfunc_fast_nfmo.o
> gcc-mp-6 -O3 -c nanfunc.c -o nanfunc_gcc.o

Keybase proof

I hereby claim:

  • I am eborisch on github.
  • I am eborisch (https://keybase.io/eborisch) on keybase.
  • I have a public key ASAiuNYKYgGtCBZDkIQwArKaukj-bOfbR10EWHV4KJZ3HQo

To claim this, I am signing this object: