/*  This file is part of lsnet.
    Copyright (C) 2009-2010  Sterling Pickens
    Lsnet is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    Lsnet is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with lsnet.  If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef __CPUINFO_H__
#define __CPUINFO_H__ 1


#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <time.h>
//#include <sys/types.h>
#include <math.h>
#include "logdir.h"
#include "config.h"

#define T_DIFF(s, e) ((double)(e.tv_sec*1000000-s.tv_sec*1000000+e.tv_usec-s.tv_usec)/1000000)

//extern int using_alt_conf;
extern struct log_data global_strs;

struct cpu_data{
        unsigned int cores;
        unsigned int polls;
        unsigned int frequency;
        unsigned int mhz;
        double ***poll_one;
        double ***poll_all;
        double **min_one;
};


void Cpu_allocate(void);

void Cpu_ten_min(void);

static double Get_cpuinfo(void);
static void Cpu_one_min(void);


#endif
