awslabs / damo

DAMON user-space tool
https://damonitor.github.io/
GNU General Public License v2.0
148 stars 28 forks source link

NameError: name '_dmo_fmt_str' is not defined. Did you mean: '_damo_fmt_str'? #80

Closed honggyukim closed 9 months ago

honggyukim commented 9 months ago

Hi SeongJae,

I see an error while running damo show as follows.

$ sudo ./damo show
Traceback (most recent call last):
  File "/home/honggyu/work/damo/./damo", line 112, in <module>
    main()
  File "/home/honggyu/work/damo/./damo", line 109, in main
    subcmd.execute(args)
  File "/home/honggyu/work/damo/_damo_subcmds.py", line 34, in execute
    self.module.main(args)
  File "/home/honggyu/work/damo/damo_show.py", line 704, in main
    pr_records(args, records)
  File "/home/honggyu/work/damo/damo_show.py", line 450, in pr_records
    format_pr(args.format_record_head, record_formatters,
  File "/home/honggyu/work/damo/damo_show.py", line 369, in format_pr
    txt = formatter.format_fn(record, raw)
  File "/home/honggyu/work/damo/damo_show.py", line 46, in <lambda>
    _dmo_fmt_str.format_ns(record.snapshots[0].start_time, raw),
NameError: name '_dmo_fmt_str' is not defined. Did you mean: '_damo_fmt_str'?

Could you please have a look? Thanks.

sj-aws commented 9 months ago

Hi Honggyu,

Thank you for this report. I was able to reproduce this issue via sudo ./damo start && sudo ./damo show --foramt_record_head "<abs start time>". The issue was not found since the tests doesn't have the test case for this. I'll try to make it soon. The fix has made and pushed as commit b9f1f16.

sj-aws commented 9 months ago

The above commit[1] should handle the testing of this case.

[1] https://github.com/awslabs/damo/commit/b0e2d64bec6f3e0b470617a266a01e0f7a894632

honggyukim commented 9 months ago

Hi SeongJae, thanks very much for the quick fix!