Streamline --list-metrics command line option in rocprof-compute (#310)
* Remove L2 channels from --list-metrics --list-metrics moved to general options List metrics for the current architecture Filter blocks for metrics Removed test for --list-metrics in profile mode Test the options don't throw error Fixed --config-dir error Test stdout for command line options Provide path list for loading panel configs Show L2 Cache (per) channel metrics Changed command line option names Can show two levels only Removed filtering blocks Moved blocks to original position Removed filter block tests Removed filtering Formaating fix Readability enhancement Test formatting Filter L2 channels without sysinfo Show avilable metrics for current arch Intermediate commit Fixed tests Added argument sanitization Added list_metrics to ctest merge iconflict resolution Updated test marker Updated changelog Fixed formatting * Updated docs
This commit is contained in:
@@ -555,24 +555,25 @@ def build_dfs(archConfigs, filter_metrics, sys_info):
|
||||
):
|
||||
# print(data_config["metric"])
|
||||
new_metrics = {}
|
||||
# NB: support single placeholder for now!!
|
||||
p_range = data_config["metric"].pop("placeholder_range")
|
||||
metric, metric_expr = data_config["metric"].popitem()
|
||||
# print(len(data_config["metric"]))
|
||||
# data_config['metric'].clear()
|
||||
for p, r in p_range.items():
|
||||
# NB: We have to resolve placeholder range first if it
|
||||
# is a build-in var. It will be too late to do it in
|
||||
# eval_metric(). This is the only reason we need
|
||||
# sys_info at this stage.
|
||||
var = calc_builtin_var(r, sys_info)
|
||||
for i in range(var):
|
||||
new_key = metric.replace(p, str(i))
|
||||
new_val = {}
|
||||
for k, v in metric_expr.items():
|
||||
new_val[k] = metric_expr[k].replace(p, str(i))
|
||||
# print(new_val)
|
||||
new_metrics[new_key] = new_val
|
||||
if sys_info is not None:
|
||||
# NB: support single placeholder for now!!
|
||||
p_range = data_config["metric"].pop("placeholder_range")
|
||||
metric, metric_expr = data_config["metric"].popitem()
|
||||
# print(len(data_config["metric"]))
|
||||
# data_config['metric'].clear()
|
||||
for p, r in p_range.items():
|
||||
# NB: We have to resolve placeholder range first if it
|
||||
# is a build-in var. It will be too late to do it in
|
||||
# eval_metric(). This is the only reason we need
|
||||
# sys_info at this stage.
|
||||
var = calc_builtin_var(r, sys_info)
|
||||
for i in range(var):
|
||||
new_key = metric.replace(p, str(i))
|
||||
new_val = {}
|
||||
for k, v in metric_expr.items():
|
||||
new_val[k] = metric_expr[k].replace(p, str(i))
|
||||
# print(new_val)
|
||||
new_metrics[new_key] = new_val
|
||||
|
||||
# print(p_range)
|
||||
# print(new_metrics)
|
||||
@@ -616,6 +617,16 @@ def build_dfs(archConfigs, filter_metrics, sys_info):
|
||||
df = pd.DataFrame(columns=headers)
|
||||
|
||||
i = 0
|
||||
|
||||
if not data_config["metric"]:
|
||||
data_source_idx = (
|
||||
str(data_config["id"] // 100)
|
||||
+ "."
|
||||
+ str(data_config["id"] % 100)
|
||||
)
|
||||
metric_idx = data_source_idx + "." + str(i)
|
||||
metric_list[data_source_idx] = data_config["title"]
|
||||
|
||||
for key, entries in data_config["metric"].items():
|
||||
data_source_idx = (
|
||||
str(data_config["id"] // 100)
|
||||
|
||||
Reference in New Issue
Block a user