summaryrefslogtreecommitdiffstats
path: root/examples/rbd-replay
diff options
context:
space:
mode:
Diffstat (limited to 'examples/rbd-replay')
-rw-r--r--examples/rbd-replay/.gitignore3
-rwxr-xr-xexamples/rbd-replay/create-image8
-rwxr-xr-xexamples/rbd-replay/replay9
-rwxr-xr-xexamples/rbd-replay/run-rbd-replay-prep3
-rwxr-xr-xexamples/rbd-replay/trace11
5 files changed, 34 insertions, 0 deletions
diff --git a/examples/rbd-replay/.gitignore b/examples/rbd-replay/.gitignore
new file mode 100644
index 000000000..f9e70539c
--- /dev/null
+++ b/examples/rbd-replay/.gitignore
@@ -0,0 +1,3 @@
+/*.log
+/replayer
+/traces
diff --git a/examples/rbd-replay/create-image b/examples/rbd-replay/create-image
new file mode 100755
index 000000000..878926785
--- /dev/null
+++ b/examples/rbd-replay/create-image
@@ -0,0 +1,8 @@
+#!/usr/bin/env bash
+
+pool=rbd
+image=my-image
+size=10G
+export LD_LIBRARY_PATH=../../build/lib
+#qemu-img create -f raw rbd:$pool/$image:conf=../../src/ceph.conf $size
+qemu-img convert linux-0.2.img -O raw rbd:$pool/$image:conf=../../src/ceph.conf
diff --git a/examples/rbd-replay/replay b/examples/rbd-replay/replay
new file mode 100755
index 000000000..9b138c678
--- /dev/null
+++ b/examples/rbd-replay/replay
@@ -0,0 +1,9 @@
+#!/usr/bin/env bash
+
+lttng create
+lttng enable-event -u 'librbd:*'
+lttng add-context -u -t pthread_id
+lttng start
+../../src/rbd-replay --conf=../../src/ceph.conf replay.bin "$@" | tee replay.log
+lttng stop
+lttng view > replay-trace.log
diff --git a/examples/rbd-replay/run-rbd-replay-prep b/examples/rbd-replay/run-rbd-replay-prep
new file mode 100755
index 000000000..d7e07e9be
--- /dev/null
+++ b/examples/rbd-replay/run-rbd-replay-prep
@@ -0,0 +1,3 @@
+#!/usr/bin/env bash
+
+../../src/rbd-replay-prep traces/ust/uid/10002/64-bit replay.bin
diff --git a/examples/rbd-replay/trace b/examples/rbd-replay/trace
new file mode 100755
index 000000000..8739d46e1
--- /dev/null
+++ b/examples/rbd-replay/trace
@@ -0,0 +1,11 @@
+#!/usr/bin/env bash
+
+mkdir -p traces
+lttng create -o traces librbd
+lttng enable-event -u 'librbd:*'
+lttng add-context -u -t pthread_id
+lttng start
+[ -z "$BUILD_DIR" ] && BUILD_DIR=build
+LD_LIBRARY_PATH=../../${BUILD_DIR}/lib qemu-system-i386 -m 1024 rbd:rbd/my-image:conf=../../src/ceph.conf
+lttng stop
+lttng view > trace.log