| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Copyright (C) 2008,2009, Steven Rostedt <srostedt@redhat.com> |
|---|
| 3 | | - * |
|---|
| 4 | | - * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|---|
| 5 | | - * |
|---|
| 6 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 7 | | - * it under the terms of the GNU General Public License as published by |
|---|
| 8 | | - * the Free Software Foundation; version 2 of the License (not later!) |
|---|
| 9 | | - * |
|---|
| 10 | | - * This program is distributed in the hope that it will be useful, |
|---|
| 11 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 12 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 13 | | - * GNU General Public License for more details. |
|---|
| 14 | | - * |
|---|
| 15 | | - * You should have received a copy of the GNU General Public License |
|---|
| 16 | | - * along with this program; if not, write to the Free Software |
|---|
| 17 | | - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|---|
| 18 | | - * |
|---|
| 19 | | - * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|---|
| 20 | 4 | */ |
|---|
| 21 | | -#include "util.h" |
|---|
| 22 | 5 | #include <dirent.h> |
|---|
| 23 | 6 | #include <mntent.h> |
|---|
| 24 | 7 | #include <stdio.h> |
|---|
| .. | .. |
|---|
| 34 | 17 | #include <stdbool.h> |
|---|
| 35 | 18 | #include <linux/list.h> |
|---|
| 36 | 19 | #include <linux/kernel.h> |
|---|
| 20 | +#include <linux/zalloc.h> |
|---|
| 21 | +#include <internal/lib.h> // page_size |
|---|
| 37 | 22 | |
|---|
| 38 | | -#include "../perf.h" |
|---|
| 39 | 23 | #include "trace-event.h" |
|---|
| 40 | 24 | #include <api/fs/tracing_path.h> |
|---|
| 41 | 25 | #include "evsel.h" |
|---|
| .. | .. |
|---|
| 420 | 404 | get_tracepoints_path(struct list_head *pattrs) |
|---|
| 421 | 405 | { |
|---|
| 422 | 406 | struct tracepoint_path path, *ppath = &path; |
|---|
| 423 | | - struct perf_evsel *pos; |
|---|
| 407 | + struct evsel *pos; |
|---|
| 424 | 408 | int nr_tracepoints = 0; |
|---|
| 425 | 409 | |
|---|
| 426 | | - list_for_each_entry(pos, pattrs, node) { |
|---|
| 427 | | - if (pos->attr.type != PERF_TYPE_TRACEPOINT) |
|---|
| 410 | + list_for_each_entry(pos, pattrs, core.node) { |
|---|
| 411 | + if (pos->core.attr.type != PERF_TYPE_TRACEPOINT) |
|---|
| 428 | 412 | continue; |
|---|
| 429 | 413 | ++nr_tracepoints; |
|---|
| 430 | 414 | |
|---|
| .. | .. |
|---|
| 440 | 424 | } |
|---|
| 441 | 425 | |
|---|
| 442 | 426 | try_id: |
|---|
| 443 | | - ppath->next = tracepoint_id_to_path(pos->attr.config); |
|---|
| 427 | + ppath->next = tracepoint_id_to_path(pos->core.attr.config); |
|---|
| 444 | 428 | if (!ppath->next) { |
|---|
| 445 | 429 | error: |
|---|
| 446 | 430 | pr_debug("No memory to alloc tracepoints list\n"); |
|---|
| 447 | | - put_tracepoints_path(&path); |
|---|
| 431 | + put_tracepoints_path(path.next); |
|---|
| 448 | 432 | return NULL; |
|---|
| 449 | 433 | } |
|---|
| 450 | 434 | next: |
|---|
| .. | .. |
|---|
| 456 | 440 | |
|---|
| 457 | 441 | bool have_tracepoints(struct list_head *pattrs) |
|---|
| 458 | 442 | { |
|---|
| 459 | | - struct perf_evsel *pos; |
|---|
| 443 | + struct evsel *pos; |
|---|
| 460 | 444 | |
|---|
| 461 | | - list_for_each_entry(pos, pattrs, node) |
|---|
| 462 | | - if (pos->attr.type == PERF_TYPE_TRACEPOINT) |
|---|
| 445 | + list_for_each_entry(pos, pattrs, core.node) |
|---|
| 446 | + if (pos->core.attr.type == PERF_TYPE_TRACEPOINT) |
|---|
| 463 | 447 | return true; |
|---|
| 464 | 448 | |
|---|
| 465 | 449 | return false; |
|---|