Here is  a first suggestion of implementation for a file called 
/usr/share/apport/general-hooks/powerpc.py 
 - can you give me your feedback - thanks
#------------------------------------------------------------------------
import os, re, os.path, sys, platform

import apport.packaging
import apport.hookutils

from glob import glob

"""  IBM Power System related information
"""

arch = platform.machine()
if arch in [ "ppc64", "ppc64le"]:
        print "Processing power %s" %arch
else:
        print "Not executing power query since arch %s" %arch
        exit(1)

def add_copy_spec(path):
        for file in apport.hookutils.read_file(path):
            apport.hookutils.attach_file(report, file)

def add_info(report):
        try:
            with open('/proc/cpuinfo', 'r') as fp:
                contents = fp.read()
                ispSeries = "pSeries" in contents
                isPowerNV = "PowerNV" in contents
        except:
            ispSeries = False
            isPowerNV = False

        if ispSeries or isPowerNV:
            print "Processing pSeries or PowerNV"
            add_copy_spec("/proc/device-tree/")
            add_copy_spec("/proc/loadavg")
            add_copy_spec("/proc/locks")
            add_copy_spec("/proc/misc")
            add_copy_spec("/proc/swaps")
            add_copy_spec("/proc/version")
            add_copy_spec("/dev/nvram")
            add_copy_spec("/var/log/platform")
            apport.hookutils.root_command_output(['ppc64_cpu','--smt'])
            
apport.hookutils.root_command_output(['ppc64_cpu','--cores-present'])
            apport.hookutils.root_command_output(['ppc64_cpu','--cores-on'])
            apport.hookutils.root_command_output(['ppc64_cpu','--run-mode'])
            apport.hookutils.root_command_output(['ppc64_cpu','--frequency'])
            apport.hookutils.root_command_output(['ppc64_cpu','--dscr'])

        if ispSeries:
            print "Processing pSeries addons"
            add_copy_spec("/proc/ppc64/lparcfg")
            add_copy_spec("/proc/ppc64/eeh")
            add_copy_spec("/proc/ppc64/systemcfg")
            apport.hookutils.root_command_output(['lscfg','-vp'])
            apport.hookutils.root_command_output(['lsmcode','-A'])
            apport.hookutils.root_command_output(['lsvpd','--debug'])
            apport.hookutils.root_command_output(['lsvio','-des'])
            apport.hookutils.root_command_output(['servicelog','--dump'])
            apport.hookutils.root_command_output(['servicelog_notify','--list'])
            apport.hookutils.root_command_output(['usysattn'])
            apport.hookutils.root_command_output(['usysident'])
            apport.hookutils.root_command_output(['serv_config','-l'])
            apport.hookutils.root_command_output(['bootlist','-m','both','-r'])
            apport.hookutils.root_command_output(['lparstat','-i'])

        if isPowerNV:
            add_copy_spec("/proc/ppc64/")


** Changed in: apport (Ubuntu)
       Status: Confirmed => In Progress

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1336462

Title:
  Make apport collect some Power information

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/apport/+bug/1336462/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to