]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/l4util/lib/src/ARCH-x86/perform.c
Inital import
[l4.git] / l4 / pkg / l4util / lib / src / ARCH-x86 / perform.c
1 /*
2  * (c) 2008-2009 Technische Universität Dresden
3  * This file is part of TUD:OS and distributed under the terms of the
4  * GNU Lesser General Public License 2.1.
5  * Please see the COPYING-LGPL-2.1 file for details.
6  */
7 /**
8  * \brief   lib for performance mesaurement counters. 
9  */
10
11 #include <l4/sys/types.h>
12
13 #define CONFIG_PERFORM_ONLY_PROTOTYPES
14 #include <l4/util/perform.h>
15
16 typedef struct
17 {
18   l4_uint32_t index;
19   const char *string;
20 } event_entry;
21
22 static const event_entry event_array[]=
23 {
24 #include "pmc_events.h"
25 };
26
27 const char*
28 strp6pmc_event(l4_uint32_t event)
29 {
30   unsigned i;
31
32   for (i=0; i<sizeof(event_array)/sizeof(event_entry); i++)
33     if (event_array[i].index == event)
34       return event_array[i].string;
35
36   return "unkown";
37 }