Lines Matching defs:evsel
26 #include <perf/evsel.h>
1606 struct evsel *evsel;
1615 evlist__for_each_entry(evlist, evsel)
1616 nr += evsel->core.ids;
1628 evlist__for_each_entry(evlist, evsel) {
1631 for (j = 0; j < evsel->core.ids; j++) {
1645 e->id = evsel->core.id[j];
1711 int perf_event__synthesize_event_update_unit(struct perf_tool *tool, struct evsel *evsel,
1714 size_t size = strlen(evsel->unit);
1718 ev = event_update_event__new(size + 1, PERF_EVENT_UPDATE__UNIT, evsel->core.id[0]);
1722 strlcpy(ev->data, evsel->unit, size + 1);
1728 int perf_event__synthesize_event_update_scale(struct perf_tool *tool, struct evsel *evsel,
1735 ev = event_update_event__new(sizeof(*ev_data), PERF_EVENT_UPDATE__SCALE, evsel->core.id[0]);
1740 ev_data->scale = evsel->scale;
1746 int perf_event__synthesize_event_update_name(struct perf_tool *tool, struct evsel *evsel,
1750 size_t len = strlen(evsel->name);
1753 ev = event_update_event__new(len + 1, PERF_EVENT_UPDATE__NAME, evsel->core.id[0]);
1757 strlcpy(ev->data, evsel->name, len + 1);
1763 int perf_event__synthesize_event_update_cpus(struct perf_tool *tool, struct evsel *evsel,
1771 if (!evsel->core.own_cpus)
1774 ev = cpu_map_data__alloc(evsel->core.own_cpus, &size, &type, &max);
1781 ev->id = evsel->core.id[0];
1784 evsel->core.own_cpus, type, max);
1794 struct evsel *evsel;
1797 evlist__for_each_entry(evlist, evsel) {
1798 err = perf_event__synthesize_attr(tool, &evsel->core.attr, evsel->core.ids,
1799 evsel->core.id, process);
1809 static bool has_unit(struct evsel *evsel)
1811 return evsel->unit && *evsel->unit;
1814 static bool has_scale(struct evsel *evsel)
1816 return evsel->scale != 1;
1822 struct evsel *evsel;
1829 evlist__for_each_entry(evsel_list, evsel) {
1830 if (!evsel->supported)
1836 if (has_unit(evsel)) {
1837 err = perf_event__synthesize_event_update_unit(tool, evsel, process);
1839 pr_err("Couldn't synthesize evsel unit.\n");
1844 if (has_scale(evsel)) {
1845 err = perf_event__synthesize_event_update_scale(tool, evsel, process);
1847 pr_err("Couldn't synthesize evsel evsel.\n");
1852 if (evsel->core.own_cpus) {
1853 err = perf_event__synthesize_event_update_cpus(tool, evsel, process);
1855 pr_err("Couldn't synthesize evsel cpus.\n");
1865 err = perf_event__synthesize_event_update_name(tool, evsel, process);
1867 pr_err("Couldn't synthesize evsel name.\n");