Lines Matching defs:metric

119  * The metric under construction. The data held here will be placed in a
122 struct metric {
130 /** The name of the metric such as "IPC". */
132 /** Modifier on the metric such as "u" or NULL for none. */
139 * The "ScaleUnit" that scales and adds a unit to the metric during
144 * Optional name of the metric group reported
145 * if the Default metric group is being processed.
151 * Should events of the metric be grouped?
155 * Parsed events for the metric. Optional as events may be taken from a
156 * different metric whose group contains all the IDs necessary for this
167 pr_warning("Not grouping metric %s's events.\n", name);
175 pr_warning("Try disabling the NMI watchdog to comply NO_NMI_WATCHDOG metric constraint:\n"
199 static void metric__free(struct metric *m)
211 static struct metric *metric__new(const struct pmu_metric *pm,
218 struct metric *m;
272 * to the IDs from a parsed metric expression.
274 * @ids: the metric IDs to match.
276 * @out_metric_events: holds the created metric events array.
314 * combined or shared groups, this metric may not care
318 pr_debug("Matched metric-id %s to %s\n", metric_id, evsel__name(ev));
334 * The metric leader points to the identically named
341 * may be duplicated for each pmu. Set the metric leader
374 static bool match_pm_metric(const struct pmu_metric *pm, const char *pmu, const char *metric)
381 return match_metric(pm->metric_group, metric) ||
382 match_metric(pm->metric_name, metric);
389 /** @metric_group: Owned metric group name, separated others with ';'. */
597 pr_err("Bad metric-id encoding in: '%s'", orig);
635 * If the name is just the parsed event, use the metric-id to
638 if (strstr(ev->name, "metric-id=")) {
710 * 'msr@tsc@' gets added as msr/tsc,metric-id=msr!3tsc!3/
721 ret = strbuf_addstr(events, ",metric-id=");
733 ret = strbuf_addstr(events, "/metric-id=");
799 struct metric *root_metric;
805 const char *metric,
816 struct metric *root_metric,
821 * resolve_metric - Locate metrics within the root metric and recursively add
823 * @metric_list: The list the metric is added to.
834 * @visited: A singly linked list of metric names being added that is used to
846 struct metric *root_metric,
853 /* The metric to resolve. */
864 * Iterate all the parsed IDs and if there's a matching metric and it to
882 /* Remove the metric IDs from the context. */
887 * Recursively add all the metrics, IDs are added to the root metric's
903 * __add_metric - Add a metric to metric_list.
904 * @metric_list: The list the metric is added to.
905 * @pm: The pmu_metric containing the metric to be added.
917 * @visited: A singly linked list of metric names being added that is used to
930 struct metric *root_metric,
952 * This metric is the root of a tree and may reference other
964 * This metric was referenced in a metric higher in the
965 * tree. Check if the same metric is already resolved in the
998 * all the metric's IDs and add it to the root context.
1004 * Threshold expressions are built off the actual metric. Switch
1008 * metric's name as a reference. This allows metric threshold
1016 /* Broken metric. */
1040 const char *metric;
1054 if (!match_metric(pm->metric_name, data->metric))
1062 const char *metric,
1068 .metric = metric,
1083 struct metric *root_metric,
1089 pr_debug("metric expr %s for %s\n", pm->metric_expr, pm->metric_name);
1144 const struct metric *left = container_of(l, struct metric, nd);
1145 const struct metric *right = container_of(r, struct metric, nd);
1173 const struct metric *left = container_of(l, struct metric, nd);
1174 const struct metric *right = container_of(r, struct metric, nd);
1216 * metricgroup__add_metric - Find and add a metric, or a metric group.
1218 * @metric_name: The name of the metric or metric group. For example, "IPC"
1219 * could be the name of a metric and "TopDownL1" the name of a
1220 * metric group.
1227 * @metric_list: The list that the metric or metric group are added to.
1255 * Iterate over all metrics seeing if metric matches either the
1256 * name or group. When it does add the metric to the list.
1298 * metricgroup__add_metric_list - Find and add metrics, or metric groups,
1301 * @list: the list of metrics or metric groups. For example, "IPC,CPI,TopDownL1"
1338 pr_err("Cannot find metric or group `%s'\n", metric_name);
1362 struct metric *m, *tmp;
1379 struct metric *m;
1396 * metric IDs, as the IDs are held in a set,
1406 struct metric *m;
1438 * @metric_no_merge: is metric sharing explicitly disabled.
1440 * @ids: the event identifiers parsed from a metric.
1463 * event isn't present in one metric. For example, a ratio of
1502 pr_debug("Parsing metric events '%s'\n", events.buf);
1536 struct metric *m;
1580 struct metric *n;
1587 * See if the IDs for this metric are a subset of an
1588 * earlier metric.
1721 const char *metric;
1729 return match_pm_metric(pm, data->pmu, data->metric) ? 1 : 0;
1732 bool metricgroup__has_metric(const char *pmu, const char *metric)
1737 .metric = metric,
1802 pr_debug("copying metric event for cgroup '%s': %s (idx=%d)\n",