/**********************************************************************
 * Copyright (c) 2005, 2006 Scapa Technologies Limited and others
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 * $Id: perflin.h,v 1.2 2006/10/26 22:39:40 kcallaghan Exp $
 * 
 * Contributors: 
 * Scapa Technologies Limited - Initial API and implementation
 **********************************************************************/

#ifndef __PERFLIN__H__
#define __PERFLIN__H__

#include "system.h"
#include "hashtable.h"
#include "DataCollectionInterface.h"
#include <sys/sysinfo.h>

#define STAT_CPU "10000"
#define STAT_CPU1 "C10001"
#define STAT_CPU2 "C10002"
#define STAT_CPU3 "C10003"
#define STAT_CPU4 "C10004"
#define STAT_CPU5 "C12305"
#define STAT_CPU6 "C12306"
#define STAT_CPU7 "C12307"
#define STAT_OTHER "10005"
#define STAT_SWAP1 "C10006"
#define STAT_SWAP2 "C10007"
#define STAT_PAGE1 "C10008"
#define STAT_PAGE2 "C10009"
#define STAT_INTR "C10010"
#define STAT_CTXT "C10011"
#define STAT_BTIME "C10012"
#define STAT_PROC "C10013"
#define STAT_TOTAL "10014"
#define STAT_CPU_TOTAL "10015"
#define STAT_CPU1_TOTAL "C10016"
#define STAT_CPU2_TOTAL "C10017"
#define STAT_CPU3_TOTAL "C10018"
#define STAT_CPU4_TOTAL "C10019"
#define STAT_CPU5_TOTAL "C12320"
#define STAT_CPU6_TOTAL "C12321"
#define STAT_CPU7_TOTAL "C12322"
#define STAT_CPU0_TOTAL "C11020"
#define STAT_CPU0 "C11021"
#define STAT_TOTAL_PROC "C11022"

#define STAT_PARENT "10020"
#define STAT_DISK "10021"
#define STAT_NOINFO "C10022"
#define STAT_READ_IO "C10023"
#define STAT_READ_BLKS "C10024"
#define STAT_WRITE_IO "C10025"
#define STAT_WRITE_BLKS "C10026"

#define MEM_PARENT "10130"
#define MEM_TOTAL "C10030"
#define MEM_FREE "C10031"
#define MEM_USED "C10032"
#define	MEM_BUFFERS "C10033"
#define	MEM_CACHED "C10034"
#define	MEM_SWAPT "C10035"
#define MEM_SWAPF "C10036"
#define MEM_SWAPU "C10037"
#define MEM_PERC "C10038"
#define MEM_SPERC "C10039"

#define PROC_MAIN "10050"
#define PROC_PARENT "10040"
#define PROC_CPU "10041"
#define PROC_CPU_BOTH "C10042"
#define PROC_CPU_TIME "C10043"
#define PROC_CPU_UTIME "C10044"
#define PROC_CPU_STIME "C10045"
#define PROC_CPU_CTIME "C10046"
#define PROC_CPU_CUTIME "C10047"
#define PROC_CPU_CSTIME "C10048"
#define PROC_VSIZE "C10049"

#define PROC_OTHER "10055"
#define PROC_OTHER_PID "C10056"
#define PROC_OTHER_PPID "C10057"
#define PROC_OTHER_PROCESSOR "C10058"

#define PROC_MEM "10059"
#define PROC_MEM_RSS "C10060"
#define PROC_MEM_NSWAP "C10061"
#define PROC_MEM_CNSWAP "C10062"
#define PROC_MEM_SIZE "C10063"
#define	PROC_MEM_RESIDENT "C10064"
#define	PROC_MEM_SHARE "C10065"
#define	PROC_MEM_TRS "C10066"
#define	PROC_MEM_DRS "C10067"
#define	PROC_MEM_LRS "C10068"
#define PROC_MEM_DT "C10069"
#define PROC_MEM_SWAP "C10070"
#define PROC_MEM_CMINFLT "C10071"
#define PROC_MEM_MINFLT "C10072"
#define PROC_MEM_MAJFLT "C10073"
#define PROC_MEM_CMAJFLT "C10074"
#define PROC_MEM_PERC "C10075"

#define NET_INTERFACE "10080"
#define NET_RBYTES "C10081"
#define NET_RPACKETS "C10082"
#define NET_RERRS "C10083"
#define NET_RDROP "C10084"
#define NET_RFIFO "C10085"
#define NET_RFRAME "C10086"
#define NET_RCOMPRESSED "C10087"
#define NET_RMULTICAST "C10088"
#define NET_TBYTES "C10089"
#define NET_TPACKETS "C10090"
#define NET_TERRS "C10091"
#define NET_TDROP "C10092"
#define NET_TFIFO "C10093"
#define NET_TCOLLISIONS "C10094"
#define NET_TCARRIER "C10095"
#define NET_TCOMPRESSED "C10096"

#define PART_PARENT "10100"
#define PART_PART "10101"
#define PART_PERCU "C10102" 
#define PART_PERCF "C10103" 
#define PART_TOTAL_SIZE "C10104" 
#define PART_FREE_SIZE "C10105"
#define PART_AVAIL_SIZE "C10106" 
#define PART_USED_SIZE "C10107" 
#define PART_TOTAL_BLKS "C10108" 
#define PART_FREE_BLKS "C10109" 
#define PART_AVAIL_BLKS "C10110" 
#define PART_USED_BLKS "C10111" 
#define PART_OPTIMAL "C10112" 
#define PART_TOTAL_NODES "C10113" 
#define PART_TOTAL_FREE "C10114" 
#define PART_TOTAL_USED "C10115" 
#define PART_TOTAL_MAXLEN "C10116" 

#define SWAP_PARENT "10150"
#define SWAP_PART "10151"
#define SWAP_TOTAL "C10152"
#define SWAP_USED "C10153"
#define SWAP_FREE "C10154"
#define SWAP_PUSED "C10155"
#define SWAP_PFREE "C10156"

#define NEW_DISK_PARENT "20000"
#define NEW_DISK_READNO "C20001"
#define NEW_DISK_READMERGE "C20002"
#define NEW_DISK_READSECTORS "C20003"
#define NEW_DISK_READMILLI "C20004"
#define NEW_DISK_WRITENO "C20005"
#define NEW_DISK_WRITEMERGE "C20006"
#define NEW_DISK_WRITESECTORS "C20007"
#define NEW_DISK_WRITEMILLI "C20008"
#define NEW_DISK_IOCOUNT "C20009"
#define NEW_DISK_IOMILLI "C20010"
#define NEW_DISK_WEIGHTED "C20011"

#define LWP_MAIN "30000"

#define NDEBUG !DEBUG

#define BUFFSIZE 1024

#ifndef NUM_SNAPSHOTS
	#define NUM_SNAPSHOTS 2
#endif

// General Stat Methods
void getStatInfo(char* pid);
void getStatResults();

// Memory Information Methods
void getMemInfoResults();
void getMemInfoTree(char* parentid);

// Process Information Methods
void getProcessesResults();
void getProcessesTree(char* parentid);
void addProcessMemResults(char* pid,long size,long resident,long share,long trs,long drs,long lrs,long dr);
void addProcessMemTree(char* parentid);

// Network Information Method
void getNetInfoTree(char* parentid);
void getNetInfoResults();

void getMountTree(char* parentid);
void getMountResults();

void getSwapTree(char* parentid);
void getSwapResults();

#endif
