Blame src/libpfm4/lib/events/intel_bdx_unc_r2pcie_events.h

Packit 577717
/*
Packit 577717
 * Copyright (c) 2017 Google Inc. All rights reserved
Packit 577717
 * Contributed by Stephane Eranian <eranian@gmail.com>
Packit 577717
 *
Packit 577717
 * Permission is hereby granted, free of charge, to any person obtaining a copy
Packit 577717
 * of this software and associated documentation files (the "Software"), to deal
Packit 577717
 * in the Software without restriction, including without limitation the rights
Packit 577717
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
Packit 577717
 * of the Software, and to permit persons to whom the Software is furnished to do so,
Packit 577717
 * subject to the following conditions:
Packit 577717
 *
Packit 577717
 * The above copyright notice and this permission notice shall be included in all
Packit 577717
 * copies or substantial portions of the Software.
Packit 577717
 *
Packit 577717
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
Packit 577717
 * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
Packit 577717
 * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
Packit 577717
 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
Packit 577717
 * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
Packit 577717
 * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Packit 577717
 *
Packit 577717
 * This file is part of libpfm, a performance monitoring support library for
Packit 577717
 * applications on Linux.
Packit 577717
 *
Packit 577717
 * PMU: bdx_unc_r2pcie
Packit 577717
 */
