| .. | .. |
|---|
| 5 | 5 | */ |
|---|
| 6 | 6 | #include "builtin.h" |
|---|
| 7 | 7 | |
|---|
| 8 | | -#include "util/util.h" |
|---|
| 9 | | - |
|---|
| 10 | 8 | #include <linux/list.h> |
|---|
| 11 | 9 | |
|---|
| 12 | 10 | #include "perf.h" |
|---|
| 13 | 11 | #include "util/evlist.h" |
|---|
| 14 | 12 | #include "util/evsel.h" |
|---|
| 13 | +#include "util/evsel_fprintf.h" |
|---|
| 15 | 14 | #include "util/parse-events.h" |
|---|
| 16 | 15 | #include <subcmd/parse-options.h> |
|---|
| 17 | 16 | #include "util/session.h" |
|---|
| 18 | 17 | #include "util/data.h" |
|---|
| 19 | 18 | #include "util/debug.h" |
|---|
| 19 | +#include <linux/err.h> |
|---|
| 20 | 20 | |
|---|
| 21 | 21 | static int __cmd_evlist(const char *file_name, struct perf_attr_details *details) |
|---|
| 22 | 22 | { |
|---|
| 23 | 23 | struct perf_session *session; |
|---|
| 24 | | - struct perf_evsel *pos; |
|---|
| 24 | + struct evsel *pos; |
|---|
| 25 | 25 | struct perf_data data = { |
|---|
| 26 | | - .file = { |
|---|
| 27 | | - .path = file_name, |
|---|
| 28 | | - }, |
|---|
| 26 | + .path = file_name, |
|---|
| 29 | 27 | .mode = PERF_DATA_MODE_READ, |
|---|
| 30 | 28 | .force = details->force, |
|---|
| 31 | 29 | }; |
|---|
| 32 | 30 | bool has_tracepoint = false; |
|---|
| 33 | 31 | |
|---|
| 34 | 32 | session = perf_session__new(&data, 0, NULL); |
|---|
| 35 | | - if (session == NULL) |
|---|
| 36 | | - return -1; |
|---|
| 33 | + if (IS_ERR(session)) |
|---|
| 34 | + return PTR_ERR(session); |
|---|
| 37 | 35 | |
|---|
| 38 | 36 | evlist__for_each_entry(session->evlist, pos) { |
|---|
| 39 | | - perf_evsel__fprintf(pos, details, stdout); |
|---|
| 37 | + evsel__fprintf(pos, details, stdout); |
|---|
| 40 | 38 | |
|---|
| 41 | | - if (pos->attr.type == PERF_TYPE_TRACEPOINT) |
|---|
| 39 | + if (pos->core.attr.type == PERF_TYPE_TRACEPOINT) |
|---|
| 42 | 40 | has_tracepoint = true; |
|---|
| 43 | 41 | } |
|---|
| 44 | 42 | |
|---|