Browse Source

lttng: timing calibration feature

This calibration feature is fairly limited for now, but provides an
example of how this can be performed.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Mathieu Desnoyers 13 years ago
parent
commit
da66e4e541
1 changed files with 30 additions and 0 deletions
  1. 30 0
      drivers/staging/lttng/lttng-calibrate.c

+ 30 - 0
drivers/staging/lttng/lttng-calibrate.c

@@ -0,0 +1,30 @@
+/*
+ * lttng-calibrate.c
+ *
+ * Copyright 2011 (c) - Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
+ *
+ * LTTng probe calibration.
+ *
+ * Dual LGPL v2.1/GPL v2 license.
+ */
+
+#include "ltt-debugfs-abi.h"
+#include "ltt-events.h"
+
+noinline
+void lttng_calibrate_kretprobe(void)
+{
+	asm volatile ("");
+}
+
+int lttng_calibrate(struct lttng_kernel_calibrate *calibrate)
+{
+	switch (calibrate->type) {
+	case LTTNG_KERNEL_CALIBRATE_KRETPROBE:
+		lttng_calibrate_kretprobe();
+		break;
+	default:
+		return -EINVAL;
+	}
+	return 0;
+}