Packit 577717
Packit 577717
static intel_x86_umask_t bdx_unc_r2_iio_credit[]={
Packit 577717
	{ .uname = "ISOCH_QPI0",
Packit 577717
	  .ucode = 0x400,
Packit 577717
	  .udesc = "TBD",
Packit 577717
	},
Packit 577717
	{ .uname = "ISOCH_QPI1",
Packit 577717
	  .ucode = 0x800,
Packit 577717
	  .udesc = "TBD",
Packit 577717
	},
Packit 577717
	{ .uname = "PRQ_QPI0",
Packit 577717
	  .ucode = 0x100,
Packit 577717
	  .udesc = "TBD",
Packit 577717
	},
Packit 577717
	{ .uname = "PRQ_QPI1",
Packit 577717
	  .ucode = 0x200,
Packit 577717
	  .udesc = "TBD",
Packit 577717
	},
Packit 577717
};
Packit 577717
Packit 577717
static intel_x86_umask_t bdx_unc_r2_ring_ad_used[]={
Packit 577717
	{ .uname  = "CCW",
Packit 577717
	  .ucode  = 0xc00,
Packit 577717
	  .udesc  = "Counterclockwise",
Packit 577717
	  .uflags = INTEL_X86_NCOMBO,
Packit 577717
	},
Packit 577717
	{ .uname = "CCW_EVEN",
Packit 577717
	  .ucode = 0x400,
Packit 577717
	  .udesc = "Counterclockwise and Even",
Packit 577717
	},
Packit 577717
	{ .uname = "CCW_ODD",
Packit 577717
	  .ucode = 0x800,
Packit 577717
	  .udesc = "Counterclockwise and Odd",
Packit 577717
	},
Packit 577717
	{ .uname  = "CW",
Packit 577717
	  .ucode  = 0x300,
Packit 577717
	  .udesc  = "Clockwise",
Packit 577717
	  .uflags = INTEL_X86_NCOMBO,
Packit 577717
	},
Packit 577717
	{ .uname = "CW_EVEN",
Packit 577717
	  .ucode = 0x100,
Packit 577717
	  .udesc = "Clockwise and Even",
Packit 577717
	},
Packit 577717
	{ .uname = "CW_ODD",
Packit 577717
	  .ucode = 0x200,
Packit 577717
	  .udesc = "Clockwise and Odd",
Packit 577717
	},
Packit 577717
};
Packit 577717
Packit 577717
static intel_x86_umask_t bdx_unc_r2_ring_ak_bounces[]={
Packit 577717
	{ .uname = "DN",
Packit 577717
	  .ucode = 0x200,
Packit 577717
	  .udesc = "AK Ingress Bounced -- Dn",
Packit 577717
	},
Packit 577717
	{ .uname = "UP",
Packit 577717
	  .ucode = 0x100,
Packit 577717
	  .udesc = "AK Ingress Bounced -- Up",
Packit 577717
	},
Packit 577717
};
Packit 577717
Packit 577717
static intel_x86_umask_t bdx_unc_r2_ring_iv_used[]={
Packit 577717
	{ .uname  = "ANY",
Packit 577717
	  .ucode  = 0xf00,
Packit 577717
	  .udesc  = "Any directions",
Packit 577717
	  .uflags = INTEL_X86_DFL,
Packit 577717
	},
Packit 577717
	{ .uname  = "CCW",
Packit 577717
	  .ucode  = 0xc00,
Packit 577717
	  .udesc  = "Counterclockwise",
Packit 577717
	  .uflags = INTEL_X86_NCOMBO,
Packit 577717
	},
Packit 577717
	{ .uname  = "CW",
Packit 577717
	  .ucode  = 0x300,
Packit 577717
	  .udesc  = "Clockwise",
Packit 577717
	  .uflags = INTEL_X86_NCOMBO,
Packit 577717
	},
Packit 577717
};
Packit 577717
Packit 577717
static intel_x86_umask_t bdx_unc_r2_rxr_cycles_ne[]={
Packit 577717
	{ .uname = "NCB",
Packit 577717
	  .ucode = 0x1000,
Packit 577717
	  .udesc = "NCB",
Packit 577717
	},
Packit 577717
	{ .uname = "NCS",
Packit 577717
	  .ucode = 0x2000,
Packit 577717
	  .udesc = "NCS",
Packit 577717
	},
Packit 577717
};
Packit 577717
Packit 577717
static intel_x86_umask_t bdx_unc_r2_rxr_occupancy[]={
Packit 577717
	{ .uname  = "DRS",
Packit 577717
	  .ucode  = 0x800,
Packit 577717
	  .udesc  = "Ingress Occupancy Accumulator -- DRS",
Packit 577717
	  .uflags = INTEL_X86_DFL,
Packit 577717
	},
Packit 577717
};
Packit 577717
Packit 577717
static intel_x86_umask_t bdx_unc_r2_sbo0_credits_acquired[]={
Packit 577717
	{ .uname = "AD",
Packit 577717
	  .ucode = 0x100,
Packit 577717
	  .udesc = "SBo0 Credits Acquired -- For AD Ring",
Packit 577717
	},
Packit 577717
	{ .uname = "BL",
Packit 577717
	  .ucode = 0x200,
Packit 577717
	  .udesc = "SBo0 Credits Acquired -- For BL Ring",
Packit 577717
	},
Packit 577717
};
Packit 577717
Packit 577717
static intel_x86_umask_t bdx_unc_r2_stall_no_sbo_credit[]={
Packit 577717
	{ .uname = "SBO0_AD",
Packit 577717
	  .ucode = 0x100,
Packit 577717
	  .udesc = "Stall on No Sbo Credits -- For SBo0, AD Ring",
Packit 577717
	},
Packit 577717
	{ .uname = "SBO0_BL",
Packit 577717
	  .ucode = 0x400,
Packit 577717
	  .udesc = "Stall on No Sbo Credits -- For SBo0, BL Ring",
Packit 577717
	},
Packit 577717
	{ .uname = "SBO1_AD",
Packit 577717
	  .ucode = 0x200,
Packit 577717
	  .udesc = "Stall on No Sbo Credits -- For SBo1, AD Ring",
Packit 577717
	},
Packit 577717
	{ .uname = "SBO1_BL",
Packit 577717
	  .ucode = 0x800,
Packit 577717
	  .udesc = "Stall on No Sbo Credits -- For SBo1, BL Ring",
Packit 577717
	},
Packit 577717
};
Packit 577717
Packit 577717
static intel_x86_umask_t bdx_unc_r2_txr_cycles_full[]={
Packit 577717
	{ .uname = "AD",
Packit 577717
	  .ucode = 0x100,
Packit 577717
	  .udesc = "Egress Cycles Full -- AD",
Packit 577717
	},
Packit 577717
	{ .uname = "AK",
Packit 577717
	  .ucode = 0x200,
Packit 577717
	  .udesc = "Egress Cycles Full -- AK",
Packit 577717
	},
Packit 577717
	{ .uname = "BL",
Packit 577717
	  .ucode = 0x400,
Packit 577717
	  .udesc = "Egress Cycles Full -- BL",
Packit 577717
	},
Packit 577717
};
Packit 577717
Packit 577717
static intel_x86_umask_t bdx_unc_r2_txr_cycles_ne[]={
Packit 577717
	{ .uname = "AD",
Packit 577717
	  .ucode = 0x100,
Packit 577717
	  .udesc = "Egress Cycles Not Empty -- AD",
Packit 577717
	},
Packit 577717
	{ .uname = "AK",
Packit 577717
	  .ucode = 0x200,
Packit 577717
	  .udesc = "Egress Cycles Not Empty -- AK",
Packit 577717
	},
Packit 577717
	{ .uname = "BL",
Packit 577717
	  .ucode = 0x400,
Packit 577717
	  .udesc = "Egress Cycles Not Empty -- BL",
Packit 577717
	},
Packit 577717
};
Packit 577717
Packit 577717
static intel_x86_umask_t bdx_unc_r2_txr_nack_cw[]={
Packit 577717
	{ .uname = "DN_AD",
Packit 577717
	  .ucode = 0x100,
Packit 577717
	  .udesc = "Egress CCW NACK -- AD CCW",
Packit 577717
	},
Packit 577717
	{ .uname = "DN_AK",
Packit 577717
	  .ucode = 0x400,
Packit 577717
	  .udesc = "Egress CCW NACK -- AK CCW",
Packit 577717
	},
Packit 577717
	{ .uname = "DN_BL",
Packit 577717
	  .ucode = 0x200,
Packit 577717
	  .udesc = "Egress CCW NACK -- BL CCW",
Packit 577717
	},
Packit 577717
	{ .uname = "UP_AD",
Packit 577717
	  .ucode = 0x800,
Packit 577717
	  .udesc = "Egress CCW NACK -- AK CCW",
Packit 577717
	},
Packit 577717
	{ .uname = "UP_AK",
Packit 577717
	  .ucode = 0x2000,
Packit 577717
	  .udesc = "Egress CCW NACK -- BL CW",
Packit 577717
	},
Packit 577717
	{ .uname = "UP_BL",
Packit 577717
	  .ucode = 0x1000,
Packit 577717
	  .udesc = "Egress CCW NACK -- BL CCW",
Packit 577717
	},
Packit 577717
};
Packit 577717
Packit 577717
static intel_x86_entry_t intel_bdx_unc_r2_pe[]={
Packit 577717
  { .name   = "UNC_R2_CLOCKTICKS",
Packit 577717
    .code   = 0x1,
Packit 577717
    .desc   = "Counts the number of uclks in the R2PCIe uclk domain.  This could be slightly different than the count in the Ubox because of enable/freeze delays.  However, because the R2PCIe is close to the Ubox, they generally should not diverge by more than a handful of cycles.",
Packit 577717
    .modmsk = BDX_UNC_R2PCIE_ATTRS,
Packit 577717
    .cntmsk = 0xf,
Packit 577717
  },
Packit 577717
  { .name   = "UNC_R2_IIO_CREDIT",
Packit 577717
    .code   = 0x2d,
Packit 577717
    .desc   = "TBD",
Packit 577717
    .modmsk = BDX_UNC_R2PCIE_ATTRS,
Packit 577717
    .cntmsk = 0x3,
Packit 577717
    .ngrp   = 1,
Packit 577717
    .umasks = bdx_unc_r2_iio_credit,
Packit 577717
    .numasks= LIBPFM_ARRAY_SIZE(bdx_unc_r2_iio_credit),
Packit 577717
  },
Packit 577717
  { .name   = "UNC_R2_RING_AD_USED",
Packit 577717
    .code   = 0x7,
Packit 577717
    .desc   = "Counts the number of cycles that the AD ring is being used at this ring stop.  This includes when packets are passing by and when packets are being sunk, but does not include when packets are being sent from the ring stop.",
Packit 577717
    .modmsk = BDX_UNC_R2PCIE_ATTRS,
Packit 577717
    .cntmsk = 0xf,
Packit 577717
    .ngrp   = 1,
Packit 577717
    .umasks = bdx_unc_r2_ring_ad_used,
Packit 577717
    .numasks= LIBPFM_ARRAY_SIZE(bdx_unc_r2_ring_ad_used),
Packit 577717
  },
Packit 577717
  { .name   = "UNC_R2_RING_AK_BOUNCES",
Packit 577717
    .code   = 0x12,
Packit 577717
    .desc   = "Counts the number of times when a request destined for the AK ingress bounced.",
Packit 577717
    .modmsk = BDX_UNC_R2PCIE_ATTRS,
Packit 577717
    .cntmsk = 0xf,
Packit 577717
    .ngrp   = 1,
Packit 577717
    .umasks = bdx_unc_r2_ring_ak_bounces,
Packit 577717
    .numasks= LIBPFM_ARRAY_SIZE(bdx_unc_r2_ring_ak_bounces),
Packit 577717
  },
Packit 577717
  { .name   = "UNC_R2_RING_AK_USED",
Packit 577717
    .code   = 0x8,
Packit 577717
    .desc   = "Counts the number of cycles that the AK ring is being used at this ring stop.  This includes when packets are passing by and when packets are being sunk, but does not include when packets are being sent from the ring stop.",
Packit 577717
    .modmsk = BDX_UNC_R2PCIE_ATTRS,
Packit 577717
    .cntmsk = 0xf,
Packit 577717
    .ngrp   = 1,
Packit 577717
    .umasks = bdx_unc_r2_ring_ad_used,
Packit 577717
    .numasks= LIBPFM_ARRAY_SIZE(bdx_unc_r2_ring_ad_used),
Packit 577717
  },
Packit 577717
  { .name   = "UNC_R2_RING_BL_USED",
Packit 577717
    .code   = 0x9,
Packit 577717
    .desc   = "Counts the number of cycles that the BL ring is being used at this ring stop.  This includes when packets are passing by and when packets are being sunk, but does not include when packets are being sent from the ring stop.",
Packit 577717
    .modmsk = BDX_UNC_R2PCIE_ATTRS,
Packit 577717
    .cntmsk = 0xf,
Packit 577717
    .ngrp   = 1,
Packit 577717
    .umasks = bdx_unc_r2_ring_ad_used,
Packit 577717
    .numasks= LIBPFM_ARRAY_SIZE(bdx_unc_r2_ring_ad_used),
Packit 577717
  },
Packit 577717
  { .name   = "UNC_R2_RING_IV_USED",
Packit 577717
    .code   = 0xa,
Packit 577717
    .desc   = "Counts the number of cycles that the IV ring is being used at this ring stop.  This includes when packets are passing by and when packets are being sent, but does not include when packets are being sunk into the ring stop.",
Packit 577717
    .modmsk = BDX_UNC_R2PCIE_ATTRS,
Packit 577717
    .cntmsk = 0xf,
Packit 577717
    .ngrp   = 1,
Packit 577717
    .umasks = bdx_unc_r2_ring_iv_used,
Packit 577717
    .numasks= LIBPFM_ARRAY_SIZE(bdx_unc_r2_ring_iv_used),
Packit 577717
  },
Packit 577717
  { .name   = "UNC_R2_RXR_CYCLES_NE",
Packit 577717
    .code   = 0x10,
Packit 577717
    .desc   = "Counts the number of cycles when the R2PCIe Ingress is not empty.  This tracks one of the three rings that are used by the R2PCIe agent.  This can be used in conjunction with the R2PCIe Ingress Occupancy Accumulator event in order to calculate average queue occupancy.  Multiple ingress buffers can be tracked at a given time using multiple counters.",
Packit 577717
    .modmsk = BDX_UNC_R2PCIE_ATTRS,
Packit 577717
    .cntmsk = 0x3,
Packit 577717
    .ngrp   = 1,
Packit 577717
    .umasks = bdx_unc_r2_rxr_cycles_ne,
Packit 577717
    .numasks= LIBPFM_ARRAY_SIZE(bdx_unc_r2_rxr_cycles_ne),
Packit 577717
  },
Packit 577717
  { .name   = "UNC_R2_RXR_INSERTS",
Packit 577717
    .code   = 0x11,
Packit 577717
    .desc   = "Counts the number of allocations into the R2PCIe Ingress.  This tracks one of the three rings that are used by the R2PCIe agent.  This can be used in conjunction with the R2PCIe Ingress Occupancy Accumulator event in order to calculate average queue latency.  Multiple ingress buffers can be tracked at a given time using multiple counters.",
Packit 577717
    .modmsk = BDX_UNC_R2PCIE_ATTRS,
Packit 577717
    .cntmsk = 0x3,
Packit 577717
    .ngrp   = 1,
Packit 577717
    .umasks = bdx_unc_r2_rxr_cycles_ne,
Packit 577717
    .numasks= LIBPFM_ARRAY_SIZE(bdx_unc_r2_rxr_cycles_ne),
Packit 577717
  },
Packit 577717
  { .name   = "UNC_R2_RXR_OCCUPANCY",
Packit 577717
    .code   = 0x13,
Packit 577717
    .desc   = "Accumulates the occupancy of a given R2PCIe Ingress queue in each cycles.  This tracks one of the three ring Ingress buffers.  This can be used with the R2PCIe Ingress Not Empty event to calculate average occupancy or the R2PCIe Ingress Allocations event in order to calculate average queuing latency.",
Packit 577717
    .modmsk = BDX_UNC_R2PCIE_ATTRS,
Packit 577717
    .cntmsk = 0x1,
Packit 577717
    .ngrp   = 1,
Packit 577717
    .umasks = bdx_unc_r2_rxr_occupancy,
Packit 577717
    .numasks= LIBPFM_ARRAY_SIZE(bdx_unc_r2_rxr_occupancy),
Packit 577717
  },
Packit 577717
  { .name   = "UNC_R2_SBO0_CREDITS_ACQUIRED",
Packit 577717
    .code   = 0x28,
Packit 577717
    .desc   = "Number of Sbo 0 credits acquired in a given cycle, per ring.",
Packit 577717
    .modmsk = BDX_UNC_R2PCIE_ATTRS,
Packit 577717
    .cntmsk = 0x3,
Packit 577717
    .ngrp   = 1,
Packit 577717
    .umasks = bdx_unc_r2_sbo0_credits_acquired,
Packit 577717
    .numasks= LIBPFM_ARRAY_SIZE(bdx_unc_r2_sbo0_credits_acquired),
Packit 577717
  },
Packit 577717
  { .name   = "UNC_R2_STALL_NO_SBO_CREDIT",
Packit 577717
    .code   = 0x2c,
Packit 577717
    .desc   = "Number of cycles Egress is stalled waiting for an Sbo credit to become available.  Per Sbo, per Ring.",
Packit 577717
    .modmsk = BDX_UNC_R2PCIE_ATTRS,
Packit 577717
    .cntmsk = 0x3,
Packit 577717
    .ngrp   = 1,
Packit 577717
    .umasks = bdx_unc_r2_stall_no_sbo_credit,
Packit 577717
    .numasks= LIBPFM_ARRAY_SIZE(bdx_unc_r2_stall_no_sbo_credit),
Packit 577717
  },
Packit 577717
  { .name   = "UNC_R2_TXR_CYCLES_FULL",
Packit 577717
    .code   = 0x25,
Packit 577717
    .desc   = "Counts the number of cycles when the R2PCIe Egress buffer is full.",
Packit 577717
    .modmsk = BDX_UNC_R2PCIE_ATTRS,
Packit 577717
    .cntmsk = 0x1,
Packit 577717
    .ngrp   = 1,
Packit 577717
    .umasks = bdx_unc_r2_txr_cycles_full,
Packit 577717
    .numasks= LIBPFM_ARRAY_SIZE(bdx_unc_r2_txr_cycles_full),
Packit 577717
  },
Packit 577717
  { .name   = "UNC_R2_TXR_CYCLES_NE",
Packit 577717
    .code   = 0x23,
Packit 577717
    .desc   = "Counts the number of cycles when the R2PCIe Egress is not empty.  This tracks one of the three rings that are used by the R2PCIe agent.  This can be used in conjunction with the R2PCIe Egress Occupancy Accumulator event in order to calculate average queue occupancy.  Only a single Egress queue can be tracked at any given time.  It is not possible to filter based on direction or polarity.",
Packit 577717
    .modmsk = BDX_UNC_R2PCIE_ATTRS,
Packit 577717
    .cntmsk = 0x1,
Packit 577717
    .ngrp   = 1,
Packit 577717
    .umasks = bdx_unc_r2_txr_cycles_ne,
Packit 577717
    .numasks= LIBPFM_ARRAY_SIZE(bdx_unc_r2_txr_cycles_ne),
Packit 577717
  },
Packit 577717
  { .name   = "UNC_R2_TXR_NACK_CW",
Packit 577717
    .code   = 0x26,
Packit 577717
    .desc   = "TBD",
Packit 577717
    .modmsk = BDX_UNC_R2PCIE_ATTRS,
Packit 577717
    .cntmsk = 0x3,
Packit 577717
    .ngrp   = 1,
Packit 577717
    .umasks = bdx_unc_r2_txr_nack_cw,
Packit 577717
    .numasks= LIBPFM_ARRAY_SIZE(bdx_unc_r2_txr_nack_cw),
Packit 577717
  },
Packit 577717
};