00001 /*! 00002 * \file cpu_reserve/include/utcb_stat.h 00003 * \brief Timeslice watching using the UTCB Ring-buffer of scheduling events 00004 * 00005 * \date 01/12/2005 00006 * \author Jork Loeser <jork.loeser@inf.tu-dresden.de> 00007 * 00008 */ 00009 /* (c) 2005 Technische Universitaet Dresden 00010 * This file is part of DROPS, which is distributed under the terms of the 00011 * GNU General Public License 2. Please see the COPYING file for details. 00012 */ 00013 #ifndef __CPU_RESERVE_INCLUDE_UTCB_STAT_H_ 00014 #define __CPU_RESERVE_INCLUDE_UTCB_STAT_H_ 00015 #include <l4/sys/utcb.h> 00016 00017 typedef struct { 00018 unsigned long long type:2; 00019 unsigned long long id:6; 00020 unsigned long long release:56; 00021 unsigned long long left:32; 00022 } l4cpu_reserve_utcb_elem_t; 00023 00024 #define L4CPU_RESERVE_UTCB_STAT_COUNT 30 00025 typedef struct{ 00026 l4_utcb_t utcb; 00027 l4_uint16_t head, tail, full, dummy; 00028 l4_uint64_t release; 00029 l4cpu_reserve_utcb_elem_t stat[L4CPU_RESERVE_UTCB_STAT_COUNT]; 00030 } l4cpu_reserve_utcb_t; 00031 00032 typedef enum { 00033 L4_UTCB_PERIOD_OVERRUN = 0, 00034 L4_UTCB_RESERVATION_OVERRUN = 1, 00035 L4_UTCB_NEXT_PERIOD = 2, 00036 L4_UTCB_NEXT_RESERVATION = 3, 00037 } l4cpu_reserve_utcb_stat_type; 00038 00039 static inline const char*l4cpu_reserve_utcb_stat_itoa(int type){ 00040 switch(type){ 00041 case 0: return "period overrun"; 00042 case 1: return "reservation overrun"; 00043 case 2: return "next period"; 00044 case 3: return "next reservation"; 00045 } 00046 return 0; 00047 } 00048 00049 00050 #endif