Lines Matching +full:add +full:- +full:to +full:- +full:path
18 'lspci -vvnn',
19 'gcc --version',
20 'ld --version',
26 'dlcservice_util --list',
76 path = os.path.join(logdir, self.logf)
77 if os.path.exists(path):
78 return utils.read_one_line(path)
93 def __init__(self, path, logf=None, log_in_keyval=False): argument
95 logf = os.path.basename(path)
97 self.path = path
102 r %= (self.path, self.logf, self.log_in_keyval)
108 return (self.path, self.logf) == (other.path, other.logf)
122 return hash((self.path, self.logf))
126 """Copies the log file or directory to the specified directory.
130 if os.path.exists(self.path):
131 if os.path.isdir(self.path):
132 dst = os.path.join(logdir, self.logf, self.path.lstrip('/'))
133 dir_util.copy_tree(self.path, dst)
135 dst = os.path.join(logdir, self.logf)
136 shutil.copyfile(self.path, dst)
137 logging.debug('Loggable saves logs to %s', dst)
148 self.cmd += ' | gzip -9'
183 if "PATH" not in env:
184 env["PATH"] = "/usr/bin:/bin"
185 logf_path = os.path.join(logdir, self.logf)
207 # pull in the post-test logs to collect
210 self.test_loggables.add(command(cmd))
212 self.test_loggables.add(logfile(filename))
214 # pull in the EXTRA post-boot logs to collect
217 self.boot_loggables.add(command(cmd))
219 self.boot_loggables.add(logfile(filename))
221 # pull in the pre test iteration logs to collect
224 self.before_iteration_loggables.add(
227 self.before_iteration_loggables.add(
228 logfile(fname, logf=os.path.basename(fname) + '.before'))
230 # pull in the post test iteration logs to collect
233 self.after_iteration_loggables.add(
236 self.after_iteration_loggables.add(
237 logfile(fname, logf=os.path.basename(fname) + '.after'))
239 # add in a couple of extra files and commands we want to grab
240 self.test_loggables.add(command("df -mP", logf="df"))
244 self.test_loggables.add(command('dmesg -c',
247 self.boot_loggables.add(logfile('/proc/cmdline', log_in_keyval=True))
250 self.boot_loggables.add(logfile('/proc/mounts', logf='proc_mounts'))
251 self.boot_loggables.add(command('uname -a',
256 self.boot_loggables.add(
257 command('cat /sys/bus/cpu/devices/cpu*/cpufreq/scaling_driver | sort -u',
258 logf='scaling-driver',
260 self.boot_loggables.add(
261 command('cat /sys/bus/cpu/devices/cpu*/cpufreq/scaling_governor | sort -u',
262 logf='scaling-governor',
265 self.boot_loggables.add(
267 logf='scaling-governor-ondemand-powersave-bias',
271 self.boot_loggables.add(command('tree /var/cache/dlc',
273 self.boot_loggables.add(command(
274 'tree /mnt/stateful_partition/var_overlay/cache/dlc-images',
290 @param serialized: A dictionary containing parameters to store as
299 sysinfodir = os.path.join(resultsdir, "sysinfo")
300 if not os.path.exists(sysinfodir):
306 if not glob.glob(os.path.join(self.sysinfodir, "*")):
307 return -1
309 return len(glob.glob(os.path.join(self.sysinfodir, "boot.*")))
319 boot_dir = "boot.%d" % (reboot_count - 1)
320 return os.path.join(self.sysinfodir, boot_dir)
326 logdir = os.path.join(self._get_sysinfodir(test.outputdir), iter_dir)
327 if not os.path.exists(logdir):
332 @log.log_and_ignore_errors("post-reboot sysinfo error:")
336 if not os.path.exists(logdir):
344 installed_path = os.path.join(logdir, "installed_packages")
349 @log.log_and_ignore_errors("pre-test sysinfo error:")
356 if os.path.exists("/var/log/messages"):
366 # We want to only log the entries from this point on, not everything.
368 # extremely large and take a very long amount of time to compress.
370 self.test_loggables.add(command((
371 '/usr/sbin/croslog --output=export --cursor="{}"'.format(self._system_log_cursor)),
372 logf='unified-log',
376 self.test_loggables.add(command((
377 'journalctl -o export -c "{}"'.format(self._journal_cursor)),
387 @log.log_and_ignore_errors("post-test sysinfo error:")
395 # create a symlink in the test sysinfo dir to the current boot
397 assert os.path.exists(reboot_dir)
398 symlink_dest = os.path.join(test_sysinfodir, "reboot_current")
400 os.path.dirname(symlink_dest))
404 raise Exception('%s: whilst linking %s to %s' % (e, symlink_src,
417 # log any changes to installed packages
420 added_path = os.path.join(test_sysinfodir, "added_packages")
421 added_packages = "\n".join(new_packages - old_packages) + "\n"
423 removed_path = os.path.join(test_sysinfodir, "removed_packages")
424 removed_packages = "\n".join(old_packages - new_packages) + "\n"
428 @log.log_and_ignore_errors("pre-test siteration sysinfo error:")
448 @log.log_and_ignore_errors("post-test siteration sysinfo error:")
474 out_messages = open(os.path.join(logdir, "messages"), "w")
487 keyval["sysinfo-" + log.logf] = log.readline(logdir)
494 Collects keyval entries to be written in the test keyval.
504 self.boot_loggables, os.path.join(test_sysinfodir,
508 # Linux lpt36 2.6.18-smp-230.1 #1 [4069269] SMP Fri Oct 24 11:30:...
509 if "sysinfo-uname" in keyval:
510 kernel_vers = " ".join(keyval["sysinfo-uname"].split()[2:])
511 keyval["sysinfo-uname"] = kernel_vers
514 path = os.path.join(test_sysinfodir, "reboot_current", "meminfo")
515 if os.path.exists(path):
516 mem_data = open(path).read()
519 keyval["sysinfo-memtotal-in-kb"] = match.group(1)
522 keyval["sysinfo-phys-mbytes"] = utils.rounded_memtotal()//1024
534 @param output_dir: Path to the output directory.
541 'Failed to collect loggable %r to %s. Continuing...',
546 cmd = "/usr/bin/journalctl -n0 --show-cursor -q"
549 prefix = "-- cursor: "
553 logging.error("error running journalctl --show-cursor: %s", e)
556 if not os.path.exists("/usr/sbin/croslog"):
559 cmd = "/usr/sbin/croslog --lines=0 --show-cursor --quiet"
562 prefix = "-- cursor: "
566 logging.error("error running croslog --show-cursor: %s", e)