.. | .. |
---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-only */ |
---|
1 | 2 | /* |
---|
2 | 3 | * db-export.h: Support for exporting data suitable for import to a database |
---|
3 | 4 | * Copyright (c) 2014, Intel Corporation. |
---|
4 | | - * |
---|
5 | | - * This program is free software; you can redistribute it and/or modify it |
---|
6 | | - * under the terms and conditions of the GNU General Public License, |
---|
7 | | - * version 2, as published by the Free Software Foundation. |
---|
8 | | - * |
---|
9 | | - * This program is distributed in the hope it will be useful, but WITHOUT |
---|
10 | | - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
---|
11 | | - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
---|
12 | | - * more details. |
---|
13 | | - * |
---|
14 | 5 | */ |
---|
15 | 6 | |
---|
16 | 7 | #ifndef __PERF_DB_EXPORT_H |
---|
.. | .. |
---|
19 | 10 | #include <linux/types.h> |
---|
20 | 11 | #include <linux/list.h> |
---|
21 | 12 | |
---|
22 | | -struct perf_evsel; |
---|
| 13 | +struct evsel; |
---|
23 | 14 | struct machine; |
---|
24 | 15 | struct thread; |
---|
25 | 16 | struct comm; |
---|
.. | .. |
---|
34 | 25 | struct export_sample { |
---|
35 | 26 | union perf_event *event; |
---|
36 | 27 | struct perf_sample *sample; |
---|
37 | | - struct perf_evsel *evsel; |
---|
| 28 | + struct evsel *evsel; |
---|
38 | 29 | struct addr_location *al; |
---|
39 | 30 | u64 db_id; |
---|
40 | 31 | u64 comm_db_id; |
---|
.. | .. |
---|
48 | 39 | }; |
---|
49 | 40 | |
---|
50 | 41 | struct db_export { |
---|
51 | | - int (*export_evsel)(struct db_export *dbe, struct perf_evsel *evsel); |
---|
| 42 | + int (*export_evsel)(struct db_export *dbe, struct evsel *evsel); |
---|
52 | 43 | int (*export_machine)(struct db_export *dbe, struct machine *machine); |
---|
53 | 44 | int (*export_thread)(struct db_export *dbe, struct thread *thread, |
---|
54 | 45 | u64 main_thread_db_id, struct machine *machine); |
---|
55 | | - int (*export_comm)(struct db_export *dbe, struct comm *comm); |
---|
| 46 | + int (*export_comm)(struct db_export *dbe, struct comm *comm, |
---|
| 47 | + struct thread *thread); |
---|
56 | 48 | int (*export_comm_thread)(struct db_export *dbe, u64 db_id, |
---|
57 | 49 | struct comm *comm, struct thread *thread); |
---|
58 | 50 | int (*export_dso)(struct db_export *dbe, struct dso *dso, |
---|
.. | .. |
---|
65 | 57 | int (*export_call_path)(struct db_export *dbe, struct call_path *cp); |
---|
66 | 58 | int (*export_call_return)(struct db_export *dbe, |
---|
67 | 59 | struct call_return *cr); |
---|
| 60 | + int (*export_context_switch)(struct db_export *dbe, u64 db_id, |
---|
| 61 | + struct machine *machine, |
---|
| 62 | + struct perf_sample *sample, |
---|
| 63 | + u64 th_out_id, u64 comm_out_id, |
---|
| 64 | + u64 th_in_id, u64 comm_in_id, int flags); |
---|
68 | 65 | struct call_return_processor *crp; |
---|
69 | 66 | struct call_path_root *cpr; |
---|
70 | 67 | u64 evsel_last_db_id; |
---|
.. | .. |
---|
77 | 74 | u64 sample_last_db_id; |
---|
78 | 75 | u64 call_path_last_db_id; |
---|
79 | 76 | u64 call_return_last_db_id; |
---|
80 | | - struct list_head deferred; |
---|
| 77 | + u64 context_switch_last_db_id; |
---|
81 | 78 | }; |
---|
82 | 79 | |
---|
83 | 80 | int db_export__init(struct db_export *dbe); |
---|
84 | | -int db_export__flush(struct db_export *dbe); |
---|
85 | 81 | void db_export__exit(struct db_export *dbe); |
---|
86 | | -int db_export__evsel(struct db_export *dbe, struct perf_evsel *evsel); |
---|
| 82 | +int db_export__evsel(struct db_export *dbe, struct evsel *evsel); |
---|
87 | 83 | int db_export__machine(struct db_export *dbe, struct machine *machine); |
---|
88 | 84 | int db_export__thread(struct db_export *dbe, struct thread *thread, |
---|
89 | | - struct machine *machine, struct comm *comm); |
---|
| 85 | + struct machine *machine, struct thread *main_thread); |
---|
90 | 86 | int db_export__comm(struct db_export *dbe, struct comm *comm, |
---|
91 | | - struct thread *main_thread); |
---|
| 87 | + struct thread *thread); |
---|
| 88 | +int db_export__exec_comm(struct db_export *dbe, struct comm *comm, |
---|
| 89 | + struct thread *main_thread); |
---|
92 | 90 | int db_export__comm_thread(struct db_export *dbe, struct comm *comm, |
---|
93 | 91 | struct thread *thread); |
---|
94 | 92 | int db_export__dso(struct db_export *dbe, struct dso *dso, |
---|
.. | .. |
---|
98 | 96 | int db_export__branch_type(struct db_export *dbe, u32 branch_type, |
---|
99 | 97 | const char *name); |
---|
100 | 98 | int db_export__sample(struct db_export *dbe, union perf_event *event, |
---|
101 | | - struct perf_sample *sample, struct perf_evsel *evsel, |
---|
| 99 | + struct perf_sample *sample, struct evsel *evsel, |
---|
102 | 100 | struct addr_location *al); |
---|
103 | 101 | |
---|
104 | 102 | int db_export__branch_types(struct db_export *dbe); |
---|
105 | 103 | |
---|
106 | 104 | int db_export__call_path(struct db_export *dbe, struct call_path *cp); |
---|
107 | | -int db_export__call_return(struct db_export *dbe, struct call_return *cr); |
---|
| 105 | +int db_export__call_return(struct db_export *dbe, struct call_return *cr, |
---|
| 106 | + u64 *parent_db_id); |
---|
| 107 | +int db_export__switch(struct db_export *dbe, union perf_event *event, |
---|
| 108 | + struct perf_sample *sample, struct machine *machine); |
---|
108 | 109 | |
---|
109 | 110 | #endif |
---|