amd-debug-tools 0.2.2__py3-none-any.whl → 0.2.4__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of amd-debug-tools might be problematic. Click here for more details.

amd_debug/sleep_report.py CHANGED
@@ -5,6 +5,7 @@ import os
5
5
  import re
6
6
  import math
7
7
  from datetime import datetime, timedelta
8
+ import numpy as np
8
9
  from tabulate import tabulate
9
10
  from jinja2 import Environment, FileSystemLoader
10
11
  import pandas as pd
@@ -73,6 +74,8 @@ def format_percent(val):
73
74
 
74
75
  def format_timedelta(val):
75
76
  """Format seconds as a nicer format"""
77
+ if math.isnan(val):
78
+ val = 0
76
79
  return str(timedelta(seconds=val))
77
80
 
78
81
 
@@ -97,8 +100,23 @@ class SleepReport(AmdTool):
97
100
  self.debug = report_debug
98
101
  self.format = fmt
99
102
  self.failures = []
100
- self.df = self.db.report_summary_dataframe(self.since, self.until)
101
- self.pre_process_dataframe()
103
+ if since and until:
104
+ self.df = self.db.report_summary_dataframe(self.since, self.until)
105
+ self.pre_process_dataframe()
106
+ else:
107
+ self.df = pd.DataFrame(
108
+ columns=[
109
+ "t0",
110
+ "t1",
111
+ "requested",
112
+ "hw",
113
+ "b0",
114
+ "b1",
115
+ "full",
116
+ "wake_irq",
117
+ "gpio",
118
+ ]
119
+ )
102
120
  self.battery_svg = None
103
121
  self.hwsleep_svg = None
104
122
 
@@ -136,6 +154,7 @@ class SleepReport(AmdTool):
136
154
  self.df["Duration"] = self.df["t1"].apply(format_as_seconds) - self.df[
137
155
  "t0"
138
156
  ].apply(format_as_seconds)
157
+ self.df["Duration"] = self.df["Duration"].replace(0, np.nan)
139
158
  self.df["Hardware Sleep"] = (self.df["hw"] / self.df["Duration"]).apply(
140
159
  parse_hw_sleep
141
160
  )
@@ -187,7 +206,8 @@ class SleepReport(AmdTool):
187
206
  format_watts
188
207
  )
189
208
 
190
- def convert_gpio_dataframe(self, content):
209
+ def convert_table_dataframe(self, content):
210
+ """Convert a table like dataframe to an HTML table"""
191
211
  header = False
192
212
  rows = []
193
213
  for line in content.split("\n"):
@@ -196,17 +216,25 @@ class SleepReport(AmdTool):
196
216
  if header:
197
217
  continue
198
218
  header = True
219
+ line = line.strip("│")
220
+ line = line.replace("├─", "└─")
199
221
  if "|" in line:
200
222
  # first column missing '|'
201
223
  rows.append(line.replace("\t", "|"))
202
224
  columns = [row.split("|") for row in rows]
203
225
  df = pd.DataFrame(columns[1:], columns=columns[0])
204
- return df.to_html(index=False, table_id="gpio")
226
+ return df.to_html(index=False, justify="center", col_space=30)
205
227
 
206
228
  def get_prereq_data(self):
207
229
  """Get the prereq data"""
208
230
  prereq = []
209
231
  prereq_debug = []
232
+ tables = [
233
+ "int|active",
234
+ "ACPI name",
235
+ "PCI Slot",
236
+ "DMI|value",
237
+ ]
210
238
  ts = self.db.get_last_prereq_ts()
211
239
  if not ts:
212
240
  return [], "", []
@@ -216,23 +244,24 @@ class SleepReport(AmdTool):
216
244
  if self.debug:
217
245
  for row in self.db.report_debug(t0):
218
246
  content = row[0]
219
- if self.format == "html" and "int|active" in content:
220
- content = self.convert_gpio_dataframe(content)
221
- prereq_debug.append(
222
- {"data": "{message}".format(message=content.strip())}
223
- )
247
+ if self.format == "html" and [
248
+ table for table in tables if table in content
249
+ ]:
250
+ content = self.convert_table_dataframe(content)
251
+ prereq_debug.append({"data": f"{content.strip()}"})
224
252
  return prereq, t0, prereq_debug
