# caliper   Traces PMU events

toolname = 'PMU'
pmu_report_type = PMU_TRACE

# Most command-line options can be specified in this file (or in .caliperinit),
# but they must be specified as Python variables (so replace '-' in option names
# with "_"). Settings in .caliperinit override settings in this file. Command-
# line options overide settings in both this file and .caliperinit. Below are
# examples of some of the options you can set.
#
# application     = "/path/to/application"
# arguments       = "application arguments"
# output_file     = "/path/to/outputfile"
# csv_file        = "/path/to/outputfile"
# html_dir        = "/path/to/html/outdir"
# datafile        = "/path/to/datafile"
# process         = "all" # Follow all children of the process being measured.
# module_exclude  = ["/usr/lib/", "/opt/graphics/"] # Exclude libs from profile.


# collect_*
#
# Options beginning with "collect_" determine the content of a given sample
# in the Performance Monitoring Unit (PMU) trace.
#
# NOTES
#  - To allow for hardware limitations, do not set:
#      + collect_btb to True if either collect_alat or collect_dtlb are
#        set to True.
#      + both collect_icache and collect_itlb to True for any given run.
#      + more than one of the following options to True: collect_dcache,
#        collect_dtlb, colect_alat.
#  - collect_alat not supported on Itanium (Merced) processors
#
collect_ip          = False
collect_utid        = False
collect_sample_desc = True
collect_counters    = True
collect_btb         = False
collect_icache      = False
collect_itlb        = False
collect_dcache      = False
collect_dtlb        = False
collect_alat        = False


# event_defaults
#
# event_defaults is used to specify the default parameters that further
# modify the definition of a PMU event. Those defaults apply to all
# PMU events requested in a data collection run (e.g. via --metrics/metrics
# or --sampling_spec/sampling_spec).
#
# Event parameters are specified by a string where colons (':') separate
# various parameters.
#
# The general syntax is:
#    "<name>=<value>[:<name>=<value[:...]]"
#
# Among those parameters:
#   - privilege level mask (PLM):
#       name  : privilege-level-mask
#       value : user, kernel or all
#               or an integer mask between 0 and 15
#
#     The PLM determines at which privilege levels the event will be counted.
#
#     The Itanium architecture defines 4 levels, 0 to 3. Any combination
#     of those levels can be requested.
#
#     On HP-UX and Linux the level 0 is used by the kernel, while level 3
#     is the level at which "user space" code is being executed.
#
#     Unless specified, the privilege level mask used by Caliper is
#     "user" for per-process measurements, "kernel" for kernel measurements.
#
#   - count threshold:
#       name  : threshold
#       value : an integer between 0 and 7
#
#     In a given CPU cycle, PMU events will be counted only if there
#     a more of those events occuring during this cycle than the specified
#
#     Unless specified, the threshold value used by Caliper is 0.
#
# Parameter names can be specified using the full parameter name specified
# above, any non-ambiguous prefix of those names, or a complete acronym
# of the name (e.g. 'plm' for 'privilege-level-mask'). Case does not matter.
#
# Note that 'event_defaults' replaces in Caliper 3.6 the setting previously
# named 'sampling_level'. For backward comptability, a parameter that
# doesn't contain a '=' will be interpreted as a privilege level mask.
#
# event_defaults = "PLM=user:Threshold=0"


# sampling_spec
#
# sampling_spec specifies what CPU event to use for sampling and how many
# of those events should occur between samples. The sampling specification
# below indicates that sampling will occur every 50000000 CPU_CYCLES, with
# a sampling variation of 5% of the sampling rate. A 5% variation means that
# the number of events between samples will vary between 95% and 105% of the
# sampling rate. Alternatively, you can specify the sampling variation as
# an exact count.
#

sampling_spec = ",,NO_EVENT"


