hc
2024-05-10 cde9070d9970eef1f7ec2360586c802a16230ad8
kernel/tools/perf/util/thread.h
....@@ -5,22 +5,36 @@
55 #include <linux/refcount.h>
66 #include <linux/rbtree.h>
77 #include <linux/list.h>
8
+#include <stdio.h>
89 #include <unistd.h>
910 #include <sys/types.h>
10
-#include "symbol.h"
11
+#include "srccode.h"
12
+#include "symbol_conf.h"
1113 #include <strlist.h>
1214 #include <intlist.h>
1315 #include "rwsem.h"
16
+#include "event.h"
17
+#include "callchain.h"
1418
19
+struct addr_location;
20
+struct map;
21
+struct perf_record_namespaces;
1522 struct thread_stack;
1623 struct unwind_libunwind_ops;
24
+
25
+struct lbr_stitch {
26
+ struct list_head lists;
27
+ struct list_head free_lists;
28
+ struct perf_sample prev_sample;
29
+ struct callchain_cursor_node *prev_lbr_cursor;
30
+};
1731
1832 struct thread {
1933 union {
2034 struct rb_node rb_node;
2135 struct list_head node;
2236 };
23
- struct map_groups *mg;
37
+ struct maps *maps;
2438 pid_t pid_; /* Not all tools update this */
2539 pid_t tid;
2640 pid_t ppid;
....@@ -38,10 +52,13 @@
3852 void *priv;
3953 struct thread_stack *ts;
4054 struct nsinfo *nsinfo;
41
-#ifdef HAVE_LIBUNWIND_SUPPORT
42
- void *addr_space;
43
- struct unwind_libunwind_ops *unwind_libunwind_ops;
44
-#endif
55
+ struct srccode_state srccode_state;
56
+ bool filter;
57
+ int filter_entry_depth;
58
+
59
+ /* LBR call stack stitch */
60
+ bool lbr_stitch_enable;
61
+ struct lbr_stitch *lbr_stitch;
4562 };
4663
4764 struct machine;
....@@ -49,7 +66,7 @@
4966 struct comm;
5067
5168 struct thread *thread__new(pid_t pid, pid_t tid);
52
-int thread__init_map_groups(struct thread *thread, struct machine *machine);
69
+int thread__init_maps(struct thread *thread, struct machine *machine);
5370 void thread__delete(struct thread *thread);
5471
5572 struct thread *thread__get(struct thread *thread);
....@@ -68,9 +85,9 @@
6885 thread->dead = true;
6986 }
7087
71
-struct namespaces *thread__namespaces(const struct thread *thread);
88
+struct namespaces *thread__namespaces(struct thread *thread);
7289 int thread__set_namespaces(struct thread *thread, u64 timestamp,
73
- struct namespaces_event *event);
90
+ struct perf_record_namespaces *event);
7491
7592 int __thread__set_comm(struct thread *thread, const char *comm, u64 timestamp,
7693 bool exec);
....@@ -85,9 +102,9 @@
85102 int thread__comm_len(struct thread *thread);
86103 struct comm *thread__comm(const struct thread *thread);
87104 struct comm *thread__exec_comm(const struct thread *thread);
88
-const char *thread__comm_str(const struct thread *thread);
105
+const char *thread__comm_str(struct thread *thread);
89106 int thread__insert_map(struct thread *thread, struct map *map);
90
-int thread__fork(struct thread *thread, struct thread *parent, u64 timestamp);
107
+int thread__fork(struct thread *thread, struct thread *parent, u64 timestamp, bool do_maps_clone);
91108 size_t thread__fprintf(struct thread *thread, FILE *fp);
92109
93110 struct thread *thread__main_thread(struct machine *machine, struct thread *thread);
....@@ -104,6 +121,9 @@
104121
105122 void thread__find_cpumode_addr_location(struct thread *thread, u64 addr,
106123 struct addr_location *al);
124
+
125
+int thread__memcpy(struct thread *thread, struct machine *machine,
126
+ void *buf, u64 ip, int len, bool *is64bit);
107127
108128 static inline void *thread__priv(struct thread *thread)
109129 {
....@@ -135,4 +155,6 @@
135155 return false;
136156 }
137157
158
+void thread__free_stitch_list(struct thread *thread);
159
+
138160 #endif /* __PERF_THREAD_H */