hc
2024-05-14 bedbef8ad3e75a304af6361af235302bcc61d06b
kernel/tools/perf/util/trace-event-info.c
....@@ -1,24 +1,7 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * 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
- * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
204 */
21
-#include "util.h"
225 #include <dirent.h>
236 #include <mntent.h>
247 #include <stdio.h>
....@@ -34,8 +17,9 @@
3417 #include <stdbool.h>
3518 #include <linux/list.h>
3619 #include <linux/kernel.h>
20
+#include <linux/zalloc.h>
21
+#include <internal/lib.h> // page_size
3722
38
-#include "../perf.h"
3923 #include "trace-event.h"
4024 #include <api/fs/tracing_path.h>
4125 #include "evsel.h"
....@@ -420,11 +404,11 @@
420404 get_tracepoints_path(struct list_head *pattrs)
421405 {
422406 struct tracepoint_path path, *ppath = &path;
423
- struct perf_evsel *pos;
407
+ struct evsel *pos;
424408 int nr_tracepoints = 0;
425409
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)
428412 continue;
429413 ++nr_tracepoints;
430414
....@@ -440,11 +424,11 @@
440424 }
441425
442426 try_id:
443
- ppath->next = tracepoint_id_to_path(pos->attr.config);
427
+ ppath->next = tracepoint_id_to_path(pos->core.attr.config);
444428 if (!ppath->next) {
445429 error:
446430 pr_debug("No memory to alloc tracepoints list\n");
447
- put_tracepoints_path(&path);
431
+ put_tracepoints_path(path.next);
448432 return NULL;
449433 }
450434 next:
....@@ -456,10 +440,10 @@
456440
457441 bool have_tracepoints(struct list_head *pattrs)
458442 {
459
- struct perf_evsel *pos;
443
+ struct evsel *pos;
460444
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)
463447 return true;
464448
465449 return false;