Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This design document describes

Jira Legacy
serverSystem Jira
serverId59107c6f-1e52-32bc-b58f-400d54bba998
keyWPERF-840
feature.

Expand
titlePlan

Pipeline

(Python) Parsing Script

Input: telemetry-solution/data/pmu/cpu/neoverse (-r .json)

Output: X.def , e.g. telemetry-solutions-data.def

Functionality: take in and parse .json file, produce a file containing C style definitions, which can be then parsed to populate relevant data structures (e.g. metric, metric group, events)

See: wperf-scripts/telemtry_events_update.py

X.def

Input: N/A

Output: N/A

Functionality: provide populated C style macro definitions to be read by man.cpp file (which then are used to populate relevant data structures)

See: wperf-common.telemetry-solution-data.def

man.cpp/man.h

Input: X.def

Output: ?

Functionality: Populate a specific data structure (or some equivalent implementation) based on X.def , implement methods to output each piece of data (metric, metric group etc) as one block, with methods to implement each of the following formats: plain text, json , while following/utilising the pretty table formatting structure - which can be called from the CLI parser (user_request.cpp )

See wperf.pmu_device.cpp , specifically do_list_prep_events , do_list_prep_metrics , m_product_metrics.count and similar functions

user_request.cpp

Implement man command line argument and parse arguments as a list of (a combination of) metrics, metric groups, or events. The relevant function from man.cpp should be executed to generate and output (somewhere) the relevant information for each specified metric

Expand
titlePlan - Psuedo Code Implementation
Code Block
languagepy
telemetry_data.py

def get_all_data():
		for data in [neoverse_n0,neoverse_v1...]:
				parse_metrics(data)
				parse_metric_groups(data)
				parse_events(data)
			
...
def parse_metrics(data)
	for metric in metrics:
		produce_c_definition(metric) 
...
Code Block
languagebash
telemetry_data.def

// Events for: neoverse-n1
WPERF_TS_EVENTS("neoverse-n1",SW_INCR                   ,0x0000,"sw_incr"                 ,"Instruction architecturally executed, Condition code check pass, software increment")
WPERF_TS_EVENTS("neoverse-n1",L1I_CACHE_REFILL          ,0x0001,"l1i_cache_refill"        ,"Level 1 instruction cache refill")
WPERF_TS_EVENTS("neoverse-n1",L1I_TLB_REFILL            ,0x0002,"l1i_tlb_refill"          ,"Level 1 instruction TLB refill")
...
Code Block
languagecpp
man.cpp

std::unordered_dict<std::wstring, std::wstring> dict1;

list<std::wstring> parse_input_args(input_args) //from user_request
{
...
return option_list
}

std::unordered_dict<std::wstring, std::wstring> fetch_descriptions(option_list)
{
return output_dict
}

void format_and_output(dict, style)
{
	if(style == json)
	{
	}
	else if(style == plaintext)
	{
	}
}