op_get_interface.c

Go to the documentation of this file.
00001 
00011 #include <stdio.h>
00012 #include <stdlib.h>
00013 #include <string.h>
00014 
00015 #include "op_cpu_type.h"
00016 #include "op_file.h"
00017 
00018 op_interface op_get_interface(void)
00019 {
00020     static op_interface current_interface = OP_INTERFACE_NO_GOOD;
00021 
00022     if (current_interface != OP_INTERFACE_NO_GOOD)
00023         return current_interface;
00024 
00025     if (op_file_readable("/proc/sys/dev/oprofile/cpu_type")) {
00026         current_interface = OP_INTERFACE_24;
00027     } else if (op_file_readable("/dev/oprofile/cpu_type")) {
00028         current_interface = OP_INTERFACE_26;
00029     }
00030 
00031     return current_interface;
00032 }

Generated on 8 Nov 2012 for Oprofile by  doxygen 1.6.1