Statistics Collection

From Marss86

Note: This utility is available in 0.2 or higher versions.

We have introduced new statistics collection framework in 0.2 version which is dynamic, modular and flexible than PTLsim based statistics collection framework. Currently this framework dump the statistics collected during simulation period in YAML format which is explained briefly in this section. The stats are saved into file specified in '-stats' configuration parameter.

Contents script

This page shows how you can use '' script provided in 'util' folder to extract specific stats that you are interested in. This script is a simple python script used to manipulate YAML based stats dumped by Marss simulator.

Install Faster yaml module: If you don't have libyaml installed in your machine, please download file and place it in MARSS/ptlsim/lib/python folder to speed up script.

Commandline Options

Following are some command line options available in this script.

  • -y, --yaml : Treat arguments as input YAML files
  • -t TAGS, --tags=TAGS : Specify tag search pattern. (Ex. astar|gcc to match either one)
  • -n NODE, --node=NODE : Select only given node, format is: 'nodeA::nodeB::nodeC'. You can also use Regular expressions to select multiple nodes at same level.
  • --yaml-out : Print output in YAML format
  • --flatten  : Print result in flattened format
  • --hist  : Print Histogram of given node
  • --sum  : Sum of all the nodes in given stats

Collecting Specific Node Stats

To collect stats of a specific node use '-n' option as shown below.

    $ util/ -y --yaml-out -n base_machine::ooo_0::commit::ipc result.stats

Here '-y' specify that input file(s) are in YAML format and '--yaml-out' will specify that output of the script will be in YAML format also. The '-n' option selects the specific node from the input stats file. The node selected is commit ipc of core 0.

If you want to collect commit IPC of all the cores then use regular expression based node pattern as shown below:

    $ util/ -y --yaml-out -n base_machine::ooo_.\*::commit::ipc result.stats

You can specify multiple -n options if you want to collect more than one node.

Filtering based on tags

Marss simconfig provides an option for adding 'tags' to statistics. By default Marss adds few tags like 'user' (for user mode stats), 'kernel' (for kernel mode stats), host name of machine where simulation was run etc.. Users can also add extra tags to their simulations using '-tags' simconfig option. To add more than one tag separate them using ',' (comma). Using this tags we can filter multiple stats collections as shown below:

    $ util/ -y --yaml-out -n base_machine::ooo_.\*::commit::ipc -t user result.stats

The command shown above will print only 'user' mode commit IPC of each cores from 'result.stats' file.

If your results.stats file contains stats from multiple benchmarks then you can use tags to select specific benchmark(s). For example, result.stats contains statistics for gcc, bzip and astar benchmark results and if you are interested in only gcc and bzip than you can use following tag filter.

    $ util/ -y --yaml-out -n base_machine::ooo_.\*::commit::ipc -t gcc\|bzip result.stats

Now if you want only user mode IPC of these two benchmarks then specify two tag filters as shown below.

    $ util/ -y --yaml-out -n base_machine::ooo_.\*::commit::ipc -t gcc\|bzip -t user result.stats

Flatten output provides a command line option to flatten the output using '--flatten' option.

    $ util/ -y --flatten -n base_machine::ooo_.\*::commit -t user result.stats

Above command will print the 'commit' node as shown below:

base_machine::ooo_0_0::commit::free_reg_recycled : 259771
base_machine::ooo_0_0::commit::width : [2107749, 66924, 77060, 35171, 320400]
base_machine::ooo_0_0::commit::freereg::pending : 551828
base_machine::ooo_0_0::commit::freereg::free : 1002315

Histogram of Array

Marss stats contains many array based nodes and printing those arrays into histogram mode helps to understand the usage of a specific module. So provides '--hist' option to print array based nodes into histogram.

    $ util/ -y --hist -n base_machine::ooo_0_0::dispatch::width -t user result.stats

Above command will show following output:

base_machine {
  ooo_0_0 {
    dispatch {
      width {
        Minimum:         0
        Maximum:         6791300
        Average:         0.24
        Total Sum:       7285338
        Weighted Sum:    1765605
        0 [ 93.2] [ 93.2]: 6791300 **********************************************
        1 [  0.4] [ 93.6]:   27068 
        2 [  0.6] [ 94.2]:   43849 
        3 [  0.6] [ 94.8]:   41645 
        4 [  5.2] [100.0]:  381476 **

Sum of Nodes

Running multicore simulations dumps lot of stats that needs post processing. For example if we want to collect IPC of 12 core simulation run, we need to collect all IPC's and then sum up all the values. We can use Node Filtering to dump only the IPC nodes as shown below.

$ -y --yaml-out -n base_machine::ooo_.\*::thread0::commit::ipc -t user  blackscholes.yml

will generate following output:

        commit: {ipc: 0.581754}
        commit: {ipc: 0.581805}
        commit: {ipc: 0.58047}
        commit: {ipc: 0.582414}
        commit: {ipc: 0.585519}
        commit: {ipc: 0.584126}
        commit: {ipc: 0.582528}
        commit: {ipc: 0.585164}
        commit: {ipc: 0.585554}
        commit: {ipc: 0.584561}
        commit: {ipc: 0.585384}
        commit: {ipc: 0.582258}

The next step is to sum up each IPC and report that in your results. To simplify this task provides --sum flag to sum-up all the nodes. The output of above command with --sum is like this:

{blackscholes.user: 7.001537}
Personal tools