~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/tools/perf/pmu-events/pmu-events.h

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0 */
  2 #ifndef PMU_EVENTS_H
  3 #define PMU_EVENTS_H
  4 
  5 #include <stdbool.h>
  6 #include <stddef.h>
  7 
  8 struct perf_pmu;
  9 
 10 enum aggr_mode_class {
 11         PerChip = 1,
 12         PerCore
 13 };
 14 
 15 /**
 16  * enum metric_event_groups - How events within a pmu_metric should be grouped.
 17  */
 18 enum metric_event_groups {
 19         /**
 20          * @MetricGroupEvents: Default, group events within the metric.
 21          */
 22         MetricGroupEvents = 0,
 23         /**
 24          * @MetricNoGroupEvents: Don't group events for the metric.
 25          */
 26         MetricNoGroupEvents = 1,
 27         /**
 28          * @MetricNoGroupEventsNmi: Don't group events for the metric if the NMI
 29          *                          watchdog is enabled.
 30          */
 31         MetricNoGroupEventsNmi = 2,
 32         /**
 33          * @MetricNoGroupEventsSmt: Don't group events for the metric if SMT is
 34          *                          enabled.
 35          */
 36         MetricNoGroupEventsSmt = 3,
 37 };
 38 /*
 39  * Describe each PMU event. Each CPU has a table of PMU events.
 40  */
 41 struct pmu_event {
 42         const char *name;
 43         const char *compat;
 44         const char *event;
 45         const char *desc;
 46         const char *topic;
 47         const char *long_desc;
 48         const char *pmu;
 49         const char *unit;
 50         bool perpkg;
 51         bool deprecated;
 52 };
 53 
 54 struct pmu_metric {
 55         const char *pmu;
 56         const char *metric_name;
 57         const char *metric_group;
 58         const char *metric_expr;
 59         const char *metric_threshold;
 60         const char *unit;
 61         const char *compat;
 62         const char *desc;
 63         const char *long_desc;
 64         const char *metricgroup_no_group;
 65         const char *default_metricgroup_name;
 66         enum aggr_mode_class aggr_mode;
 67         enum metric_event_groups event_grouping;
 68 };
 69 
 70 struct pmu_events_table;
 71 struct pmu_metrics_table;
 72 
 73 typedef int (*pmu_event_iter_fn)(const struct pmu_event *pe,
 74                                  const struct pmu_events_table *table,
 75                                  void *data);
 76 
 77 typedef int (*pmu_metric_iter_fn)(const struct pmu_metric *pm,
 78                                   const struct pmu_metrics_table *table,
 79                                   void *data);
 80 
 81 int pmu_events_table__for_each_event(const struct pmu_events_table *table,
 82                                     struct perf_pmu *pmu,
 83                                     pmu_event_iter_fn fn,
 84                                     void *data);
 85 int pmu_events_table__find_event(const struct pmu_events_table *table,
 86                                  struct perf_pmu *pmu,
 87                                  const char *name,
 88                                  pmu_event_iter_fn fn,
 89                                  void *data);
 90 size_t pmu_events_table__num_events(const struct pmu_events_table *table,
 91                                     struct perf_pmu *pmu);
 92 
 93 int pmu_metrics_table__for_each_metric(const struct pmu_metrics_table *table, pmu_metric_iter_fn fn,
 94                                      void *data);
 95 
 96 const struct pmu_events_table *perf_pmu__find_events_table(struct perf_pmu *pmu);
 97 const struct pmu_metrics_table *perf_pmu__find_metrics_table(struct perf_pmu *pmu);
 98 const struct pmu_events_table *find_core_events_table(const char *arch, const char *cpuid);
 99 const struct pmu_metrics_table *find_core_metrics_table(const char *arch, const char *cpuid);
100 int pmu_for_each_core_event(pmu_event_iter_fn fn, void *data);
101 int pmu_for_each_core_metric(pmu_metric_iter_fn fn, void *data);
102 
103 const struct pmu_events_table *find_sys_events_table(const char *name);
104 const struct pmu_metrics_table *find_sys_metrics_table(const char *name);
105 int pmu_for_each_sys_event(pmu_event_iter_fn fn, void *data);
106 int pmu_for_each_sys_metric(pmu_metric_iter_fn fn, void *data);
107 
108 const char *describe_metricgroup(const char *group);
109 
110 #endif
111 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php