--- /dev/null
+#!/bin/sh
+
+insmod test-mark-speed.ko
+for a in `seq 1 10`; do cat /proc/testmark;done
+rmmod test-mark-speed
+RESSTD=`dmesg |tail -n 10 |sed 's/^\[.*\] cycles : \(.*\)$/\1/'`
+
+insmod test-mark-speed-opt.ko
+for a in `seq 1 10`; do cat /proc/testmark;done
+rmmod test-mark-speed-opt
+RESOPT=`dmesg |tail -n 10|sed 's/^\[.*\] cycles : \(.*\)$/\1/'`
+
+insmod test-mark-speed-edit.ko
+for a in `seq 1 10`; do cat /proc/testmark;done
+rmmod test-mark-speed-edit
+RESNOP=`dmesg |tail -n 10|sed 's/^\[.*\] cycles : \(.*\)$/\1/'`
+
+
+echo "Numbers for normal marker"
+
+SUM="0"
+for a in $RESSTD; do SUM=$[$SUM + $a]; done
+RESSTD=$[$SUM / 10]
+
+echo $RESSTD
+
+echo "Numbers for optimized marker"
+SUM="0"
+for a in $RESOPT; do SUM=$[$SUM + $a]; done
+RESOPT=$[$SUM / 10]
+echo $RESOPT
+
+echo "Numbers for NOP replacement of function call"
+SUM="0"
+for a in $RESNOP; do SUM=$[$SUM + $a]; done
+RESNOP=$[$SUM / 10]
+echo $RESNOP
+
static void noinline test2(const struct marker *mdata,
void *call_private, ...)
{
+ unsigned char *ins = __builtin_return_address(0) - 5;
+#if 0
/* not called */
- printk("blah\n");
+ printk("ip %p\n", __builtin_return_address(0));
+ printk("prev_ins %hX %hX %hX %hX %hX\n",
+ ins[0], ins[1], ins[2], ins[3], ins[4]);
+#endif //0
+ ins[0] = 0x90;
+ ins[1] = 0x90;
+ ins[2] = 0x90;
+ ins[3] = 0x90;
+ ins[4] = 0x90;
}
/*