| 1 | |
| 2 | #include <sys/time.h>
|
| 3 | #include <sys/prctl.h>
|
| 4 | #include <errno.h>
|
| 5 | #include <limits.h>
|
| 6 | #include <time.h>
|
| 7 | #include <stdlib.h>
|
| 8 | #include <linux/zalloc.h>
|
| 9 | #include <linux/err.h>
|
| 10 | #include <perf/cpumap.h>
|
| 11 | #include <perf/evlist.h>
|
| 12 | #include <perf/mmap.h>
|
| 13 |
|
| 14 | #include "debug.h"
|
| 15 | #include "parse-events.h"
|
| 16 | #include "evlist.h"
|
| 17 | #include "evsel.h"
|
| 18 | #include "thread_map.h"
|
| 19 | #include "record.h"
|
| 20 | #include "tests.h"
|
| 21 | #include "util/mmap.h"
|
| 22 | #include "util/sample.h"
|
| 23 | #include "pmus.h"
|
| 24 |
|
| 25 | static int spin_sleep(void)
|
| 26 | {
|
| 27 | struct timeval start, now, diff, maxtime;
|
| 28 | struct timespec ts;
|
| 29 | int err, i;
|
| 30 |
|
| 31 | maxtime.tv_sec = 0;
|
| 32 | maxtime.tv_usec = 50000;
|
| 33 |
|
| 34 | err = gettimeofday(&start, NULL);
|
| 35 | if (err)
|
| 36 | return err;
|
| 37 |
|
| 38 |
|
| 39 | while (1) {
|
| 40 | for (i = 0; i < 1000; i++)
|
| 41 | barrier();
|
| 42 |
|
| 43 | err = gettimeofday(&now, NULL);
|
| 44 | if (err)
|
| 45 | return err;
|
| 46 |
|
| 47 | timersub(&now, &start, &diff);
|
| 48 | if (timercmp(&diff, &maxtime, > ))
|
| 49 | break;
|
| 50 | }
|
| 51 |
|
| 52 | ts.tv_nsec = 50 * 1000 * 1000;
|
| 53 | ts.tv_sec = 0;
|
| 54 |
|
| 55 |
|
| 56 | err = nanosleep(&ts, NULL);
|
| 57 | if (err == EINTR)
|
| 58 | err = 0;
|
| 59 |
|
| 60 | return err;
|
| 61 | }
|
| 62 |
|
| 63 | struct switch_tracking {
|
| 64 | struct evsel *switch_evsel;
|
| 65 | struct evsel *cycles_evsel;
|
| 66 | pid_t *tids;
|
| 67 | int nr_tids;
|
| 68 | int comm_seen[4];
|
| 69 | int cycles_before_comm_1;
|
| 70 | int cycles_between_comm_2_and_comm_3;
|
| 71 | int cycles_after_comm_4;
|
| 72 | };
|
| 73 |
|
| 74 | static int check_comm(struct switch_tracking *switch_tracking,
|
| 75 | union perf_event *event, const char *comm, int nr)
|
| 76 | {
|
| 77 | if (event->header.type == PERF_RECORD_COMM &&
|
| 78 | (pid_t)event->comm.pid == getpid() &&
|
| 79 | (pid_t)event->comm.tid == getpid() &&
|
| 80 | strcmp(event->comm.comm, comm) == 0) {
|
| 81 | if (switch_tracking->comm_seen[nr]) {
|
| 82 | pr_debug("Duplicate comm event\n");
|
| 83 | return -1;
|
| 84 | }
|
| 85 | switch_tracking->comm_seen[nr] = 1;
|
| 86 | pr_debug3("comm event: %s nr: %d\n", event->comm.comm, nr);
|
| 87 | return 1;
|
| 88 | }
|
| 89 | return 0;
|
| 90 | }
|
| 91 |
|
| 92 | static int check_cpu(struct switch_tracking *switch_tracking, int cpu)
|
| 93 | {
|
| 94 | int i, nr = cpu + 1;
|
| 95 |
|
| 96 | if (cpu < 0)
|
| 97 | return -1;
|
| 98 |
|
| 99 | if (!switch_tracking->tids) {
|
| 100 | switch_tracking->tids = calloc(nr, sizeof(pid_t));
|
| 101 | if (!switch_tracking->tids)
|
| 102 | return -1;
|
| 103 | for (i = 0; i < nr; i++)
|
| 104 | switch_tracking->tids[i] = -1;
|
| 105 | switch_tracking->nr_tids = nr;
|
| 106 | return 0;
|
| 107 | }
|
| 108 |
|
| 109 | if (cpu >= switch_tracking->nr_tids) {
|
| 110 | void *addr;
|
| 111 |
|
| 112 | addr = realloc(switch_tracking->tids, nr * sizeof(pid_t));
|
| 113 | if (!addr)
|
| 114 | return -1;
|
| 115 | switch_tracking->tids = addr;
|
| 116 | for (i = switch_tracking->nr_tids; i < nr; i++)
|
| 117 | switch_tracking->tids[i] = -1;
|
| 118 | switch_tracking->nr_tids = nr;
|
| 119 | return 0;
|
| 120 | }
|
| 121 |
|
| 122 | return 0;
|
| 123 | }
|
| 124 |
|
| 125 | static int process_sample_event(struct evlist *evlist,
|
| 126 | union perf_event *event,
|
| 127 | struct switch_tracking *switch_tracking)
|
| 128 | {
|
| 129 | struct perf_sample sample;
|
| 130 | struct evsel *evsel;
|
| 131 | pid_t next_tid, prev_tid;
|
| 132 | int cpu, err;
|
| 133 |
|
| 134 | perf_sample__init(&sample, false);
|
| 135 | if (evlist__parse_sample(evlist, event, &sample)) {
|
| 136 | pr_debug("evlist__parse_sample failed\n");
|
| 137 | err = -1;
|
| 138 | goto out;
|
| 139 | }
|
| 140 |
|
| 141 | evsel = sample.evsel;
|
| 142 | if (!evsel)
|
| 143 | evsel = evlist__id2evsel(evlist, sample.id);
|
| 144 |
|
| 145 | if (evsel == switch_tracking->switch_evsel) {
|
| 146 | next_tid = perf_sample__intval(&sample, "next_pid");
|
| 147 | prev_tid = perf_sample__intval(&sample, "prev_pid");
|
| 148 | cpu = sample.cpu;
|
| 149 | pr_debug3("sched_switch: cpu: %d prev_tid %d next_tid %d\n",
|
| 150 | cpu, prev_tid, next_tid);
|
| 151 | err = check_cpu(switch_tracking, cpu);
|
| 152 | if (err)
|
| 153 | goto out;
|
| 154 | |
| 155 | * Check for no missing sched_switch events i.e. that the
|
| 156 | * evsel->core.system_wide flag has worked.
|
| 157 |
|
| 158 | if (switch_tracking->tids[cpu] != -1 &&
|
| 159 | switch_tracking->tids[cpu] != prev_tid) {
|
| 160 | pr_debug("Missing sched_switch events\n");
|
| 161 | err = -1;
|
| 162 | goto out;
|
| 163 | }
|
| 164 | switch_tracking->tids[cpu] = next_tid;
|
| 165 | }
|
| 166 |
|
| 167 | if (evsel == switch_tracking->cycles_evsel) {
|
| 168 | pr_debug3("cycles event\n");
|
| 169 | if (!switch_tracking->comm_seen[0])
|
| 170 | switch_tracking->cycles_before_comm_1 = 1;
|
| 171 | if (switch_tracking->comm_seen[1] &&
|
| 172 | !switch_tracking->comm_seen[2])
|
| 173 | switch_tracking->cycles_between_comm_2_and_comm_3 = 1;
|
| 174 | if (switch_tracking->comm_seen[3])
|
| 175 | switch_tracking->cycles_after_comm_4 = 1;
|
| 176 | }
|
| 177 |
|
| 178 | err = 0;
|
| 179 | out:
|
| 180 | perf_sample__exit(&sample);
|
| 181 | return err;
|
| 182 | }
|
| 183 |
|
| 184 | static int process_event(struct evlist *evlist, union perf_event *event,
|
| 185 | struct switch_tracking *switch_tracking)
|
| 186 | {
|
| 187 | if (event->header.type == PERF_RECORD_SAMPLE)
|
| 188 | return process_sample_event(evlist, event, switch_tracking);
|
| 189 |
|
| 190 | if (event->header.type == PERF_RECORD_COMM) {
|
| 191 | int err, done = 0;
|
| 192 |
|
| 193 | err = check_comm(switch_tracking, event, "Test COMM 1", 0);
|
| 194 | if (err < 0)
|
| 195 | return -1;
|
| 196 | done += err;
|
| 197 | err = check_comm(switch_tracking, event, "Test COMM 2", 1);
|
| 198 | if (err < 0)
|
| 199 | return -1;
|
| 200 | done += err;
|
| 201 | err = check_comm(switch_tracking, event, "Test COMM 3", 2);
|
| 202 | if (err < 0)
|
| 203 | return -1;
|
| 204 | done += err;
|
| 205 | err = check_comm(switch_tracking, event, "Test COMM 4", 3);
|
| 206 | if (err < 0)
|
| 207 | return -1;
|
| 208 | done += err;
|
| 209 | if (done != 1) {
|
| 210 | pr_debug("Unexpected comm event\n");
|
| 211 | return -1;
|
| 212 | }
|
| 213 | }
|
| 214 |
|
| 215 | return 0;
|
| 216 | }
|
| 217 |
|
| 218 | struct event_node {
|
| 219 | struct list_head list;
|
| 220 | union perf_event *event;
|
| 221 | u64 event_time;
|
| 222 | };
|
| 223 |
|
| 224 | static int add_event(struct evlist *evlist, struct list_head *events,
|
| 225 | union perf_event *event)
|
| 226 | {
|
| 227 | struct perf_sample sample;
|
| 228 | struct event_node *node;
|
| 229 |
|
| 230 | node = malloc(sizeof(struct event_node));
|
| 231 | if (!node) {
|
| 232 | pr_debug("malloc failed\n");
|
| 233 | return -1;
|
| 234 | }
|
| 235 | node->event = event;
|
| 236 | list_add(&node->list, events);
|
| 237 |
|
| 238 | if (evlist__parse_sample(evlist, event, &sample)) {
|
| 239 | pr_debug("evlist__parse_sample failed\n");
|
| 240 | perf_sample__exit(&sample);
|
| 241 | return -1;
|
| 242 | }
|
| 243 |
|
| 244 | if (!sample.time) {
|
| 245 | pr_debug("event with no time\n");
|
| 246 | perf_sample__exit(&sample);
|
| 247 | return -1;
|
| 248 | }
|
| 249 |
|
| 250 | node->event_time = sample.time;
|
| 251 |
|
| 252 | perf_sample__exit(&sample);
|
| 253 | return 0;
|
| 254 | }
|
| 255 |
|
| 256 | static void free_event_nodes(struct list_head *events)
|
| 257 | {
|
| 258 | struct event_node *node;
|
| 259 |
|
| 260 | while (!list_empty(events)) {
|
| 261 | node = list_entry(events->next, struct event_node, list);
|
| 262 | list_del_init(&node->list);
|
| 263 | free(node);
|
| 264 | }
|
| 265 | }
|
| 266 |
|
| 267 | static int compar(const void *a, const void *b)
|
| 268 | {
|
| 269 | const struct event_node *nodea = a;
|
| 270 | const struct event_node *nodeb = b;
|
| 271 | s64 cmp = nodea->event_time - nodeb->event_time;
|
| 272 |
|
| 273 | return cmp < 0 ? -1 : (cmp > 0 ? 1 : 0);
|
| 274 | }
|
| 275 |
|
| 276 | static int process_events(struct evlist *evlist,
|
| 277 | struct switch_tracking *switch_tracking)
|
| 278 | {
|
| 279 | union perf_event *event;
|
| 280 | unsigned pos, cnt = 0;
|
| 281 | LIST_HEAD(events);
|
| 282 | struct event_node *events_array, *node;
|
| 283 | struct mmap *md;
|
| 284 | int i, ret;
|
| 285 |
|
| 286 | for (i = 0; i < evlist__core(evlist)->nr_mmaps; i++) {
|
| 287 | md = &evlist__mmap(evlist)[i];
|
| 288 | if (perf_mmap__read_init(&md->core) < 0)
|
| 289 | continue;
|
| 290 |
|
| 291 | while ((event = perf_mmap__read_event(&md->core)) != NULL) {
|
| 292 | cnt += 1;
|
| 293 | ret = add_event(evlist, &events, event);
|
| 294 | perf_mmap__consume(&md->core);
|
| 295 | if (ret < 0)
|
| 296 | goto out_free_nodes;
|
| 297 | }
|
| 298 | perf_mmap__read_done(&md->core);
|
| 299 | }
|
| 300 |
|
| 301 | events_array = calloc(cnt, sizeof(struct event_node));
|
| 302 | if (!events_array) {
|
| 303 | pr_debug("calloc failed\n");
|
| 304 | ret = -1;
|
| 305 | goto out_free_nodes;
|
| 306 | }
|
| 307 |
|
| 308 | pos = 0;
|
| 309 | list_for_each_entry(node, &events, list)
|
| 310 | events_array[pos++] = *node;
|
| 311 |
|
| 312 | qsort(events_array, cnt, sizeof(struct event_node), compar);
|
| 313 |
|
| 314 | for (pos = 0; pos < cnt; pos++) {
|
| 315 | ret = process_event(evlist, events_array[pos].event,
|
| 316 | switch_tracking);
|
| 317 | if (ret < 0)
|
| 318 | goto out_free;
|
| 319 | }
|
| 320 |
|
| 321 | ret = 0;
|
| 322 | out_free:
|
| 323 | pr_debug("%u events recorded\n", cnt);
|
| 324 | free(events_array);
|
| 325 | out_free_nodes:
|
| 326 | free_event_nodes(&events);
|
| 327 | return ret;
|
| 328 | }
|
| 329 |
|
| 330 | |
| 331 | * test__switch_tracking - test using sched_switch and tracking events.
|
| 332 | *
|
| 333 | * This function implements a test that checks that sched_switch events and
|
| 334 | * tracking events can be recorded for a workload (current process) using the
|
| 335 | * evsel->core.system_wide and evsel->tracking flags (respectively) with other events
|
| 336 | * sometimes enabled or disabled.
|
| 337 |
|
| 338 | static int test__switch_tracking(struct test_suite *test __maybe_unused, int subtest __maybe_unused)
|
| 339 | {
|
| 340 | const char *sched_switch = "sched:sched_switch";
|
| 341 | const char *cycles = "cpu-cycles:u";
|
| 342 | struct switch_tracking switch_tracking = { .tids = NULL, };
|
| 343 | struct record_opts opts = {
|
| 344 | .mmap_pages = UINT_MAX,
|
| 345 | .user_freq = UINT_MAX,
|
| 346 | .user_interval = ULLONG_MAX,
|
| 347 | .freq = 4000,
|
| 348 | .target = {
|
| 349 | .uses_mmap = true,
|
| 350 | },
|
| 351 | };
|
| 352 | struct perf_thread_map *threads = NULL;
|
| 353 | struct perf_cpu_map *cpus = NULL;
|
| 354 | struct evlist *evlist = NULL;
|
| 355 | struct evsel *evsel, *cpu_clocks_evsel, *cycles_evsel;
|
| 356 | struct evsel *switch_evsel, *tracking_evsel;
|
| 357 | const char *comm;
|
| 358 | int err = -1;
|
| 359 |
|
| 360 | threads = thread_map__new_by_tid(getpid());
|
| 361 | if (!threads) {
|
| 362 | pr_debug("thread_map__new failed!\n");
|
| 363 | goto out_err;
|
| 364 | }
|
| 365 |
|
| 366 | cpus = perf_cpu_map__new_online_cpus();
|
| 367 | if (!cpus) {
|
| 368 | pr_debug("perf_cpu_map__new failed!\n");
|
| 369 | goto out_err;
|
| 370 | }
|
| 371 |
|
| 372 | evlist = evlist__new();
|
| 373 | if (!evlist) {
|
| 374 | pr_debug("evlist__new failed!\n");
|
| 375 | goto out_err;
|
| 376 | }
|
| 377 |
|
| 378 | perf_evlist__set_maps(evlist__core(evlist), cpus, threads);
|
| 379 |
|
| 380 |
|
| 381 | err = parse_event(evlist, "cpu-clock:u");
|
| 382 | if (err) {
|
| 383 | pr_debug("Failed to parse event dummy:u\n");
|
| 384 | goto out_err;
|
| 385 | }
|
| 386 |
|
| 387 | cpu_clocks_evsel = evlist__last(evlist);
|
| 388 |
|
| 389 |
|
| 390 | err = parse_event(evlist, cycles);
|
| 391 | if (err) {
|
| 392 | pr_debug("Failed to parse event %s\n", cycles);
|
| 393 | goto out_err;
|
| 394 | }
|
| 395 |
|
| 396 | cycles_evsel = evlist__last(evlist);
|
| 397 |
|
| 398 |
|
| 399 | if (!evlist__can_select_event(evlist, sched_switch)) {
|
| 400 | pr_debug("No sched_switch\n");
|
| 401 | err = 0;
|
| 402 | goto out;
|
| 403 | }
|
| 404 |
|
| 405 | switch_evsel = evlist__add_sched_switch(evlist, true);
|
| 406 | if (IS_ERR(switch_evsel)) {
|
| 407 | err = PTR_ERR(switch_evsel);
|
| 408 | pr_debug("Failed to create event %s\n", sched_switch);
|
| 409 | goto out_err;
|
| 410 | }
|
| 411 |
|
| 412 | switch_evsel->immediate = true;
|
| 413 |
|
| 414 |
|
| 415 | if (cycles_evsel == evlist__first(evlist)) {
|
| 416 | pr_debug("cycles event already at front");
|
| 417 | goto out_err;
|
| 418 | }
|
| 419 | evlist__to_front(evlist, cycles_evsel);
|
| 420 | if (cycles_evsel != evlist__first(evlist)) {
|
| 421 | pr_debug("Failed to move cycles event to front");
|
| 422 | goto out_err;
|
| 423 | }
|
| 424 |
|
| 425 | evsel__set_sample_bit(cycles_evsel, CPU);
|
| 426 | evsel__set_sample_bit(cycles_evsel, TIME);
|
| 427 |
|
| 428 |
|
| 429 | err = parse_event(evlist, "dummy:u");
|
| 430 | if (err) {
|
| 431 | pr_debug("Failed to parse event dummy:u\n");
|
| 432 | goto out_err;
|
| 433 | }
|
| 434 |
|
| 435 | tracking_evsel = evlist__last(evlist);
|
| 436 |
|
| 437 | evlist__set_tracking_event(evlist, tracking_evsel);
|
| 438 |
|
| 439 | tracking_evsel->core.attr.freq = 0;
|
| 440 | tracking_evsel->core.attr.sample_period = 1;
|
| 441 |
|
| 442 | evsel__set_sample_bit(tracking_evsel, TIME);
|
| 443 |
|
| 444 |
|
| 445 | evlist__config(evlist, &opts, NULL);
|
| 446 |
|
| 447 |
|
| 448 | if (cycles_evsel != evlist__first(evlist)) {
|
| 449 | pr_debug("Front event no longer at front");
|
| 450 | goto out_err;
|
| 451 | }
|
| 452 |
|
| 453 |
|
| 454 | if (!tracking_evsel->core.attr.mmap || !tracking_evsel->core.attr.comm) {
|
| 455 | pr_debug("Tracking event not tracking\n");
|
| 456 | goto out_err;
|
| 457 | }
|
| 458 |
|
| 459 |
|
| 460 | evlist__for_each_entry(evlist, evsel) {
|
| 461 | if (evsel != tracking_evsel) {
|
| 462 | if (evsel->core.attr.mmap || evsel->core.attr.comm) {
|
| 463 | pr_debug("Non-tracking event is tracking\n");
|
| 464 | goto out_err;
|
| 465 | }
|
| 466 | }
|
| 467 | }
|
| 468 |
|
| 469 | if (evlist__open(evlist) < 0) {
|
| 470 | pr_debug("Not supported\n");
|
| 471 | err = 0;
|
| 472 | goto out;
|
| 473 | }
|
| 474 |
|
| 475 | err = evlist__do_mmap(evlist, UINT_MAX);
|
| 476 | if (err) {
|
| 477 | pr_debug("evlist__mmap failed!\n");
|
| 478 | goto out_err;
|
| 479 | }
|
| 480 |
|
| 481 | evlist__enable(evlist);
|
| 482 |
|
| 483 | err = evsel__disable(cpu_clocks_evsel);
|
| 484 | if (err) {
|
| 485 | pr_debug("perf_evlist__disable_event failed!\n");
|
| 486 | goto out_err;
|
| 487 | }
|
| 488 |
|
| 489 | err = spin_sleep();
|
| 490 | if (err) {
|
| 491 | pr_debug("spin_sleep failed!\n");
|
| 492 | goto out_err;
|
| 493 | }
|
| 494 |
|
| 495 | comm = "Test COMM 1";
|
| 496 | err = prctl(PR_SET_NAME, (unsigned long)comm, 0, 0, 0);
|
| 497 | if (err) {
|
| 498 | pr_debug("PR_SET_NAME failed!\n");
|
| 499 | goto out_err;
|
| 500 | }
|
| 501 |
|
| 502 | err = evsel__disable(cycles_evsel);
|
| 503 | if (err) {
|
| 504 | pr_debug("perf_evlist__disable_event failed!\n");
|
| 505 | goto out_err;
|
| 506 | }
|
| 507 |
|
| 508 | comm = "Test COMM 2";
|
| 509 | err = prctl(PR_SET_NAME, (unsigned long)comm, 0, 0, 0);
|
| 510 | if (err) {
|
| 511 | pr_debug("PR_SET_NAME failed!\n");
|
| 512 | goto out_err;
|
| 513 | }
|
| 514 |
|
| 515 | err = spin_sleep();
|
| 516 | if (err) {
|
| 517 | pr_debug("spin_sleep failed!\n");
|
| 518 | goto out_err;
|
| 519 | }
|
| 520 |
|
| 521 | comm = "Test COMM 3";
|
| 522 | err = prctl(PR_SET_NAME, (unsigned long)comm, 0, 0, 0);
|
| 523 | if (err) {
|
| 524 | pr_debug("PR_SET_NAME failed!\n");
|
| 525 | goto out_err;
|
| 526 | }
|
| 527 |
|
| 528 | err = evsel__enable(cycles_evsel);
|
| 529 | if (err) {
|
| 530 | pr_debug("perf_evlist__disable_event failed!\n");
|
| 531 | goto out_err;
|
| 532 | }
|
| 533 |
|
| 534 | comm = "Test COMM 4";
|
| 535 | err = prctl(PR_SET_NAME, (unsigned long)comm, 0, 0, 0);
|
| 536 | if (err) {
|
| 537 | pr_debug("PR_SET_NAME failed!\n");
|
| 538 | goto out_err;
|
| 539 | }
|
| 540 |
|
| 541 | err = spin_sleep();
|
| 542 | if (err) {
|
| 543 | pr_debug("spin_sleep failed!\n");
|
| 544 | goto out_err;
|
| 545 | }
|
| 546 |
|
| 547 | evlist__disable(evlist);
|
| 548 |
|
| 549 | switch_tracking.switch_evsel = switch_evsel;
|
| 550 | switch_tracking.cycles_evsel = cycles_evsel;
|
| 551 |
|
| 552 | err = process_events(evlist, &switch_tracking);
|
| 553 |
|
| 554 | zfree(&switch_tracking.tids);
|
| 555 |
|
| 556 | if (err)
|
| 557 | goto out_err;
|
| 558 |
|
| 559 |
|
| 560 | if (!switch_tracking.comm_seen[0] || !switch_tracking.comm_seen[1] ||
|
| 561 | !switch_tracking.comm_seen[2] || !switch_tracking.comm_seen[3]) {
|
| 562 | pr_debug("Missing comm events\n");
|
| 563 | goto out_err;
|
| 564 | }
|
| 565 |
|
| 566 |
|
| 567 | if (!switch_tracking.cycles_before_comm_1) {
|
| 568 | pr_debug("Missing cycles events\n");
|
| 569 | goto out_err;
|
| 570 | }
|
| 571 |
|
| 572 |
|
| 573 | if (switch_tracking.cycles_between_comm_2_and_comm_3) {
|
| 574 | pr_debug("cycles events even though event was disabled\n");
|
| 575 | goto out_err;
|
| 576 | }
|
| 577 |
|
| 578 |
|
| 579 | if (!switch_tracking.cycles_after_comm_4) {
|
| 580 | pr_debug("Missing cycles events\n");
|
| 581 | goto out_err;
|
| 582 | }
|
| 583 | out:
|
| 584 | if (evlist) {
|
| 585 | evlist__disable(evlist);
|
| 586 | evlist__put(evlist);
|
| 587 | }
|
| 588 | perf_cpu_map__put(cpus);
|
| 589 | perf_thread_map__put(threads);
|
| 590 |
|
| 591 | return err;
|
| 592 |
|
| 593 | out_err:
|
| 594 | err = -1;
|
| 595 | goto out;
|
| 596 | }
|
| 597 |
|
| 598 | DEFINE_SUITE_EXCLUSIVE("Track with sched_switch", switch_tracking);
|