def explain(self, query, result): self.fd.explain(query, result) tmp = result.__class__(result) v = self.get_vol_object() # Get system time timespec = info_systime(v.addr_space, v.theProfile, v.symtable) tv_sec = timespec.tv_sec time = self.format_time(tv_sec) # Get timezone information sys_tz = info_timezone(v.addr_space, v.theProfile, v.symtable) tz_minuteswest = sys_tz.tz_minuteswest tz_hours = tz_minuteswest / 60 tz_dsttime = sys_tz.tz_dsttime # Get the number of cpus num_cpus = info_cpus(v.addr_space, v.theProfile, v.symtable) # Get utsname info system_utsname = info_system_utsname(v.addr_space, v.theProfile, v.symtable) if not system_utsname: print "Cannot access uts information" return release = read_null_string(v.addr_space, v.theProfile.abstract_types,\ ['new_utsname', 'release'], system_utsname.offset) nodename = read_null_string(v.addr_space, v.theProfile.abstract_types,\ ['new_utsname', 'nodename'], system_utsname.offset) sysname = read_null_string(v.addr_space, v.theProfile.abstract_types,\ ['new_utsname', 'sysname'], system_utsname.offset) version = read_null_string(v.addr_space, v.theProfile.abstract_types,\ ['new_utsname', 'version'], system_utsname.offset) machine = read_null_string(v.addr_space, v.theProfile.abstract_types,\ ['new_utsname', 'machine'], system_utsname.offset) domainname = read_null_string(v.addr_space, v.theProfile.abstract_types,\ ['new_utsname', 'domainname'], system_utsname.offset) tmp.row("CPUS", num_cpus, **{'class': 'explain'}) tmp.row("GMTDATE", time, **{'class': 'explain'}) tmp.row( "TIMEZONE", "GMT -%d (minutes west: %d dsttime: %d)" % (tz_hours, tz_minuteswest, tz_dsttime), **{'class': 'explain'}) tmp.row("RELEASE", release, **{'class': 'explain'}) tmp.row("NODENAME", nodename, **{'class': 'explain'}) tmp.row("SYSNAME", sysname, **{'class': 'explain'}) tmp.row("VERSION", version, **{'class': 'explain'}) tmp.row("MACHINE", machine, **{'class': 'explain'}) tmp.row("DOMAINNAME", domainname, **{'class': 'explain'}) result.row("Linux Memory Image", tmp, **{'class': 'explainrow'})
def execute(self): (profile, addr_space, symtab, types) = linux_load_and_identify_image( \ self.op, self.opts) theProfile = Profile(abstract_types=profile) # Get system time timespec = info_systime(addr_space, theProfile, symtab) tv_sec = timespec.tv_sec time = self.format_time(tv_sec) # Get timezone information sys_tz = info_timezone(addr_space, theProfile, symtab) tz_minuteswest = sys_tz.tz_minuteswest tz_hours = tz_minuteswest / 60 tz_dsttime = sys_tz.tz_dsttime # Get the number of cpus num_cpus = info_cpus(addr_space, theProfile, symtab) # Get utsname info system_utsname = info_system_utsname(addr_space, theProfile, symtab) if not system_utsname: print "Cannot access uts information" return release = read_null_string(addr_space, theProfile.abstract_types,\ ['new_utsname', 'release'], system_utsname.offset) nodename = read_null_string(addr_space, theProfile.abstract_types,\ ['new_utsname', 'nodename'], system_utsname.offset) sysname = read_null_string(addr_space, theProfile.abstract_types,\ ['new_utsname', 'sysname'], system_utsname.offset) version = read_null_string(addr_space, theProfile.abstract_types,\ ['new_utsname', 'version'], system_utsname.offset) machine = read_null_string(addr_space, theProfile.abstract_types,\ ['new_utsname', 'machine'], system_utsname.offset) domainname = read_null_string(addr_space, theProfile.abstract_types,\ ['new_utsname', 'domainname'], system_utsname.offset) print "%-11s: %s" % ("DUMPFILE", self.opts.filename) print "%-11s: %d" % ("CPUS", num_cpus) print "%-11s: %s" % ("GMTDATE", time) print "%-11s: %s" % ("TIMEZONE", "GMT -%d (minutes west: %d dsttime: %d)" % (tz_hours, tz_minuteswest, tz_dsttime)) print "%-11s: %s" % ("RELEASE", release) print "%-11s: %s" % ("NODENAME", nodename) print "%-11s: %s" % ("SYSNAME", sysname) print "%-11s: %s" % ("VERSION", version) print "%-11s: %s" % ("MACHINE", machine) print "%-11s: %s" % ("DOMAINNAME", domainname)
def execute(self): (profile, addr_space, symtab, types) = linux_load_and_identify_image( \ self.op, self.opts) theProfile = Profile(abstract_types=profile) # Get system time timespec = info_systime(addr_space, theProfile, symtab) tv_sec = timespec.tv_sec time = self.format_time(tv_sec) # Get timezone information sys_tz = info_timezone(addr_space, theProfile, symtab) tz_minuteswest = sys_tz.tz_minuteswest tz_hours = tz_minuteswest/60 tz_dsttime = sys_tz.tz_dsttime # Get the number of cpus num_cpus = info_cpus(addr_space, theProfile, symtab) # Get utsname info system_utsname = info_system_utsname(addr_space, theProfile, symtab) if not system_utsname: print "Cannot access uts information" return release = read_null_string(addr_space, theProfile.abstract_types,\ ['new_utsname', 'release'], system_utsname.offset) nodename = read_null_string(addr_space, theProfile.abstract_types,\ ['new_utsname', 'nodename'], system_utsname.offset) sysname = read_null_string(addr_space, theProfile.abstract_types,\ ['new_utsname', 'sysname'], system_utsname.offset) version = read_null_string(addr_space, theProfile.abstract_types,\ ['new_utsname', 'version'], system_utsname.offset) machine = read_null_string(addr_space, theProfile.abstract_types,\ ['new_utsname', 'machine'], system_utsname.offset) domainname = read_null_string(addr_space, theProfile.abstract_types,\ ['new_utsname', 'domainname'], system_utsname.offset) print "%-11s: %s"%("DUMPFILE",self.opts.filename) print "%-11s: %d"%("CPUS",num_cpus) print "%-11s: %s"%("GMTDATE",time) print "%-11s: %s"%("TIMEZONE","GMT -%d (minutes west: %d dsttime: %d)"%(tz_hours,tz_minuteswest,tz_dsttime)) print "%-11s: %s"%("RELEASE",release) print "%-11s: %s"%("NODENAME",nodename) print "%-11s: %s"%("SYSNAME",sysname) print "%-11s: %s"%("VERSION",version) print "%-11s: %s"%("MACHINE",machine) print "%-11s: %s"%("DOMAINNAME",domainname)
def explain(self, query, result): self.fd.explain(query,result) tmp = result.__class__(result) v=self.get_vol_object() # Get system time timespec = info_systime(v.addr_space, v.theProfile, v.symtable) tv_sec = timespec.tv_sec time = self.format_time(tv_sec) # Get timezone information sys_tz = info_timezone(v.addr_space, v.theProfile, v.symtable) tz_minuteswest = sys_tz.tz_minuteswest tz_hours = tz_minuteswest/60 tz_dsttime = sys_tz.tz_dsttime # Get the number of cpus num_cpus = info_cpus(v.addr_space, v.theProfile, v.symtable) # Get utsname info system_utsname = info_system_utsname(v.addr_space, v.theProfile, v.symtable) if not system_utsname: print "Cannot access uts information" return release = read_null_string(v.addr_space, v.theProfile.abstract_types,\ ['new_utsname', 'release'], system_utsname.offset) nodename = read_null_string(v.addr_space, v.theProfile.abstract_types,\ ['new_utsname', 'nodename'], system_utsname.offset) sysname = read_null_string(v.addr_space, v.theProfile.abstract_types,\ ['new_utsname', 'sysname'], system_utsname.offset) version = read_null_string(v.addr_space, v.theProfile.abstract_types,\ ['new_utsname', 'version'], system_utsname.offset) machine = read_null_string(v.addr_space, v.theProfile.abstract_types,\ ['new_utsname', 'machine'], system_utsname.offset) domainname = read_null_string(v.addr_space, v.theProfile.abstract_types,\ ['new_utsname', 'domainname'], system_utsname.offset) tmp.row("CPUS",num_cpus,**{'class': 'explain'}) tmp.row("GMTDATE",time,**{'class': 'explain'}) tmp.row("TIMEZONE","GMT -%d (minutes west: %d dsttime: %d)"%(tz_hours,tz_minuteswest,tz_dsttime),**{'class': 'explain'}) tmp.row("RELEASE",release,**{'class': 'explain'}) tmp.row("NODENAME",nodename,**{'class': 'explain'}) tmp.row("SYSNAME",sysname,**{'class': 'explain'}) tmp.row("VERSION",version,**{'class': 'explain'}) tmp.row("MACHINE",machine,**{'class': 'explain'}) tmp.row("DOMAINNAME",domainname,**{'class': 'explain'}) result.row("Linux Memory Image", tmp,**{'class': 'explainrow'})
def execute(self): (profile, addr_space, symtab, types) = linux_load_and_identify_image( \ self.op, self.opts) theProfile = Profile(abstract_types=profile) timespec = info_systime(addr_space, theProfile, symtab) tv_sec = timespec.tv_sec time = self.format_time(tv_sec) print "Sample local date and time: %s"%time sys_tz = info_timezone(addr_space, theProfile, symtab) tz_minuteswest = sys_tz.tz_minuteswest tz_hours = tz_minuteswest/60 tz_dsttime = sys_tz.tz_dsttime print "Kernel timezone: GMT -%d (minutes west: %d dsttime: %d)\n"%(tz_hours,tz_minuteswest,tz_dsttime)
def execute(self): (profile, addr_space, symtab, types) = linux_load_and_identify_image( \ self.op, self.opts) theProfile = Profile(abstract_types=profile) timespec = info_systime(addr_space, theProfile, symtab) tv_sec = timespec.tv_sec time = self.format_time(tv_sec) print "Sample local date and time: %s" % time sys_tz = info_timezone(addr_space, theProfile, symtab) tz_minuteswest = sys_tz.tz_minuteswest tz_hours = tz_minuteswest / 60 tz_dsttime = sys_tz.tz_dsttime print "Kernel timezone: GMT -%d (minutes west: %d dsttime: %d)\n" % ( tz_hours, tz_minuteswest, tz_dsttime)