auto import from //depot/cupcake/@135843
diff --git a/libop/op_get_interface.c b/libop/op_get_interface.c
new file mode 100644
index 0000000..bdf72a5
--- /dev/null
+++ b/libop/op_get_interface.c
@@ -0,0 +1,32 @@
+/**
+ * @file op_get_interface.c
+ * Determine which oprofile kernel interface used
+ *
+ * @remark Copyright 2002 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author Will Cohen
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "op_cpu_type.h"
+#include "op_file.h"
+
+op_interface op_get_interface(void)
+{
+	static op_interface current_interface = OP_INTERFACE_NO_GOOD;
+
+	if (current_interface != OP_INTERFACE_NO_GOOD)
+		return current_interface;
+
+	if (op_file_readable("/proc/sys/dev/oprofile/cpu_type")) {
+		current_interface = OP_INTERFACE_24;
+	} else if (op_file_readable("/dev/oprofile/cpu_type")) {
+		current_interface = OP_INTERFACE_26;
+	}
+
+	return current_interface;
+}