Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

[fcb818]: libop / op_get_interface.c Maximize Restore History

Download this file

op_get_interface.c    30 lines (23 with data), 595 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/**
* @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("/dev/oprofile/cpu_type"))
current_interface = OP_INTERFACE_26;
return current_interface;
}