Initial overhaul of Analyze mode. Basic CLI is enabled.
Signed-off-by: colramos-amd <colramos@amd.com>
This commit is contained in:
zatwierdzone przez
Karl W. Schulz
rodzic
98b18d9f39
commit
57a63b6eb1
@@ -22,21 +22,60 @@
|
||||
# SOFTWARE.
|
||||
##############################################################################el
|
||||
|
||||
import logging
|
||||
from omniperf_analyze.analysis_base import OmniAnalyze_Base
|
||||
from utils.utils import demarcate
|
||||
from utils import file_io, parser, tty
|
||||
from utils.csv_processor import kernel_name_shortener
|
||||
|
||||
class cli_analysis(OmniAnalyze_Base):
|
||||
|
||||
#-----------------------
|
||||
# Required child methods
|
||||
#-----------------------
|
||||
@demarcate
|
||||
def pre_processing(self):
|
||||
def pre_processing(self, omni_soc):
|
||||
"""Perform any pre-processing steps prior to analysis.
|
||||
"""
|
||||
logging.debug("[analysis] prepping to do some analysis")
|
||||
super().pre_processing(omni_soc)
|
||||
if self.get_args().random_port:
|
||||
self.error("--gui flag is required to enable --random-port")
|
||||
for d in self.get_args().path:
|
||||
# demangle and overwrite original 'KernelName'
|
||||
kernel_name_shortener(d[0], self.get_args().kernel_verbose)
|
||||
|
||||
file_io.create_df_kernel_top_stats(
|
||||
d[0],
|
||||
self._runs[d[0]].filter_gpu_ids,
|
||||
self._runs[d[0]].filter_dispatch_ids,
|
||||
self.get_args().time_unit,
|
||||
self.get_args().max_kernel_num
|
||||
)
|
||||
# create 'mega dataframe'
|
||||
self._runs[d[0]].raw_pmc = file_io.create_df_pmc(
|
||||
d[0], self.get_args().verbose
|
||||
)
|
||||
is_gui = False
|
||||
# create the loaded table
|
||||
parser.load_table_data(
|
||||
self._runs[d[0]], d[0], is_gui, self.get_args().g, self.get_args().verbose
|
||||
)
|
||||
|
||||
|
||||
@demarcate
|
||||
def run_analysis(self):
|
||||
"""Run CLI analysis.
|
||||
"""
|
||||
logging.debug("[analysis] check out this wicked cli ascii art")
|
||||
if self.get_args().list_kernels:
|
||||
tty.show_kernels(
|
||||
self.get_args(),
|
||||
self._runs,
|
||||
self._arch_configs[self._runs[self.get_args().path[0][0]].sys_info.iloc[0]["gpu_soc"]],
|
||||
self._output
|
||||
)
|
||||
else:
|
||||
tty.show_all(
|
||||
self.get_args(),
|
||||
self._runs,
|
||||
self._arch_configs[self._runs[self.get_args().path[0][0]].sys_info.iloc[0]["gpu_soc"]],
|
||||
self._output
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user