[collectd] little compiling issue & process stat plugin

cydvd at autistici.org cydvd at autistici.org
Mon Apr 10 10:13:25 CEST 2006


Hello,

thanks for the docs about compiling & building the collectd system.
I've correctly configured the "--with-rrdtool" option before the make 
process, but i don't understand why the daemon collectd created in this 
way doesn't create the RRD databases, while installing the precompiled 
rpm package (rel. 3.7.0-1) all run correctly, creating & updating the 
various RRD databases.
There's some other configure & compile issue that i've forgot? All 
seems to run without faults.


Talking about the "process stat" plugin, i'm very interested in this 
plugin; my idea is the same of David bacher, who want read the 
/proc/$pid/task information; the problem is how figure out which thread 
belong to the process with the $pid.

I was trying to collect the information of a single process reading the 
/proc/$pid/stat info; there can be some interesting information here 
about the various threads? I'm not very skilled with the forking & LWP 
questions.

Anyway, i report here the 2.6 kernel struct that i want to use to scan 
the stat information:


typedef struct statstruct_proc {
	int	pid;							//	%d	The process ID
	char comm[_POSIX_PATH_MAX];	//	%s	The filename of the executable, in 
parentheses
	char state;			//	%c	State of the process  from the string "RSDZTW"
	int ppid;			//	%d	The PID of the parent
	int pgid;			//	%d	The process group ID of the process
	int sid;				//	%d	The session ID of the process
	int tty_nr;			//	%d	Number of major faults the  process  has  made  
which have required loading a memory page from disk
	int tty_pgrp;		//	%d	The  process group ID of the process which 
currently owns the tty that the process is connected to
	unsigned long int flags;		//	%lu The kernel flags word of the process
	unsigned long int min_flt;		//	%lu Number of minor faults the  process 
  has  made  which have not required loading a memory page from disk
	unsigned long int cmin_flt;	//	%lu	Number of minor faults that the 
process?s waited-for children have made
	unsigned long int maj_flt;		//	%lu Number of major faults the  process 
  has  made  which have required loading a memory page from disk
	unsigned long int cmaj_flt;	//	%lu Number of major faults that the 
process?s waited-for children have made
	unsigned long int utime;		//	%lu Number of jiffies that the process 
have been scheduled in user mode
	unsigned long int stime;		//	%lu Number of jiffies that the process 
have been scheduled in kernel mode
	long int cutime;					//	%ld Number of jiffies that the process's 
waited for children have been scheduled in user mode
	long int cstime;					//	%ld Number of jiffies that the process's 
waited for children have been scheduled in kernel mode
	long int priority;				//	%ld The  standard  nice  value,  plus  fifteen
	long int nice;						//	%ld The nice value ranges from 19 (nicest) to -19
	int num_threads;					//	%d
	long int it_real_value;			//	%ld
	unsigned long long start_time;	//	%llu The  time  in  jiffies  the  
process started after system boot
	unsigned long int vsize;		//	%lu	Virtual memory size in bytes
	long int rss;						//	%ld	Resident Set Size: number of pages the 
process has in real memory, minus 3 for administrative purposes
	unsigned long int rsslim;		//	%lu Current limit in bytes on the rss of 
the process
	unsigned long int start_code;	//	%lu The address above which program 
text can run
	unsigned long int end_code;		//	%lu The address below which program 
text can run
	unsigned long int start_stack;	//	%lu The address of the start of the stack
	unsigned long int eSP;			//	%lu	Stack Pointer
	unsigned long int eIP;			//	%lu	Instruction pointer
	/* The signal information here is obsolete.
	 * It must be decimal for Linux 2.0 compatibility.
	 * Use /proc/#/status for real-time signals.
	 */
	unsigned long int pending_sig;		//	%lu The bitmap of pending signals
	unsigned long int blocked_sig;		//	%lu The bitmap of blocked signals
	unsigned long int sigign;			//	%lu The bitmap of ignored signals
	unsigned long int sigcatch;		//	%lu The bitmap of caught signals
	unsigned long int wchan;			//	%lu This is the "channel" in which the  
process  is  waiting
	unsigned long int dummy0;			//	%lu
	unsigned long int dummy1;			//	%lu
	int exit_signal;						//	%d Signal to be sent to parent when we die
	int cpu_task;							//	%d CPU number last executed on
	unsigned long int rt_priority;	//	%lu Real-time  scheduling   priority
	unsigned long int policy;			//	%lu Scheduling policy
} procinfo;



More information about the collectd mailing list