diff options
Diffstat (limited to 'tools/perf/util/db-export.h')
-rw-r--r-- | tools/perf/util/db-export.h | 107 |
1 files changed, 107 insertions, 0 deletions
diff --git a/tools/perf/util/db-export.h b/tools/perf/util/db-export.h new file mode 100644 index 000000000000..adbd22d66798 --- /dev/null +++ b/tools/perf/util/db-export.h | |||
@@ -0,0 +1,107 @@ | |||
1 | /* | ||
2 | * db-export.h: Support for exporting data suitable for import to a database | ||
3 | * 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 | */ | ||
15 | |||
16 | #ifndef __PERF_DB_EXPORT_H | ||
17 | #define __PERF_DB_EXPORT_H | ||
18 | |||
19 | #include <linux/types.h> | ||
20 | #include <linux/list.h> | ||
21 | |||
22 | struct perf_evsel; | ||
23 | struct machine; | ||
24 | struct thread; | ||
25 | struct comm; | ||
26 | struct dso; | ||
27 | struct perf_sample; | ||
28 | struct addr_location; | ||
29 | struct call_return_processor; | ||
30 | struct call_path; | ||
31 | struct call_return; | ||
32 | |||
33 | struct export_sample { | ||
34 | union perf_event *event; | ||
35 | struct perf_sample *sample; | ||
36 | struct perf_evsel *evsel; | ||
37 | struct thread *thread; | ||
38 | struct addr_location *al; | ||
39 | u64 db_id; | ||
40 | u64 comm_db_id; | ||
41 | u64 dso_db_id; | ||
42 | u64 sym_db_id; | ||
43 | u64 offset; /* ip offset from symbol start */ | ||
44 | u64 addr_dso_db_id; | ||
45 | u64 addr_sym_db_id; | ||
46 | u64 addr_offset; /* addr offset from symbol start */ | ||
47 | }; | ||
48 | |||
49 | struct db_export { | ||
50 | int (*export_evsel)(struct db_export *dbe, struct perf_evsel *evsel); | ||
51 | int (*export_machine)(struct db_export *dbe, struct machine *machine); | ||
52 | int (*export_thread)(struct db_export *dbe, struct thread *thread, | ||
53 | u64 main_thread_db_id, struct machine *machine); | ||
54 | int (*export_comm)(struct db_export *dbe, struct comm *comm); | ||
55 | int (*export_comm_thread)(struct db_export *dbe, u64 db_id, | ||
56 | struct comm *comm, struct thread *thread); | ||
57 | int (*export_dso)(struct db_export *dbe, struct dso *dso, | ||
58 | struct machine *machine); | ||
59 | int (*export_symbol)(struct db_export *dbe, struct symbol *sym, | ||
60 | struct dso *dso); | ||
61 | int (*export_branch_type)(struct db_export *dbe, u32 branch_type, | ||
62 | const char *name); | ||
63 | int (*export_sample)(struct db_export *dbe, struct export_sample *es); | ||
64 | int (*export_call_path)(struct db_export *dbe, struct call_path *cp); | ||
65 | int (*export_call_return)(struct db_export *dbe, | ||
66 | struct call_return *cr); | ||
67 | struct call_return_processor *crp; | ||
68 | u64 evsel_last_db_id; | ||
69 | u64 machine_last_db_id; | ||
70 | u64 thread_last_db_id; | ||
71 | u64 comm_last_db_id; | ||
72 | u64 comm_thread_last_db_id; | ||
73 | u64 dso_last_db_id; | ||
74 | u64 symbol_last_db_id; | ||
75 | u64 sample_last_db_id; | ||
76 | u64 call_path_last_db_id; | ||
77 | u64 call_return_last_db_id; | ||
78 | struct list_head deferred; | ||
79 | }; | ||
80 | |||
81 | int db_export__init(struct db_export *dbe); | ||
82 | int db_export__flush(struct db_export *dbe); | ||
83 | void db_export__exit(struct db_export *dbe); | ||
84 | int db_export__evsel(struct db_export *dbe, struct perf_evsel *evsel); | ||
85 | int db_export__machine(struct db_export *dbe, struct machine *machine); | ||
86 | int db_export__thread(struct db_export *dbe, struct thread *thread, | ||
87 | struct machine *machine, struct comm *comm); | ||
88 | int db_export__comm(struct db_export *dbe, struct comm *comm, | ||
89 | struct thread *main_thread); | ||
90 | int db_export__comm_thread(struct db_export *dbe, struct comm *comm, | ||
91 | struct thread *thread); | ||
92 | int db_export__dso(struct db_export *dbe, struct dso *dso, | ||
93 | struct machine *machine); | ||
94 | int db_export__symbol(struct db_export *dbe, struct symbol *sym, | ||
95 | struct dso *dso); | ||
96 | int db_export__branch_type(struct db_export *dbe, u32 branch_type, | ||
97 | const char *name); | ||
98 | int db_export__sample(struct db_export *dbe, union perf_event *event, | ||
99 | struct perf_sample *sample, struct perf_evsel *evsel, | ||
100 | struct thread *thread, struct addr_location *al); | ||
101 | |||
102 | int db_export__branch_types(struct db_export *dbe); | ||
103 | |||
104 | int db_export__call_path(struct db_export *dbe, struct call_path *cp); | ||
105 | int db_export__call_return(struct db_export *dbe, struct call_return *cr); | ||
106 | |||
107 | #endif | ||