Lines Matching +full:in +full:- +full:line
2 # SPDX-License-Identifier: GPL-2.0-only
20 the kernel command line option "time" is specified. When run with no
22 each printk line and the next. When run with the '-b' option, all times
23 are relative to a single (base) point in time.
26 -h Show this usage help.
27 -b <base> Specify a base for time references.
29 If it is a string, the first message line
31 line) is used as the time reference.
34 $ show_delta -b NET4 timefile
36 will show times relative to the line in the kernel output
41 # returns a tuple containing the seconds and text for each message line
44 def get_time(line): argument
45 if line[0]!="[":
49 (time_str, rest) = string.split(line[1:],']',1)
56 # average line looks like:
58 # time data is expressed in seconds.useconds,
59 # convert_line adds a delta for each line
61 def convert_line(line, base_time): argument
65 (time, rest) = get_time(line)
68 return line
72 delta = time - base_time
74 # just show time from last line
75 delta = time - last_time
83 for arg in sys.argv[1:]:
84 if arg=="-b":
85 base_str = sys.argv[sys.argv.index("-b")+1]
86 elif arg=="-h":
103 # for a matching line.
107 # search for line matching <base> string
109 for line in lines:
111 (time, rest) = get_time(line)
120 print ('Couldn\'t find line matching base pattern "%s"' % base_str)
125 for line in lines:
126 print (convert_line(line, base_time),)