Skip to content

Instantly share code, notes, and snippets.

View jjelinek's full-sized avatar

Jerry Jelinek jjelinek

  • RackTop Systems
View GitHub Profile
@jjelinek
jjelinek / dtrace destroy
Last active August 29, 2015 13:57
dtrace destroy
#pragma D option quiet
fbt::zfs_domount:entry
{
printf("%s 0x%p %s\n", probefunc, arg0, stringof(arg1));
vfs = (vfs_t *)arg0;
self->vfs = vfs;
}
fbt::zfsvfs_create:entry
@jjelinek
jjelinek / gist:9807800
Created March 27, 2014 13:41
zone truss
fbt::zone:entry
/arg0 == 7/
{
printf("%s -> %d\n", probefunc, arg0);
}
fbt::zone_boot:entry
{
printf("%s -> zoneid %d\n", probefunc, arg0);
}
@jjelinek
jjelinek / gist:9696f311835800c594c8
Created February 2, 2015 23:33
vsyscall probes
2015 Feb 2 23:31:35: cleaned bash (pid 122076)
2015 Feb 2 23:31:35: cleaned bash (pid 122076)
2015 Feb 2 23:31:35: cleaned cat (pid 122078)
2015 Feb 2 23:31:35: cleaned bash (pid 122076)
2015 Feb 2 23:31:35: cleaned init (pid 122074)
2015 Feb 2 23:31:35: cleaned rc.sysinit (pid 122081)
2015 Feb 2 23:31:35: cleaned rc.sysinit (pid 122081)
2015 Feb 2 23:31:35: cleaned hostname (pid 122084)
2015 Feb 2 23:31:35: cleaned modprobe (pid 122086)
2015 Feb 2 23:31:35: cleaned mount (pid 122087)
#include <stdio.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int (*gettod)(int *) = (void *)0xffffffffff600000;
static void
vsyscall()
@jjelinek
jjelinek / capping
Last active August 29, 2015 14:16
memcapper
The physical memory limit and the swap cap are two independent and
unrelated limits.
The physical memory limit is a soft cap that controls how many pages of
physical memory can be resident for the zone. Once that value is exceeded
the memory capper will invalidate pages until the RSS of the set of
processes within the zone is below the limit.
The swap cap is a hard limit and is used to control how much anonymous
memory is available. Because anonymous memory is reserved when it is
@jjelinek
jjelinek / lx.5
Created February 8, 2016 13:37
lx man page
LX(5) Standards, Environments, and Macros LX(5)
NAME
lx – zone brand for running a GNU/Linux user-level environment
DESCRIPTION
The lx brand uses the brands(5) framework to provide an environment for
running binary applications built for GNU/Linux. User-level code,
including an entire Linux distribution, can run inside the zone. Both
32-bit and 64-bit applications are supported. The majority of Linux
@jjelinek
jjelinek / gist:850a7269cc13e774ca53
Created February 23, 2016 22:48
sys block layout
jerry@ub64:~$ ls -l /sys/block
total 0
lr-xr-xr-x 1 root root 0 Feb 23 22:47 cmdk0 -> ../devices/virtual/bdi/cmdk0
lr-xr-xr-x 1 root root 0 Feb 23 22:47 lxzdev -> ../devices/pci/lxzdev
lr-xr-xr-x 1 root root 0 Feb 23 22:47 ramdisk1 -> ../devices/virtual/bdi/ramdisk1
lr-xr-xr-x 1 root root 0 Feb 23 22:47 sd0 -> ../devices/virtual/bdi/sd0
lr-xr-xr-x 1 root root 0 Feb 23 22:47 zones -> ../devices/virtual/bdi/zones
lr-xr-xr-x 1 root root 0 Feb 23 22:47 zv2 -> ../devices/pci/zv2
jerry@ub64:~$
jerry@ub64:~$ ls -lL /sys/block/sd0
I added the following two probes to lx_emulate_user()
--- a/usr/src/uts/intel/brand/lx/lx_archdep.c
+++ b/usr/src/uts/intel/brand/lx/lx_archdep.c
@@ -1438,6 +1438,8 @@ lx_emulate_user(klwp_t *lwp, int syscall_num, uintptr_t *a
*/
ucontext_t uc;
+DTRACE_PROBE5(lx__callstack, int, syscall_num, void *, lwpd, void *, sp,
+ void *, top, int, frsz);
MapR Installation Steps
=======================
1) Create an Ubuntu 14.04 zone with at least 8GB memory.
2) In GZ, create a zfs dataset 'zones/{zonename}/data' and delegate that
dataset to the zone.
3) In GZ, create at least one 10GB (or larger) zvol in the dataset
(e.g. run: zfs create -V 10g zones/{zonename}/data/vd0)
4) Reboot zone
5) ssh into the zone
[root@headnode (coal) /zones/jj]# kstat -c sysevents
module: unix instance: 0
name: com.sun:fm:error class: sysevents
crtime 0
emitted 1
fail_time 0
failed 0
snaptime 705968.224513130
module: unix instance: 0