Lines Matching refs:evsel

12 #include "evsel.h"
226 static struct evsel *
234 struct evsel *evsel;
254 evsel = evsel__new_idx(attr, *idx);
255 if (!evsel) {
261 evsel->core.cpus = cpus;
262 evsel->core.own_cpus = perf_cpu_map__get(cpus);
263 evsel->core.requires_cpu = pmu ? pmu->is_uncore : false;
264 evsel->core.is_pmu_core = pmu ? pmu->is_core : false;
265 evsel->auto_merge_stats = auto_merge_stats;
266 evsel->pmu = pmu;
267 evsel->pmu_name = pmu ? strdup(pmu->name) : NULL;
270 evsel->name = strdup(name);
273 evsel->metric_id = strdup(metric_id);
276 list_splice_init(config_terms, &evsel->config_terms);
279 list_add_tail(&evsel->core.node, list);
281 return evsel;
284 struct evsel *parse_events__add_event(int idx, struct perf_event_attr *attr,
305 struct evsel *evsel;
311 evsel = __add_event(list, idx, &attr, /*init_attr=*/true, /*name=*/NULL,
315 if (!evsel)
317 evsel->tool_event = tool_event;
321 free((char *)evsel->unit);
322 evsel->unit = strdup("ns");
528 struct evsel *evsel = evsel__newtp_idx(sys_name, evt_name, (*idx)++);
530 if (IS_ERR(evsel)) {
531 tracepoint_error(err, PTR_ERR(evsel), sys_name, evt_name, loc->first_column);
532 return PTR_ERR(evsel);
540 list_splice(&config_terms, &evsel->config_terms);
543 list_add_tail(&evsel->core.node, list);
1396 struct evsel *evsel;
1446 evsel = __add_event(list, &parse_state->idx, &attr,
1451 return evsel ? 0 : -ENOMEM;
1505 evsel = __add_event(list, &parse_state->idx, &attr, /*init_attr=*/true,
1509 if (!evsel) {
1514 if (evsel->name)
1515 evsel->use_config_name = true;
1517 evsel->percore = config_term_percore(&evsel->config_terms);
1525 free((char *)evsel->unit);
1526 evsel->unit = strdup(info.unit);
1527 evsel->scale = info.scale;
1528 evsel->per_pkg = info.per_pkg;
1529 evsel->snapshot = info.snapshot;
1629 struct evsel *leader;
1636 leader = list_first_entry(list, struct evsel, core.node);
1672 struct evsel *evsel)
1674 int eu = evsel ? evsel->core.attr.exclude_user : 0;
1675 int ek = evsel ? evsel->core.attr.exclude_kernel : 0;
1676 int eh = evsel ? evsel->core.attr.exclude_hv : 0;
1677 int eH = evsel ? evsel->core.attr.exclude_host : 0;
1678 int eG = evsel ? evsel->core.attr.exclude_guest : 0;
1679 int eI = evsel ? evsel->core.attr.exclude_idle : 0;
1680 int precise = evsel ? evsel->core.attr.precise_ip : 0;
1683 int pinned = evsel ? evsel->core.attr.pinned : 0;
1684 int exclusive = evsel ? evsel->core.attr.exclusive : 0;
1687 int exclude_GH = evsel ? evsel->exclude_GH : 0;
1795 struct evsel *evsel;
1807 __evlist__for_each_entry(list, evsel) {
1808 if (add && get_event_modifier(&mod, str, evsel))
1811 evsel->core.attr.exclude_user = mod.eu;
1812 evsel->core.attr.exclude_kernel = mod.ek;
1813 evsel->core.attr.exclude_hv = mod.eh;
1814 evsel->core.attr.precise_ip = mod.precise;
1815 evsel->core.attr.exclude_host = mod.eH;
1816 evsel->core.attr.exclude_guest = mod.eG;
1817 evsel->core.attr.exclude_idle = mod.eI;
1818 evsel->exclude_GH = mod.exclude_GH;
1819 evsel->sample_read = mod.sample_read;
1820 evsel->precise_max = mod.precise_max;
1821 evsel->weak_group = mod.weak;
1822 evsel->bpf_counter = mod.bpf_counter;
1824 if (evsel__is_group_leader(evsel)) {
1825 evsel->core.attr.pinned = mod.pinned;
1826 evsel->core.attr.exclusive = mod.exclusive;
1835 struct evsel *evsel;
1837 __evlist__for_each_entry(list, evsel) {
1838 if (!evsel->name) {
1839 evsel->name = strdup(name);
1840 if (!evsel->name)
1898 static int evsel__compute_group_pmu_name(struct evsel *evsel,
1901 struct evsel *leader = evsel__leader(evsel);
1902 struct evsel *pos;
1904 struct perf_pmu *pmu = evsel__find_pmu(evsel);
1915 pr_debug("No PMU found for '%s'\n", evsel__name(evsel));
1936 * non-software PMU. for_each_group_(member|evsel) isn't used as
1937 * the list isn't yet sorted putting evsel's in the same group
1961 evsel->group_pmu_name = strdup(group_pmu_name ?: "fake");
1962 return evsel->group_pmu_name ? 0 : -ENOMEM;
1965 __weak int arch_evlist__cmp(const struct evsel *lhs, const struct evsel *rhs)
1974 const struct evsel *lhs = container_of(lhs_core, struct evsel, core);
1976 const struct evsel *rhs = container_of(rhs_core, struct evsel, core);
1983 * First sort by grouping/leader. Read the leader idx only if the evsel
2028 struct evsel *pos, *cur_leader = NULL;
2039 const struct evsel *pos_leader = evsel__leader(pos);
2070 const struct evsel *pos_leader = evsel__leader(pos);
2113 struct evsel *pos_leader = evsel__leader(pos);
2157 struct evsel *last;
2376 int (*func)(struct evsel *evsel,
2380 struct evsel *last = NULL;
2401 last = list_entry(last->core.node.prev, struct evsel, core.node);
2407 static int set_filter(struct evsel *evsel, const void *arg)
2414 if (evsel == NULL) {
2420 if (evsel->core.attr.type == PERF_TYPE_TRACEPOINT) {
2421 if (evsel__append_tp_filter(evsel, str) < 0) {
2431 if (pmu->type == evsel->core.attr.type) {
2441 return perf_bpf_filter__parse(&evsel->bpf_filters, str);
2443 if (evsel__append_addr_filter(evsel, str) < 0) {
2461 static int add_exclude_perf_filter(struct evsel *evsel,
2466 if (evsel == NULL || evsel->core.attr.type != PERF_TYPE_TRACEPOINT) {
2474 if (evsel__append_tp_filter(evsel, new_filter) < 0) {