# icache_miss_latency_threshold
# dcache_miss_latency_threshold
#
# Cache miss latency is the number of cycles it takes to retrieve data not in
# the cache. Cache misses reported are limited to those with latencies greater
# than the latency threshold.
#
#icache_miss_latency_threshold = 0
#dcache_miss_latency_threshold = 0

# capture_tlb_*
#
# TLB misses are resolved by either the L2 TLB, the VHPT, or by software.
# The following options can limit TLB misses recorded to one or more subsets
# of TLB misses, with the subsets being defined by how TLB misses are handled.
# The options apply to both data and instruction TLBs.
#
# NOTES
#  - capture_tlb_l2_fills has no effect on Itanium.
#  - Instruction TLB misses on Itanium are not handled by the L2 TLB.
#
#capture_tlb_l2_fills       = True
#capture_tlb_vhpt_fills     = True
#capture_tlb_software_fills = True

# metrics
#
# The metrics option determines which CPU events caliper records. You can
# specify up to 4 events.
#
# By default, CPU events are counted only when your application is running in
# user space. You can change the default by specifying a privilege level
# qualifier for one or more of the CPU events you specify. Available privilege
# levels are user_priv_level, kernel_priv_level, and all_priv_level, which cause
# caliper to count a given CPU event in user space, kernel space, or both user
# and kernel space, respectively. Privilege levels can be abbreviated to as
# few characters as one, as in the following example:
#
#   metrics = "IA64_INST_RETIRED:k, IA64_INST_RETIRED:u, CPU_CYCLES:a"
#
# Note: This option is ignored if collect_counters is set to False
#
metrics = "IA64_INST_RETIRED, NOPS_RETIRED, CPU_CYCLES"

# For a list with descriptions of available PMU events, see chapter 7 of the
# "Intel Itanium Processor Reference Manual For Software Development" or the
# online text files:
#
#    /opt/caliper/doc/text/itanium_cpu_counters.txt
#    /opt/caliper/doc/text/itanium2_cpu_counters.txt
#    /opt/caliper/doc/text/montecito_cpu_counters.txt

# The remaining variables affect how branch traces are recorded and are only
# in effect if you set collect_btb to True.

# branch_taken_criterion
#
# VALUES:
#  Caliper_no_branches          - do not record branches taken/not taken
#                                 NOTE: Caliper_no_branches results in no
#                                       branch traces
#  Caliper_not_taken_branches   - record branches not taken
#  Caliper_taken_branches       - record branches taken
#  Caliper_all_branch_outcomes  - record both taken and not taken branches
#
#branch_taken_criterion = Caliper_taken_branches

# target_prediction_criterion
#
# VALUES:
#  Caliper_predictions_target_miss - record branches that mispredict target
#  Caliper_predictions_target_hit  - record branches that predict target
#  Caliper_predictions_target_all  - record branches that predict or mispredict
#                                    target
#
#target_prediction_criterion = Caliper_predictions_target_all

# whether_prediction_criterion
#
# VALUES:
#  Caliper_predictions_whether_miss  - record branches that mispredict branch
#                                      taken/not taken
#  Caliper_predictions_whether_hit   - record branches that correctly predict
#                                      branch taken/not taken
#  Caliper_predictions_whether_all   - record branches regardless of success of
#                                      the taken/not taken prediction
#
#whether_prediction_criterion = Caliper_predictions_whether_all

# branch_type_criterion
#
#  Caliper_branch_type_all
#  Caliper_branch_type_ip_rel
#  Caliper_branch_type_return
#  Caliper_branch_type_non_return_indirect
#
#if pmu_type in (ITANIUM2_PMU, MONTECITO_PMU):
#    branch_type_criterion = Caliper_branch_type_all

# capture_*_predicted_branches
#
# Eliminate recording of TAR, TAC, or BAC predicted branches by setting the
# corresponding flag below to False.
#
#if pmu_type == ITANIUM_PMU:
#    capture_tar_predicted_branches = True
#    capture_tac_predicted_branches = True
#    capture_bac_predicted_branches = True

