Lines Matching defs:evsel

12 #include "evsel.h"
224 static struct evsel *
232 struct evsel *evsel;
252 evsel = evsel__new_idx(attr, *idx);
253 if (!evsel) {
259 evsel->core.cpus = cpus;
260 evsel->core.own_cpus = perf_cpu_map__get(cpus);
261 evsel->core.requires_cpu = pmu ? pmu->is_uncore : false;
262 evsel->core.is_pmu_core = pmu ? pmu->is_core : false;
263 evsel->auto_merge_stats = auto_merge_stats;
264 evsel->pmu = pmu;
265 evsel->pmu_name = pmu ? strdup(pmu->name) : NULL;
268 evsel->name = strdup(name);
271 evsel->metric_id = strdup(metric_id);
274 list_splice_init(config_terms, &evsel->config_terms);
277 list_add_tail(&evsel->core.node, list);
279 return evsel;
282 struct evsel *parse_events__add_event(int idx, struct perf_event_attr *attr,
303 struct evsel *evsel;
309 evsel = __add_event(list, idx, &attr, /*init_attr=*/true, /*name=*/NULL,
313 if (!evsel)
315 evsel->tool_event = tool_event;
319 free((char *)evsel->unit);
320 evsel->unit = strdup("ns");
526 struct evsel *evsel = evsel__newtp_idx(sys_name, evt_name, (*idx)++);
528 if (IS_ERR(evsel)) {
529 tracepoint_error(err, PTR_ERR(evsel), sys_name, evt_name, loc->first_column);
530 return PTR_ERR(evsel);
538 list_splice(&config_terms, &evsel->config_terms);
541 list_add_tail(&evsel->core.node, list);
1378 struct evsel *evsel;
1421 evsel = __add_event(list, &parse_state->idx, &attr,
1426 return evsel ? 0 : -ENOMEM;
1463 evsel = __add_event(list, &parse_state->idx, &attr, /*init_attr=*/true,
1467 if (!evsel)
1470 if (evsel->name)
1471 evsel->use_config_name = true;
1473 evsel->percore = config_term_percore(&evsel->config_terms);
1478 free((char *)evsel->unit);
1479 evsel->unit = strdup(info.unit);
1480 evsel->scale = info.scale;
1481 evsel->per_pkg = info.per_pkg;
1482 evsel->snapshot = info.snapshot;
1582 struct evsel *leader;
1589 leader = list_first_entry(list, struct evsel, core.node);
1625 struct evsel *evsel)
1627 int eu = evsel ? evsel->core.attr.exclude_user : 0;
1628 int ek = evsel ? evsel->core.attr.exclude_kernel : 0;
1629 int eh = evsel ? evsel->core.attr.exclude_hv : 0;
1630 int eH = evsel ? evsel->core.attr.exclude_host : 0;
1631 int eG = evsel ? evsel->core.attr.exclude_guest : 0;
1632 int eI = evsel ? evsel->core.attr.exclude_idle : 0;
1633 int precise = evsel ? evsel->core.attr.precise_ip : 0;
1636 int pinned = evsel ? evsel->core.attr.pinned : 0;
1637 int exclusive = evsel ? evsel->core.attr.exclusive : 0;
1640 int exclude_GH = evsel ? evsel->exclude_GH : 0;
1748 struct evsel *evsel;
1760 __evlist__for_each_entry(list, evsel) {
1761 if (add && get_event_modifier(&mod, str, evsel))
1764 evsel->core.attr.exclude_user = mod.eu;
1765 evsel->core.attr.exclude_kernel = mod.ek;
1766 evsel->core.attr.exclude_hv = mod.eh;
1767 evsel->core.attr.precise_ip = mod.precise;
1768 evsel->core.attr.exclude_host = mod.eH;
1769 evsel->core.attr.exclude_guest = mod.eG;
1770 evsel->core.attr.exclude_idle = mod.eI;
1771 evsel->exclude_GH = mod.exclude_GH;
1772 evsel->sample_read = mod.sample_read;
1773 evsel->precise_max = mod.precise_max;
1774 evsel->weak_group = mod.weak;
1775 evsel->bpf_counter = mod.bpf_counter;
1777 if (evsel__is_group_leader(evsel)) {
1778 evsel->core.attr.pinned = mod.pinned;
1779 evsel->core.attr.exclusive = mod.exclusive;
1788 struct evsel *evsel;
1790 __evlist__for_each_entry(list, evsel) {
1791 if (!evsel->name) {
1792 evsel->name = strdup(name);
1793 if (!evsel->name)
1855 static int evsel__compute_group_pmu_name(struct evsel *evsel,
1858 struct evsel *leader = evsel__leader(evsel);
1859 struct evsel *pos;
1861 struct perf_pmu *pmu = evsel__find_pmu(evsel);
1872 pr_debug("No PMU found for '%s'\n", evsel__name(evsel));
1893 * non-software PMU. for_each_group_(member|evsel) isn't used as
1894 * the list isn't yet sorted putting evsel's in the same group
1918 evsel->group_pmu_name = strdup(group_pmu_name ?: "fake");
1919 return evsel->group_pmu_name ? 0 : -ENOMEM;
1922 __weak int arch_evlist__cmp(const struct evsel *lhs, const struct evsel *rhs)
1931 const struct evsel *lhs = container_of(lhs_core, struct evsel, core);
1933 const struct evsel *rhs = container_of(rhs_core, struct evsel, core);
1940 * First sort by grouping/leader. Read the leader idx only if the evsel
1985 struct evsel *pos, *cur_leader = NULL;
1996 const struct evsel *pos_leader = evsel__leader(pos);
2027 const struct evsel *pos_leader = evsel__leader(pos);
2070 struct evsel *pos_leader = evsel__leader(pos);
2114 struct evsel *last;
2315 int (*func)(struct evsel *evsel,
2319 struct evsel *last = NULL;
2340 last = list_entry(last->core.node.prev, struct evsel, core.node);
2346 static int set_filter(struct evsel *evsel, const void *arg)
2353 if (evsel == NULL) {
2359 if (evsel->core.attr.type == PERF_TYPE_TRACEPOINT) {
2360 if (evsel__append_tp_filter(evsel, str) < 0) {
2370 if (pmu->type == evsel->core.attr.type) {
2380 return perf_bpf_filter__parse(&evsel->bpf_filters, str);
2382 if (evsel__append_addr_filter(evsel, str) < 0) {
2400 static int add_exclude_perf_filter(struct evsel *evsel,
2405 if (evsel == NULL || evsel->core.attr.type != PERF_TYPE_TRACEPOINT) {
2413 if (evsel__append_tp_filter(evsel, new_filter) < 0) {