225
253
 
226
254
  def get_cycle_data(self):
227
255
  """Get the cycle data"""
228
256
  cycles = []
229
257
  debug = []
258
+ tables = ["Wakeup Source"]
230
259
  num = 0
231
260
  for cycle in self.df["Start Time"]:
232
261
  if self.format == "html":
233
262
  data = ""
234
263
  for line in self.db.report_cycle_data(cycle).split("\n"):
235
- data += "<p>{line}</p>".format(line=line)
264
+ data += f"<p>{line}</p>"
236
265
  cycles.append({"cycle_num": num, "data": data})
237
266
  else:
238
267
  cycles.append([num, self.db.report_cycle_data(cycle)])
@@ -240,7 +269,12 @@ class SleepReport(AmdTool):
240
269
  messages = []
241
270
  priorities = []
242
271
  for row in self.db.report_debug(cycle):
243
- messages.append(row[0])
272
+ content = row[0]
273
+ if self.format == "html" and [
274
+ table for table in tables if table in content
275
+ ]:
276
+ content = self.convert_table_dataframe(content)
277
+ messages.append(content)
244
278
  priorities.append(get_log_priority(row[1]))
245
279
  debug.append(
246
280
  {"cycle_num": num, "messages": messages, "priorities": priorities}
@@ -265,58 +299,69 @@ class SleepReport(AmdTool):
265
299
  prereq, prereq_date, prereq_debug = self.get_prereq_data()
266
300
 
267
301
  # Load the cycle and/or debug data
268
- cycles, debug = self.get_cycle_data()
269
-
270
- self.post_process_dataframe()
271
- failures = None
272
- if self.format == "md":
273
- summary = self.df.to_markdown(floatfmt=".02f")
274
- cycle_data = tabulate(cycles, headers=["Cycle", "data"], tablefmt="pipe")
275
- if self.failures:
276
- failures = tabulate(
277
- self.failures,
278
- headers=["Cycle", "Problem", "Explanation"],
279
- tablefmt="pipe",
302
+ if not self.df.empty:
303
+ cycles, debug = self.get_cycle_data()
304
+
305
+ self.post_process_dataframe()
306
+ failures = None
307
+ if self.format == "md":
308
+ summary = self.df.to_markdown(floatfmt=".02f")
309
+ cycle_data = tabulate(
310
+ cycles, headers=["Cycle", "data"], tablefmt="pipe"
280
311
  )
281
- elif self.format == "txt":
282
- summary = tabulate(self.df, headers=self.df.columns, tablefmt="fancy_grid")
283
- cycle_data = tabulate(
284
- cycles, headers=["Cycle", "data"], tablefmt="fancy_grid"
285
- )
286
- if self.failures:
287
- failures = tabulate(
288
- self.failures,
289
- headers=["Cycle", "Problem", "Explanation"],
290
- tablefmt="fancy_grid",
312
+ if self.failures:
313
+ failures = tabulate(
314
+ self.failures,
315
+ headers=["Cycle", "Problem", "Explanation"],
316
+ tablefmt="pipe",
317
+ )
318
+ elif self.format == "txt":
319
+ summary = tabulate(
320
+ self.df, headers=self.df.columns, tablefmt="fancy_grid"
321
+ )
322
+ cycle_data = tabulate(
323
+ cycles, headers=["Cycle", "data"], tablefmt="fancy_grid"
291
324
  )
292
- elif self.format == "html":
293
- summary = ""
294
- row = 0
295
- # we will use javascript to highlight the high values
296
- for line in self.df.to_html(table_id="summary", render_links=True).split(
297
- "\n"
298
- ):
299
- if "<tr>" in line:
300
- line = line.replace(
301
- "<tr>",
302
- '<tr class="row-low" onclick="pick_summary_cycle(%d)">' % row,
325
+ if self.failures:
326
+ failures = tabulate(
327
+ self.failures,
328
+ headers=["Cycle", "Problem", "Explanation"],
329
+ tablefmt="fancy_grid",
303
330
  )
304
- row = row + 1
305
- summary += line
306
- cycle_data = cycles
307
- failures = self.failures
308
- # only show one cycle in stdout output even if we found more
309
- else:
310
- df = self.df.tail(1)
311
- summary = tabulate(
312
- df, headers=self.df.columns, tablefmt="fancy_grid", showindex=False
313
- )
314
- if cycles[-1][0] == df.index.start:
315
- cycle_data = cycles[-1][-1]
331
+ elif self.format == "html":
332
+ summary = ""
333
+ row = 0
334
+ # we will use javascript to highlight the high values
335
+ for line in self.df.to_html(
336
+ table_id="summary", render_links=True
337
+ ).split("\n"):
338
+ if "<tr>" in line:
339
+ line = line.replace(
340
+ "<tr>",
341
+ f'<tr class="row-low" onclick="pick_summary_cycle({row})">',
342
+ )
343
+ row = row + 1
344
+ summary += line
345
+ cycle_data = cycles
346
+ failures = self.failures
347
+ # only show one cycle in stdout output even if we found more
316
348
  else:
317
- cycle_data = None
318
- if self.failures and self.failures[-1][0] == df.index.start:
319
- failures = self.failures[-1][-1]
349
+ df = self.df.tail(1)
350
+ summary = tabulate(
351
+ df, headers=self.df.columns, tablefmt="fancy_grid", showindex=False
352
+ )
353
+ if cycles[-1][0] == df.index.start:
354
+ cycle_data = cycles[-1][-1]
355
+ else:
356
+ cycle_data = None
357
+ if self.failures and self.failures[-1][0] == df.index.start:
358
+ failures = self.failures[-1][-1]
359
+ else:
360
+ cycles = []
361
+ debug = []
362
+ cycle_data = []
363
+ summary = "No sleep cycles found in the database."
364
+ failures = None
320
365
 
321
366
  # let it burn
322
367
  context = {
@@ -333,7 +378,7 @@ class SleepReport(AmdTool):
333
378
  "failures": failures,
334
379
  }
335
380
  if self.fname:
336
- with open(self.fname, "w") as f:
381
+ with open(self.fname, "w", encoding="utf-8") as f:
337
382
  f.write(template.render(context))
338
383
  if "SUDO_UID" in os.environ:
339
384
  os.chown(
@@ -345,30 +390,30 @@ class SleepReport(AmdTool):
345
390
 
346
391
  def build_battery_chart(self):
347
392
  """Build a battery chart using matplotlib and seaborn"""
348
- import matplotlib.pyplot as plt
349
- import seaborn as sns
350
- import io
393
+ import matplotlib.pyplot as plt # pylint: disable=import-outside-toplevel
394
+ import seaborn as sns # pylint: disable=import-outside-toplevel
395
+ import io # pylint: disable=import-outside-toplevel
351
396
 
352
397
  if "Battery Ave Rate" not in self.df.columns:
353
398
  return
354
399
 
355
400
  plt.set_loglevel("warning")
356
- fig, ax1 = plt.subplots()
357
- lns3 = ax1.plot(
401
+ _fig, ax1 = plt.subplots()
402
+ ax1.plot(
358
403
  self.df["Battery Ave Rate"], color="green", label="Charge/Discharge Rate"
359
404
  )
360
405
 
361
406
  ax2 = ax1.twinx()
362
- lns1 = sns.barplot(
407
+ sns.barplot(
363
408
  x=self.df.index,
364
409
  y=self.df["Battery Delta"],
365
410
  color="grey",
366
411
  label="Battery Change",
367
412
  alpha=0.3,
368
413
  )
369
- max = int(len(self.df.index) / 10)
370
- if max:
371
- ax1.set_xticks(range(0, len(self.df.index), max))
414
+ max_range = int(len(self.df.index) / 10)
415
+ if max_range:
416
+ ax1.set_xticks(range(0, len(self.df.index), max_range))
372
417
  ax1.set_xlabel("Cycle")
373
418
  ax1.set_ylabel("Rate (Watts)")
374
419
  ax2.set_ylabel("Battery Change (%)")
@@ -385,20 +430,20 @@ class SleepReport(AmdTool):
385
430
 
386
431
  def build_hw_sleep_chart(self):
387
432
  """Build the hardware sleep chart using matplotlib and seaborn"""
388
- import matplotlib.pyplot as plt
389
- import seaborn as sns
390
- import io
433
+ import matplotlib.pyplot as plt # pylint: disable=import-outside-toplevel
434
+ import seaborn as sns # pylint: disable=import-outside-toplevel
435
+ import io # pylint: disable=import-outside-toplevel
391
436
 
392
437
  plt.set_loglevel("warning")
393
- fig, ax1 = plt.subplots()
394
- lns3 = ax1.plot(
438
+ _fig, ax1 = plt.subplots()
439
+ ax1.plot(
395
440
  self.df["Hardware Sleep"],
396
441
  color="red",
397
442
  label="Hardware Sleep",
398
443
  )
399
444
 
400
445
  ax2 = ax1.twinx()
401
- lns1 = sns.barplot(
446
+ sns.barplot(
402
447
  x=self.df.index,
403
448
  y=self.df["Duration"] / 60,
404
449
  color="grey",
@@ -406,9 +451,9 @@ class SleepReport(AmdTool):
406
451
  alpha=0.3,
407
452
  )
408
453
 
409
- max = int(len(self.df.index) / 10)
410
- if max:
411
- ax1.set_xticks(range(0, len(self.df.index), max))
454
+ max_range = int(len(self.df.index) / 10)
455
+ if max_range:
456
+ ax1.set_xticks(range(0, len(self.df.index), max_range))
412
457
  ax1.set_xlabel("Cycle")
413
458
  ax1.set_ylabel("Percent")
414
459
  ax2.set_yscale("log")
@@ -427,15 +472,13 @@ class SleepReport(AmdTool):
427
472
  def run(self, inc_prereq=True):
428
473
  """Run the report"""
429
474
 
430
- if self.df.empty:
431
- raise ValueError(f"No data found between {self.since} and {self.until}")
432
-
433
475
  characters = print_temporary_message("Building report, please wait...")
434
476
 
435
- # Build charts in the page for html format
436
- if len(self.df.index) > 1 and self.format == "html":
437
- self.build_battery_chart()
438
- self.build_hw_sleep_chart()
477
+ if not self.df.empty:
478
+ # Build charts in the page for html format
479
+ if len(self.df.index) > 1 and self.format == "html":
480
+ self.build_battery_chart()
481
+ self.build_hw_sleep_chart()
439
482
 
440
483
  # Render the template using jinja
441
484
  msg = self.build_template(inc_prereq)
amd_debug/templates/html CHANGED
@@ -42,12 +42,14 @@
42
42
  table,
43
43
  th,
44
44
  td {
45
- border-width: 0;
45
+ border-width: 1;
46
+ border-collapse: collapse;
46
47
  table-layout: fixed;
47
48
  font-family: sans-serif;
48
49
  letter-spacing: 0.02em;
49
50
  color: #000000;
50
- margin-bottom: 10px;
51
+ text-align: left;
52
+ padding: 3px;
51
53
  }
52
54
 
53
55
  .○ {
amd_debug/validator.py CHANGED
@@ -290,13 +290,12 @@ class SleepValidator(AmdTool):
290
290
  sys_name = pnp.sys_name
291
291
 
292
292
  name = name.replace('"', "")
293
- devices.append(f"{name} [{sys_name}]: {wake_en}")
293
+ devices.append(f"{name}|{sys_name}|{wake_en}")
294
294
  devices.sort()
295
- self.db.record_debug("Possible wakeup sources:")
295
+ debug_str = "Wakeup Source|Linux Device|Status\n"
296
296
  for dev in devices:
297
- # set prefix if last device
298
- prefix = "│ " if dev != devices[-1] else "└─"
299
- self.db.record_debug(f"{prefix}{dev}")
297
+ debug_str += f"{dev}\n"
298
+ self.db.record_debug(debug_str)
300
299
 
301
300
  def capture_lid(self) -> None:
302
301
  """Capture lid state"""
@@ -444,11 +443,10 @@ class SleepValidator(AmdTool):
444
443
  """Check for hardware sleep state"""
445
444
  # try from kernel 6.4's suspend stats interface first because it works
446
445
  # even with kernel lockdown
447
- if not self.hw_sleep_duration:
448
- p = os.path.join("/", "sys", "power", "suspend_stats", "last_hw_sleep")
449
- if os.path.exists(p):
450
- self.hw_sleep_duration = int(read_file(p)) / 10**6
451
- if not self.hw_sleep_duration:
446
+ p = os.path.join("/", "sys", "power", "suspend_stats", "last_hw_sleep")
447
+ if os.path.exists(p):
448
+ self.hw_sleep_duration = int(read_file(p)) / 10**6
449
+ if not os.path.exists(p) and not self.hw_sleep_duration:
452
450
  p = os.path.join("/", "sys", "kernel", "debug", "amd_pmc", "smu_fw_info")
453
451
  try:
454
452
  val = read_file(p)
@@ -747,16 +745,18 @@ class SleepValidator(AmdTool):
747
745
  return False
748
746
  else:
749
747
  old = get_wakeup_count()
748
+ p = os.path.join("/", "sys", "power", "state")
749
+ fd = os.open(p, os.O_WRONLY | os.O_SYNC)
750
750
  try:
751
- p = os.path.join("/", "sys", "power", "state")
752
- with open(p, "w", encoding="utf-8") as w:
753
- w.write("mem")
751
+ os.write(fd, b"mem")
754
752
  except OSError as e:
755
753
  new = get_wakeup_count()
756
754
  self.db.record_cycle_data(
757
755
  f"Failed to set suspend state ({old} -> {new}): {e}", "❌"
758
756
  )
759
757
  return False
758
+ finally:
759
+ os.close(fd)
760
760
  return True
761
761
 
762
762
  def unlock_session(self):
@@ -780,6 +780,7 @@ class SleepValidator(AmdTool):
780
780
 
781
781
  def run(self, duration, count, wait, rand, logind):
782
782
  """Run the suspend test"""
783
+ min_duration = 4
783
784
  if not count:
784
785
  return True
785
786
 
@@ -787,8 +788,13 @@ class SleepValidator(AmdTool):
787
788
  self.logind = True
788
789
 
789
790
  if rand:
791
+ if duration <= min_duration:
792
+ print_color(f"Invalid max duration {duration}", "❌")
793
+ self.db.sync()
794
+ self.report_cycle()
795
+ return False
790
796
  print_color(
791
- f"Running {count} cycle random test with max duration of {duration}s and a max wait of {wait}s",
797
+ f"Running {count} cycle random test with min duration of {min_duration}s, max duration of {duration}s and a max wait of {wait}s",
792
798
  "🗣️",
793
799
  )
794
800
  elif count > 1:
@@ -799,7 +805,7 @@ class SleepValidator(AmdTool):
799
805
  )
800
806
  for i in range(1, count + 1):
801
807
  if rand:
802
- self.requested_duration = random.randint(1, duration)
808
+ self.requested_duration = random.randint(min_duration, duration)
803
809
  requested_wait = random.randint(1, wait)
804
810
  else:
805
811
  self.requested_duration = duration
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: amd-debug-tools
3
- Version: 0.2.2
3
+ Version: 0.2.4
4
4
  Summary: debug tools for AMD systems
5
5
  Author-email: Mario Limonciello <superm1@kernel.org>
6
6
  License-Expression: MIT
@@ -0,0 +1,45 @@
1
+ launcher.py,sha256=M8kT9DtyZoQgZaKWDbSBu4jsS6tZF1gWko3sovNVyag,947
2
+ test_acpi.py,sha256=wtS43Rz95h7YEEJBeFa6Mswaeo4syBZrw4hY8i0YbJY,3117
3
+ test_batteries.py,sha256=nN5pfP5El7Whypq3HHEpW8bufdf5EWSTVGbayfNQYP4,3360
4
+ test_bios.py,sha256=ZPqI5X0QpEJBNJP-i5gNZzlbOlVSpznH4uv34esSqD8,8984
5
+ test_common.py,sha256=fb16Oilh5ga6VgF-UgBj6azoYzZnPrS7KpECQ3nCwlg,16335
6
+ test_database.py,sha256=q5ZjI5u20f7ki6iCY5o1iPi0YOvPz1_W0LTDraU8mN4,10040
7
+ test_display.py,sha256=hHggv-zBthF1BlwWWSjzAm7BBw1DWcElwil5xAuz87g,5822
8
+ test_failures.py,sha256=H1UxXeVjhJs9-j9yas4vwAha676GX1Es7Kz8RN2B590,6845
9
+ test_installer.py,sha256=oDMCvaKqqAWjTggltacnasQ-s1gyUvXPDcNrCUGnux4,10216
10
+ test_kernel.py,sha256=RW-eLbae02Bhwfu1cegqA1pTj6AS5IqD5lLe-6T0Rjo,7871
11
+ test_launcher.py,sha256=80xVbidrbx8ixMt_x5Uvfn7nFnB637nX69yIZTifyuk,1511
12
+ test_prerequisites.py,sha256=DiB2SkZJf7OFEta1SifoEHyszuvKOfjs967CsHE6rg4,83244
13
+ test_pstate.py,sha256=a9oAJ9-LANX32XNQhplz6Y75VNYc__QqoSBKIrwvANg,6058
14
+ test_s2idle.py,sha256=YpFGpH84xvjI9mY6uBSKapa74hZnG8ZwBShXsJXpmyQ,33540
15
+ test_sleep_report.py,sha256=ANuxYi_C1oSKAi4xUU2wBu4SwJtcZA7VPpazBe3_WUQ,6922
16
+ test_validator.py,sha256=-MfrWfhwef_aRqOSD_dJGhH0shsghhtOBgzeijzyLW4,33975
17
+ test_wake.py,sha256=6zi5GVFHQKU1sTWw3O5-aGriB9uu5713QLn4l2wjhpM,7152
18
+ amd_debug/__init__.py,sha256=3wZxCDY3KPpfIxMz4vGmp6jUAB2GF4VTK4Xb86vy8c4,1101
19
+ amd_debug/acpi.py,sha256=fkD3Sov8cRT5ryPlakRlT7Z9jiCLT9x_MPWxt3xU_tc,3161
20
+ amd_debug/battery.py,sha256=WN-6ys9PHCZIwg7PdwyBOa62GjBp8WKG0v1YZt5_W5s,3122
21
+ amd_debug/bios.py,sha256=nVIDYqyyKiIO21nyS8lV-qB3ypBJOSIKIuVYFOVoBuw,4017
22
+ amd_debug/common.py,sha256=H9tIRlRFOMwe0d3f2-vXQeK2rJl5Z1WJzkpQM9ivpOc,10347
23
+ amd_debug/database.py,sha256=GkRg3cmaNceyQ2_hy0MBAlMbnTDPHo2co2o4ObWpnQg,10621
24
+ amd_debug/display.py,sha256=5L9x9tI_UoulHpIvuxuVASRtdXta7UCW_JjTb5StEB0,953
25
+ amd_debug/failures.py,sha256=z4O4Q-akv3xYGssSZFCqE0cDE4P9F_aw1hxil3McoD4,22910
26
+ amd_debug/installer.py,sha256=tNWhlfxQEA30guk-fzMvcc237hf_PARVQuHaH3sTp4A,14287
27
+ amd_debug/kernel.py,sha256=UAlxlXNuZxtHVtrfCmTp12YombVaUs4mizOxwuXTX2M,12038
28
+ amd_debug/prerequisites.py,sha256=_SlRzYvWQpZt8VdioOAA2bMt1G9TbNs75swr60Yu1V4,50005
29
+ amd_debug/pstate.py,sha256=lLRsayKi7KOXZCQ6Zjm2pNaobpjLXcgLHXZ9Zt40Fd4,9559
30
+ amd_debug/s2idle-hook,sha256=LLiaqPtGd0qetu9n6EYxKHZaIdHpVQDONdOuSc0pfFg,1695
31
+ amd_debug/s2idle.py,sha256=lr1wcuJcpvI5pL2gNHqrc7n5E7EYCztvaAYYFPMlGYk,13259
32
+ amd_debug/sleep_report.py,sha256=hhqu711AKtjeYF2xmGcejyCyyPtmq4-gC_hROUCrC0g,17317
33
+ amd_debug/validator.py,sha256=-rPqPnYAM1Vevw7vxIbGNPKo1bCRo48IpCBi3Y72-Cw,33419
34
+ amd_debug/wake.py,sha256=xT8WrFrN6voCmXWo5dsn4mQ7iR2QJxHrrYBd3EREG-Q,3936
35
+ amd_debug/bash/amd-s2idle,sha256=g_cle1ElCJpwE4wcLezL6y-BdasDKTnNMhrtzKLE9ks,1142
36
+ amd_debug/templates/html,sha256=JfGhpmHIB2C2GItdGI1kuC8uayqEVgrpQvAWAj35eZ4,14580
37
+ amd_debug/templates/md,sha256=r8X2aehnH2gzj0WHYTZ5K9wAqC5y39i_3nkDORSC0uM,787
38
+ amd_debug/templates/stdout,sha256=hyoOJ96K2dJfnWRWhyCuariLKbEHXvs9mstV_g5aMdI,469
39
+ amd_debug/templates/txt,sha256=nNdsvbPFOhGdL7VA-_4k5aN3nB-6ouGQt6AsWst7T3w,649
40
+ amd_debug_tools-0.2.4.dist-info/licenses/LICENSE,sha256=RBlZI6r3MRGzymI2VDX2iW__D2APDbMhu_Xg5t6BWeo,1066
41
+ amd_debug_tools-0.2.4.dist-info/METADATA,sha256=jzff0ncunf8ZwS6z90_U577R4OEOlZyf3tVtGA8RHsg,6877
42
+ amd_debug_tools-0.2.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
43
+ amd_debug_tools-0.2.4.dist-info/entry_points.txt,sha256=HC11T2up0pPfroAn6Pg5M2jOZXhkWIipToJ1YPTKqu8,116
44
+ amd_debug_tools-0.2.4.dist-info/top_level.txt,sha256=XYjxExbUTEtiIlag_5iQvZSVOC1EIxhKM4NLklReQ0k,234
45
+ amd_debug_tools-0.2.4.dist-info/RECORD,,
launcher.py CHANGED
@@ -28,7 +28,6 @@ def main():
28
28
  f"Missing dependency: {e}\n"
29
29
  f"Run ./install_deps.py to install dependencies."
30
30
  )
31
- return False
32
31
 
33
32
 
34
33
  if __name__ == "__main__":
test_bios.py CHANGED
@@ -194,7 +194,7 @@ class TestAmdBios(unittest.TestCase):
194
194
  mock_amd_bios.assert_called_once_with(None, True)
195
195
  mock_app.set_tracing.assert_called_once_with(True)
196
196
  mock_show_log_info.assert_called_once()
197
- self.assertTrue(result)
197
+ self.assertIsNone(result)
198
198
 
199
199
  @patch("amd_debug.bios.AmdBios")
200
200
  @patch("amd_debug.bios.parse_args")
@@ -217,7 +217,7 @@ class TestAmdBios(unittest.TestCase):
217
217
  mock_amd_bios.assert_called_once_with("test.log", True)
218
218
  mock_app.run.assert_called_once()
219
219
  mock_show_log_info.assert_called_once()
220
- self.assertTrue(result)
220
+ self.assertIsNone(result)
221
221
 
222
222
  @patch("amd_debug.bios.parse_args")
223
223
  @patch("amd_debug.bios.version")
@@ -235,7 +235,7 @@ class TestAmdBios(unittest.TestCase):
235
235
  mock_parse_args.assert_called_once()
236
236
  mock_version.assert_called_once()
237
237
  mock_show_log_info.assert_called_once()
238
- self.assertEqual(result, False)
238
+ self.assertEqual(result, 1)
239
239
 
240
240
  @patch("amd_debug.bios.parse_args")
241
241
  @patch("amd_debug.bios.show_log_info")
@@ -247,4 +247,4 @@ class TestAmdBios(unittest.TestCase):
247
247
 
248
248
  mock_parse_args.assert_called_once()
249
249
  mock_show_log_info.assert_called_once()
250
- self.assertFalse(result)
250
+ self.assertEqual(result, 1)
test_launcher.py CHANGED
@@ -26,10 +26,11 @@ class TestLauncher(unittest.TestCase):
26
26
  """Test launching as unknown exe"""
27
27
 
28
28
  with patch("builtins.print") as mock_print:
29
- amd_debug.launch_tool("unknown_exe.py")
29
+ result = amd_debug.launch_tool("unknown_exe.py")
30
30
  mock_print.assert_called_once_with(
31
31
  "\033[91mUnknown exe: unknown_exe.py\033[0m"
32
32
  )
33
+ self.assertIsNotNone(result)
33
34
 
34
35
  def test_launcher_amd_s2idle(self):
35
36
  """Test launching amd_s2idle"""