Lines Matching +full:bootloader +full:- +full:key

2 # SPDX-License-Identifier: GPL-2.0-only
25 # ----------------- LIBRARIES --------------------
42 # ----------------- CLASSES --------------------
46 # A global, single-instance container used to
69 bootloader = 'grub' variable in SystemValues
73 self.testtime = datetime.now().strftime('%Y-%m-%d_%H:%M:%S')
78 self.testdir = datetime.now().strftime('boot-%y%m%d-%H%M%S')
85 m = re.match(r'^(?P<x>[0-9]*)\.(?P<y>[0-9]*)\.(?P<z>[0-9]*).*', self.kernel)
99 'trace_options=nooverwrite,funcgraph-abstime,funcgraph-cpu,'\
100 'funcgraph-duration,funcgraph-proc,funcgraph-tail,'\
101 'nofuncgraph-overhead,context-info,graph-time '\
115 doError('loadable module functions not allowed - "%s"' % func)
117 doError('spaces found in filter functions - "%s"' % func)
141 if 'bootgraph' in line or 'analyze_boot.py' in line or '-cronjob' in line:
145 cmdline = '%s -cronjob' % os.path.abspath(sys.argv[0])
148 if arg in ['-h', '-v', '-cronjob', '-reboot', '-verbose']:
150 elif arg in ['-o', '-dmesg', '-ftrace', '-func']:
153 elif arg == '-result':
156 elif arg == '-cgskip':
162 cmdline += ' -func "%s"' % self.graph_filter
163 cmdline += ' -o "%s"' % os.path.abspath(self.testdir)
170 …'3. After reboot, re-run this tool with the same arguments but no command (w/o -reboot or -manual)…
175 for cmd in ['update-grub', 'grub-mkconfig', 'grub2-mkconfig']:
189 if 'update-grub' in blcmd:
192 self.blexec = [blcmd, '-o', cfg]
194 if self.bootloader == 'grub':
197 doError('unknown boot loader: %s' % self.bootloader)
230 'kernel': {'list': dict(), 'start': -1.0, 'end': -1.0, 'row': 0,
231 'order': 0, 'color': 'linear-gradient(to bottom, #fff, #bcf)'},
232 'user': {'list': dict(), 'start': -1.0, 'end': -1.0, 'row': 0,
242 length = -1.0
244 length = end - start
255 if cg.end - cg.start == 0:
283 sysvals.vprint('%9s mode: %.3f - %.3f (%d initcalls)' % (phase,
287 # ----------------- FUNCTIONS --------------------
327 m = re.match(r'[ \t]*(\[ *)(?P<ktime>[0-9\.]*)(\]) (?P<msg>.*)', line)
339 m = re.match(r'.* setting system clock to (?P<d>[0-9\-]*)[ A-Z](?P<t>[0-9:]*) UTC.*', msg)
341 bt = datetime.strptime(m.group('d')+' '+m.group('t'), '%Y-%m-%d %H:%M:%S')
342 bt = bt - timedelta(seconds=int(ktime))
343 data.boottime = bt.strftime('%Y-%m-%d_%H:%M:%S')
346 m = re.match(r'^calling *(?P<f>.*)\+.* @ (?P<p>[0-9]*)', msg)
388 cgfilter.append([list[i]['start']-0.0001,
421 key = (m_proc, pid)
422 if(key not in ftemp):
423 ftemp[key] = []
424 ftemp[key].append(aslib.FTraceCallGraph(pid, sysvals))
425 cg = ftemp[key][-1]
428 ftemp[key].append(aslib.FTraceCallGraph(pid, sysvals))
429 if(res == -1):
430 ftemp[key][-1].addLine(t)
435 for key in ftemp:
436 proc, pid = key
437 for cg in ftemp[key]:
438 if len(cg.list) < 1 or cg.invalid or (cg.end - cg.start == 0):
441 pprint('Sanity check failed for %s-%d' % (proc, pid))
449 sysvals.vprint('%s callgraph found for %s %s-%d [%f - %f]' %\
521 …{5}" class="srccall" style="left:{1}%;top:{2}px;height:{3}px;width:{4}%;line-height:{3}px;">{0}</d…
536 tTotal = tMax - t0
559 length = phase['end']-phase['start']
560 left = '%.3f' % (((phase['start']-t0)*100.0)/tTotal)
580 left = '%.6f' % (((dev['start']-t0)*100)/tTotal)
581 width = '%.6f' % (((dev['end']-dev['start'])*100)/tTotal)
582 length = ' (%0.3f ms) ' % ((dev['end']-dev['start'])*1000)
596 left = '%f' % (((l.time-t0)*100)/tTotal)
606 left = '%f' % (((cg.start-t0)*100)/tTotal)
607 width = '%f' % ((cg.end-cg.start)*100/tTotal)
608 cglen = (cg.end - cg.start) * 1000.0
646 .vt {transform:rotate(-60deg);transform-origin:0 0;}\n\
647 table.fstat {table-layout:fixed;padding:150px 15px 0 0;font-size:10px;column-width:30px;}\n\
649 .fstat td {text-align:left;width:35px;}\n\
650 …font-size:10px;z-index:7;overflow:hidden;color:black;text-align:center;white-space:nowrap;border-r…
651 .srccall:hover {color:white;font-weight:bold;border:1px solid white;}\n'
663 for f in sorted(funcs, key=lambda k:(funcs[k], k), reverse=True):
715 backfile = crondir+'root-analyze_boot-backup'
731 res = -1
746 res = -1
754 # call update-grub on restore
769 res = -1
781 if line[-1] == '\\':
785 if line[-1] != '\\':
808 res = -1
820 if sysvals.bootloader == 'grub':
850 ' Generates output files in subdirectory: boot-yymmdd-HHMMSS\n'\
856 ' -h Print this help text\n'\
857 ' -v Print the current tool version\n'\
858 ' -verbose Print extra information during execution and analysis\n'\
859 ' -addlogs Add the dmesg log to the html output\n'\
860 ' -result fn Export a results table to a text file for parsing.\n'\
861 ' -o name Overrides the output subdirectory name when running a new test\n'\
862 ' default: boot-{date}-{time}\n'\
864 ' -fstat Use ftrace to add function detail and statistics (default: disabled)\n'\
865 ' -f/-callgraph Add callgraph detail, can be very large (default: disabled)\n'\
866 ' -maxdepth N limit the callgraph data to N call levels (default: 2)\n'\
867 ' -mincg ms Discard all callgraphs shorter than ms milliseconds (e.g. 0.001 for us)\n'\
868 ' -timeprec N Number of significant digits in timestamps (0:S, 3:ms, [6:us])\n'\
869 ' -expandcg pre-expand the callgraph data in the html output (default: disabled)\n'\
870 ' -func list Limit ftrace to comma-delimited list of functions (default: do_one_initcall)\n'\
871 ' -cgfilter S Filter the callgraph output in the timeline\n'\
872 ' -cgskip file Callgraph functions to skip, off to disable (default: cgskip.txt)\n'\
873 ' -bl name Use the following boot loader for kernel params (default: grub)\n'\
874 ' -reboot Reboot the machine automatically and generate a new timeline\n'\
875 ' -manual Show the steps to generate a new timeline manually (used with -reboot)\n'\
878 ' -flistall Print all functions capable of being captured in ftrace\n'\
879 ' -sysinfo Print out system info extracted from BIOS\n'\
880 ' -which exec Print an executable path, should function even without PATH\n'\
882 ' -dmesg file Create HTML output using dmesg input (used with -ftrace)\n'\
883 ' -ftrace file Create HTML output using ftrace input (used with -dmesg)\n'\
887 # ----------------- MAIN --------------------
894 simplecmds = ['-sysinfo', '-kpupdate', '-flistall', '-checkbl']
896 if '-f' in sys.argv:
901 if(arg == '-h'):
904 elif(arg == '-v'):
907 elif(arg == '-verbose'):
911 elif(arg == '-fstat'):
913 elif(arg == '-callgraph' or arg == '-f'):
916 elif(arg == '-cgdump'):
918 elif(arg == '-mincg'):
919 sysvals.mincglen = aslib.getArgFloat('-mincg', args, 0.0, 10000.0)
920 elif(arg == '-cgfilter'):
926 elif(arg == '-cgskip'):
937 elif(arg == '-bl'):
944 sysvals.bootloader = val.lower()
945 elif(arg == '-timeprec'):
946 sysvals.setPrecision(aslib.getArgInt('-timeprec', args, 0, 6))
947 elif(arg == '-maxdepth'):
949 sysvals.max_graph_depth = aslib.getArgInt('-maxdepth', args, 0, 1000)
950 elif(arg == '-func'):
959 elif(arg == '-ftrace'):
968 elif(arg == '-addlogs'):
970 elif(arg == '-expandcg'):
972 elif(arg == '-dmesg'):
981 elif(arg == '-o'):
987 elif(arg == '-result'):
993 elif(arg == '-reboot'):
995 elif(arg == '-manual'):
999 elif(arg == '-cronjob'):
1001 elif(arg == '-which'):
1018 doError('-cronjob is meant for batch purposes only')
1020 doError('-reboot and -dmesg/-ftrace are incompatible')
1037 pprint('Boot Loader: %s\n%s' % (sysvals.bootloader, sysvals.blexec))
1098 cmd = 'chown -R {0}:{0} {1} > /dev/null 2>&1'
1101 sysvals.stamp['boot'] = (data.tUserMode - data.start) * 1000