#!/bin/bash USERID=`id -u` TSTAMP=`date +%Y%m%d-%H%M%S` UDIR=$HOME CURDIR=`pwd` PERF_VERSION="$(uname -r)" PERF_VERSION="${PERF_VERSION%%-*}" case "$PERF_VERSION" in *.*.*) PERF_VERSION="${PERF_VERSION%.*}" ;; esac sudo modprobe usbmon tshark -F pcap -i eth0 -w ~/lttng-traces/network-$TSTAMP.pcap & #sudo and -F pcap is not working atm sudo is needed for usbmon #sudo tshark -F pcap -i usbmon0 -w ~/lttng-traces/usb-$TSTAMP.pcap & lttng create lttng-ust lttng list --userspace lttng enable-event --userspace hello_world:my_first_tracepoint lttng start mkdir -p uprobe-traces cd uprobe-traces sudo perf probe -x $CURDIR/hellolttngust MYEVENT=$CURDIR/hellolttngust.c:8 sudo perf probe -x $CURDIR/hellolttngust EVNAME=$CURDIR/hellolttngust.c:35 sudo perf record -e probe_hellolttngust:MYEVENT -e probe_hellolttngust:EVNAME & cd - mkdir -p kernel-traces cd kernel-traces sudo perf record -e sched:sched_switch & cd - ./hellolttngust huhu haha hihi sudo killall perf_$PERF_VERSION killall tshark #sudo killall tshark lttng stop lttng destroy echo wait for writing perf data wait cd uprobe-traces sudo perf data convert --to-ctf=$UDIR/lttng-traces/perf-uprobes-$TSTAMP sudo perf probe -d probe_hellolttngust:MYEVENT sudo perf probe -d probe_hellolttngust:EVNAME cd - cd kernel-traces sudo perf data convert --to-ctf=$UDIR/lttng-traces/perf-kernel-$TSTAMP cd - sudo chown -R $USERID $UDIR/lttng-traces/*