hc
2023-12-08 01573e231f18eb2d99162747186f59511f56b64d
kernel/tools/perf/util/db-export.h
....@@ -1,16 +1,7 @@
1
+/* SPDX-License-Identifier: GPL-2.0-only */
12 /*
23 * db-export.h: Support for exporting data suitable for import to a database
34 * 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
- *
145 */
156
167 #ifndef __PERF_DB_EXPORT_H
....@@ -19,7 +10,7 @@
1910 #include <linux/types.h>
2011 #include <linux/list.h>
2112
22
-struct perf_evsel;
13
+struct evsel;
2314 struct machine;
2415 struct thread;
2516 struct comm;
....@@ -34,7 +25,7 @@
3425 struct export_sample {
3526 union perf_event *event;
3627 struct perf_sample *sample;
37
- struct perf_evsel *evsel;
28
+ struct evsel *evsel;
3829 struct addr_location *al;
3930 u64 db_id;
4031 u64 comm_db_id;
....@@ -48,11 +39,12 @@
4839 };
4940
5041 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);
5243 int (*export_machine)(struct db_export *dbe, struct machine *machine);
5344 int (*export_thread)(struct db_export *dbe, struct thread *thread,
5445 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);
5648 int (*export_comm_thread)(struct db_export *dbe, u64 db_id,
5749 struct comm *comm, struct thread *thread);
5850 int (*export_dso)(struct db_export *dbe, struct dso *dso,
....@@ -65,6 +57,11 @@
6557 int (*export_call_path)(struct db_export *dbe, struct call_path *cp);
6658 int (*export_call_return)(struct db_export *dbe,
6759 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);
6865 struct call_return_processor *crp;
6966 struct call_path_root *cpr;
7067 u64 evsel_last_db_id;
....@@ -77,18 +74,19 @@
7774 u64 sample_last_db_id;
7875 u64 call_path_last_db_id;
7976 u64 call_return_last_db_id;
80
- struct list_head deferred;
77
+ u64 context_switch_last_db_id;
8178 };
8279
8380 int db_export__init(struct db_export *dbe);
84
-int db_export__flush(struct db_export *dbe);
8581 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);
8783 int db_export__machine(struct db_export *dbe, struct machine *machine);
8884 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);
9086 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);
9290 int db_export__comm_thread(struct db_export *dbe, struct comm *comm,
9391 struct thread *thread);
9492 int db_export__dso(struct db_export *dbe, struct dso *dso,
....@@ -98,12 +96,15 @@
9896 int db_export__branch_type(struct db_export *dbe, u32 branch_type,
9997 const char *name);
10098 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,
102100 struct addr_location *al);
103101
104102 int db_export__branch_types(struct db_export *dbe);
105103
106104 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);
108109
109110 #endif