Skip to content

Commit 2eaed1b

Browse files
Chris Thompsonfacebook-github-bot
authored andcommitted
Inspector CLI Specify source and Target Timescale (#3761)
Summary: Pull Request resolved: #3761 et pal defines a function which expects "ticks" to be returned as et_timestamp_t. https://www.internalfb.com/code/fbsource/[f8d32ccd3afec7d761b6e04f1809210892973b20]/fbcode/executorch/runtime/platform/platform.h?lines=66 Inspector CLI treats these ticks as "nanoseconds" by default https://www.internalfb.com/code/fbsource/[f8d32ccd3afec7d761b6e04f1809210892973b20]/fbcode/executorch/sdk/inspector/_inspector.py?lines=610 I understand ticks and nanoseconds as different things unless operating processor at 1GHz, but don't necessarily need to change the default in case it breaks some existing workflows. Specifying source/target time scale to the CLI tool would be useful flexibility, though, since I would ultimately like our PAL to return ticks which seems to be original intent. Reviewed By: abhiag-git, tarun292 Differential Revision: D57888750 fbshipit-source-id: d0007abcf1adb5f4ce5acc39a59b0c98f4925ed7
1 parent 757a6ad commit 2eaed1b

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

sdk/inspector/inspector_cli.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import argparse
88

99
from executorch.sdk import Inspector
10-
from executorch.sdk.inspector._inspector_utils import compare_results
10+
from executorch.sdk.inspector._inspector_utils import compare_results, TimeScale
1111

1212

1313
def main() -> None:
@@ -17,6 +17,20 @@ def main() -> None:
1717
required=True,
1818
help="Provide an ETDump file path.",
1919
)
20+
parser.add_argument(
21+
"--source_time_scale",
22+
type=str,
23+
choices=[ts.value for ts in TimeScale],
24+
help="Enter the source time scale (ns, us, ms, s, cycles)",
25+
default=TimeScale.NS.value,
26+
)
27+
parser.add_argument(
28+
"--target_time_scale",
29+
type=str,
30+
choices=[ts.value for ts in TimeScale],
31+
help="Enter the target time scale (ns, us, ms, s, cycles)",
32+
default=TimeScale.MS.value,
33+
)
2034
parser.add_argument(
2135
"--etrecord_path",
2236
required=False,
@@ -35,6 +49,8 @@ def main() -> None:
3549
etdump_path=args.etdump_path,
3650
etrecord=args.etrecord_path,
3751
debug_buffer_path=args.debug_buffer_path,
52+
source_time_scale=TimeScale(args.source_time_scale),
53+
target_time_scale=TimeScale(args.target_time_scale),
3854
)
3955
inspector.print_data_tabular()
4056
if args.compare_results:

0 commit comments

Comments
 (0)