[dev-console] - New internal structure, and new XO interface

This commit is contained in:
Eduardo Silva
2007-01-02 20:24:44 -03:00
parent 80cd6af44c
commit e28a1b27ee
46 changed files with 364 additions and 51 deletions
@@ -0,0 +1,6 @@
sugardir = $(pkgdatadir)/shell/console/interface/memphis/plugins/dirty_size
sugar_PYTHON = \
README \
__init__.py \
info.py
@@ -0,0 +1,2 @@
This plugin give support to get the public and shared dirty memory usage
by process using the /proc/PID/smaps file.
@@ -0,0 +1,17 @@
import info
INTERNALS = {
# Basic information
'PLGNAME': "Dirty Size",
'TABNAME': None, # No tabbed plugin
'AUTHOR': "Eduardo Silva",
'DESC': "Get dirty size memory usage",
# Plugin API
'Plg': None, # Plugin object
'top_data': [int], # Top data types needed by memphis core plugin
'top_cols': ["PDRSS (kb)"]
}
@@ -0,0 +1,20 @@
###########################################################
# Main function:
# -----------------
# self: self plugin object
# mself: memphis object / principal class
# pinfo: row with information about current tracing process
############################################################
def plg_on_top_data_refresh(self, ppinfo):
dirty_sizes = get_dirty(self, ppinfo['pid'])
# memhis need an array
return [dirty_sizes['private']]
def get_dirty(pself, pid):
ProcAnalysis = pself.INTERNALS['Plg'].proc_analysis(pid)
return ProcAnalysis.DirtyRSS()