diff options
author | Khem Raj <raj.khem@gmail.com> | 2023-01-06 17:35:06 -0800 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2023-01-06 17:37:58 -0800 |
commit | e2116edf7b7a9563e2e6a7493a3c5ffb8d8c54ae (patch) | |
tree | dcda700c749144b6aac2693998a37ee2b63526f4 /meta-oe/recipes-kernel/trace-cmd | |
parent | b713e454c1e4cbd7c02d3db73122c13fcd5d9372 (diff) | |
download | meta-openembedded-e2116edf7b7a9563e2e6a7493a3c5ffb8d8c54ae.tar.gz |
trace-cmd: Upgrade to 3.1.5
= Drop uneeded 0001-trace-cmd-make-it-build-with-musl.patch
- Update LFS64 patch with the upstream submitted one
- Add a patch to remove useless rpaths
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-oe/recipes-kernel/trace-cmd')
6 files changed, 1201 insertions, 590 deletions
diff --git a/meta-oe/recipes-kernel/trace-cmd/files/0001-Do-not-emit-useless-rpath.patch b/meta-oe/recipes-kernel/trace-cmd/files/0001-Do-not-emit-useless-rpath.patch new file mode 100644 index 000000000..13a86e65d --- /dev/null +++ b/meta-oe/recipes-kernel/trace-cmd/files/0001-Do-not-emit-useless-rpath.patch | |||
@@ -0,0 +1,34 @@ | |||
1 | From 90fbc3423b5ccdbd54b5851c32b9f92c6658d634 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Fri, 6 Jan 2023 17:30:24 -0800 | ||
4 | Subject: [PATCH] Do not emit useless rpath | ||
5 | |||
6 | rpath is pointing to standard libdir which is un-used and yocto build QA | ||
7 | flag it, there is no need to set rpaths when building in this | ||
8 | environment | ||
9 | |||
10 | Fixes | ||
11 | do_package_qa: QA Issue: trace-cmd: /usr/bin/trace-cmd contains probably-redundant RPATH /usr/lib [useless-rpaths] | ||
12 | |||
13 | Upstream-Status: Inappropriate [OE-Specific] | ||
14 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
15 | --- | ||
16 | scripts/utils.mk | 2 +- | ||
17 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
18 | |||
19 | diff --git a/scripts/utils.mk b/scripts/utils.mk | ||
20 | index 3fc2d74f..309a8599 100644 | ||
21 | --- a/scripts/utils.mk | ||
22 | +++ b/scripts/utils.mk | ||
23 | @@ -64,7 +64,7 @@ do_compile = \ | ||
24 | |||
25 | do_app_build = \ | ||
26 | ($(print_app_build) \ | ||
27 | - $(CC) $^ -rdynamic -Wl,-rpath=$(libdir) -o $@ $(LDFLAGS) $(CONFIG_LIBS) $(LIBS)) | ||
28 | + $(CC) $^ -rdynamic -o $@ $(LDFLAGS) $(CONFIG_LIBS) $(LIBS)) | ||
29 | |||
30 | do_build_static_lib = \ | ||
31 | ($(print_static_lib_build) \ | ||
32 | -- | ||
33 | 2.39.0 | ||
34 | |||
diff --git a/meta-oe/recipes-kernel/trace-cmd/files/0001-Replace-LFS64-interfaces-off64_t-and-lseek64.patch b/meta-oe/recipes-kernel/trace-cmd/files/0001-Replace-LFS64-interfaces-off64_t-and-lseek64.patch new file mode 100644 index 000000000..830f1d96e --- /dev/null +++ b/meta-oe/recipes-kernel/trace-cmd/files/0001-Replace-LFS64-interfaces-off64_t-and-lseek64.patch | |||
@@ -0,0 +1,1136 @@ | |||
1 | From c6190920d405a5a6df3797153be93905d98a65f5 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Fri, 6 Jan 2023 16:53:06 -0800 | ||
4 | Subject: [PATCH] Replace LFS64 interfaces off64_t and lseek64 | ||
5 | |||
6 | Musl does not define these interfaces unless -D_LARGEFILE64_SOURCE is | ||
7 | defined and that too it is transitional until apps switch to using 64bit | ||
8 | off_t. We pass -D_LARGEFILE64_SOURCE in makefiles already therefore | ||
9 | original lseek and off_t are already 64bit | ||
10 | |||
11 | This fixes build with latest musl which has dropped LFS64 interfaces [1] | ||
12 | |||
13 | [1] https://git.musl-libc.org/cgit/musl/commit/?id=246f1c811448f37a44b41cd8df8d0ef9736d95f4i | ||
14 | |||
15 | Upstream-Status: Submitted [https://lore.kernel.org/linux-trace-devel/20230107010245.1290391-1-raj.khem@gmail.com/] | ||
16 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
17 | --- | ||
18 | .../include/private/trace-cmd-private.h | 12 +- | ||
19 | lib/trace-cmd/include/trace-cmd-local.h | 4 +- | ||
20 | lib/trace-cmd/trace-compress.c | 30 ++--- | ||
21 | lib/trace-cmd/trace-input.c | 110 +++++++++--------- | ||
22 | lib/trace-cmd/trace-msg.c | 20 ++-- | ||
23 | lib/trace-cmd/trace-output.c | 64 +++++----- | ||
24 | lib/trace-cmd/trace-recorder.c | 8 +- | ||
25 | tracecmd/trace-dump.c | 34 +++--- | ||
26 | tracecmd/trace-read.c | 2 +- | ||
27 | 9 files changed, 142 insertions(+), 142 deletions(-) | ||
28 | |||
29 | diff --git a/lib/trace-cmd/include/private/trace-cmd-private.h b/lib/trace-cmd/include/private/trace-cmd-private.h | ||
30 | index 271f0541..ac2d02c3 100644 | ||
31 | --- a/lib/trace-cmd/include/private/trace-cmd-private.h | ||
32 | +++ b/lib/trace-cmd/include/private/trace-cmd-private.h | ||
33 | @@ -106,7 +106,7 @@ const char *tracecmd_get_trace_clock(struct tracecmd_input *handle); | ||
34 | const char *tracecmd_get_cpustats(struct tracecmd_input *handle); | ||
35 | const char *tracecmd_get_uname(struct tracecmd_input *handle); | ||
36 | const char *tracecmd_get_version(struct tracecmd_input *handle); | ||
37 | -off64_t tracecmd_get_cpu_file_size(struct tracecmd_input *handle, int cpu); | ||
38 | +off_t tracecmd_get_cpu_file_size(struct tracecmd_input *handle, int cpu); | ||
39 | |||
40 | static inline int tracecmd_host_bigendian(void) | ||
41 | { | ||
42 | @@ -336,7 +336,7 @@ int tracecmd_write_buffer_info(struct tracecmd_output *handle); | ||
43 | |||
44 | int tracecmd_write_cpus(struct tracecmd_output *handle, int cpus); | ||
45 | int tracecmd_write_cmdlines(struct tracecmd_output *handle); | ||
46 | -int tracecmd_prepare_options(struct tracecmd_output *handle, off64_t offset, int whence); | ||
47 | +int tracecmd_prepare_options(struct tracecmd_output *handle, off_t offset, int whence); | ||
48 | int tracecmd_write_options(struct tracecmd_output *handle); | ||
49 | int tracecmd_write_meta_strings(struct tracecmd_output *handle); | ||
50 | int tracecmd_append_options(struct tracecmd_output *handle); | ||
51 | @@ -393,7 +393,7 @@ struct tracecmd_msg_handle { | ||
52 | short cpu_count; | ||
53 | short version; /* Current protocol version */ | ||
54 | unsigned long flags; | ||
55 | - off64_t cache_start_offset; | ||
56 | + off_t cache_start_offset; | ||
57 | bool done; | ||
58 | bool cache; | ||
59 | int cfd; | ||
60 | @@ -542,8 +542,8 @@ int tracecmd_write_guest_time_shift(struct tracecmd_output *handle, | ||
61 | struct tracecmd_compress_chunk { | ||
62 | unsigned int size; | ||
63 | unsigned int zsize; | ||
64 | - off64_t zoffset; | ||
65 | - off64_t offset; | ||
66 | + off_t zoffset; | ||
67 | + off_t offset; | ||
68 | }; | ||
69 | struct tracecmd_compression; | ||
70 | struct tracecmd_compression_proto { | ||
71 | @@ -569,7 +569,7 @@ int tracecmd_compress_buffer_read(struct tracecmd_compression *handle, char *dst | ||
72 | int tracecmd_compress_pread(struct tracecmd_compression *handle, char *dst, int len, off_t offset); | ||
73 | int tracecmd_compress_buffer_write(struct tracecmd_compression *handle, | ||
74 | const void *data, unsigned long long size); | ||
75 | -off64_t tracecmd_compress_lseek(struct tracecmd_compression *handle, off64_t offset, int whence); | ||
76 | +off_t tracecmd_compress_lseek(struct tracecmd_compression *handle, off_t offset, int whence); | ||
77 | int tracecmd_compress_proto_get_name(struct tracecmd_compression *compress, | ||
78 | const char **name, const char **version); | ||
79 | bool tracecmd_compress_is_supported(const char *name, const char *version); | ||
80 | diff --git a/lib/trace-cmd/include/trace-cmd-local.h b/lib/trace-cmd/include/trace-cmd-local.h | ||
81 | index db0b2c21..ebd6f152 100644 | ||
82 | --- a/lib/trace-cmd/include/trace-cmd-local.h | ||
83 | +++ b/lib/trace-cmd/include/trace-cmd-local.h | ||
84 | @@ -94,13 +94,13 @@ out_add_buffer_option(struct tracecmd_output *handle, const char *name, | ||
85 | struct cpu_data_source { | ||
86 | int fd; | ||
87 | int size; | ||
88 | - off64_t offset; | ||
89 | + off_t offset; | ||
90 | }; | ||
91 | |||
92 | int out_write_cpu_data(struct tracecmd_output *handle, int cpus, | ||
93 | struct cpu_data_source *data, const char *buff_name); | ||
94 | int out_write_emty_cpu_data(struct tracecmd_output *handle, int cpus); | ||
95 | -off64_t msg_lseek(struct tracecmd_msg_handle *msg_handle, off64_t offset, int whence); | ||
96 | +off_t msg_lseek(struct tracecmd_msg_handle *msg_handle, off_t offset, int whence); | ||
97 | unsigned long long get_last_option_offset(struct tracecmd_input *handle); | ||
98 | unsigned int get_meta_strings_size(struct tracecmd_input *handle); | ||
99 | int trace_append_options(struct tracecmd_output *handle, void *buf, size_t len); | ||
100 | diff --git a/lib/trace-cmd/trace-compress.c b/lib/trace-cmd/trace-compress.c | ||
101 | index 461de8d0..1b852f18 100644 | ||
102 | --- a/lib/trace-cmd/trace-compress.c | ||
103 | +++ b/lib/trace-cmd/trace-compress.c | ||
104 | @@ -117,12 +117,12 @@ static inline int buffer_extend(struct tracecmd_compression *handle, unsigned in | ||
105 | * | ||
106 | * Returns the new file pointer on success, or -1 in case of an error. | ||
107 | */ | ||
108 | -off64_t tracecmd_compress_lseek(struct tracecmd_compression *handle, off64_t offset, int whence) | ||
109 | +off_t tracecmd_compress_lseek(struct tracecmd_compression *handle, off_t offset, int whence) | ||
110 | { | ||
111 | unsigned long p; | ||
112 | |||
113 | if (!handle || !handle->buffer) | ||
114 | - return (off64_t)-1; | ||
115 | + return (off_t)-1; | ||
116 | |||
117 | switch (whence) { | ||
118 | case SEEK_CUR: | ||
119 | @@ -135,11 +135,11 @@ off64_t tracecmd_compress_lseek(struct tracecmd_compression *handle, off64_t off | ||
120 | p = offset; | ||
121 | break; | ||
122 | default: | ||
123 | - return (off64_t)-1; | ||
124 | + return (off_t)-1; | ||
125 | } | ||
126 | |||
127 | if (buffer_extend(handle, p)) | ||
128 | - return (off64_t)-1; | ||
129 | + return (off_t)-1; | ||
130 | |||
131 | handle->pointer = p; | ||
132 | |||
133 | @@ -678,7 +678,7 @@ int tracecmd_compress_copy_from(struct tracecmd_compression *handle, int fd, int | ||
134 | unsigned int size; | ||
135 | unsigned int all; | ||
136 | unsigned int r; | ||
137 | - off64_t offset; | ||
138 | + off_t offset; | ||
139 | char *buf_from; | ||
140 | char *buf_to; | ||
141 | int endian4; | ||
142 | @@ -700,7 +700,7 @@ int tracecmd_compress_copy_from(struct tracecmd_compression *handle, int fd, int | ||
143 | return -1; | ||
144 | |||
145 | /* save the initial offset and write 0 as initial chunk count */ | ||
146 | - offset = lseek64(handle->fd, 0, SEEK_CUR); | ||
147 | + offset = lseek(handle->fd, 0, SEEK_CUR); | ||
148 | write_fd(handle->fd, &chunks, 4); | ||
149 | |||
150 | do { | ||
151 | @@ -760,13 +760,13 @@ int tracecmd_compress_copy_from(struct tracecmd_compression *handle, int fd, int | ||
152 | if (all) | ||
153 | return -1; | ||
154 | |||
155 | - if (lseek64(handle->fd, offset, SEEK_SET) == (off_t)-1) | ||
156 | + if (lseek(handle->fd, offset, SEEK_SET) == (off_t)-1) | ||
157 | return -1; | ||
158 | |||
159 | endian4 = tep_read_number(handle->tep, &chunks, 4); | ||
160 | /* write chunks count*/ | ||
161 | write_fd(handle->fd, &chunks, 4); | ||
162 | - if (lseek64(handle->fd, 0, SEEK_END) == (off_t)-1) | ||
163 | + if (lseek(handle->fd, 0, SEEK_END) == (off_t)-1) | ||
164 | return -1; | ||
165 | |||
166 | if (read_size) | ||
167 | @@ -796,7 +796,7 @@ int tracecmd_load_chunks_info(struct tracecmd_compression *handle, | ||
168 | struct tracecmd_compress_chunk *chunks = NULL; | ||
169 | unsigned long long size = 0; | ||
170 | unsigned int count = 0; | ||
171 | - off64_t offset; | ||
172 | + off_t offset; | ||
173 | int ret = -1; | ||
174 | char buf[4]; | ||
175 | int i; | ||
176 | @@ -804,8 +804,8 @@ int tracecmd_load_chunks_info(struct tracecmd_compression *handle, | ||
177 | if (!handle) | ||
178 | return -1; | ||
179 | |||
180 | - offset = lseek64(handle->fd, 0, SEEK_CUR); | ||
181 | - if (offset == (off64_t)-1) | ||
182 | + offset = lseek(handle->fd, 0, SEEK_CUR); | ||
183 | + if (offset == (off_t)-1) | ||
184 | return -1; | ||
185 | |||
186 | if (read(handle->fd, buf, 4) != 4) | ||
187 | @@ -822,7 +822,7 @@ int tracecmd_load_chunks_info(struct tracecmd_compression *handle, | ||
188 | goto out; | ||
189 | |||
190 | for (i = 0; i < count; i++) { | ||
191 | - chunks[i].zoffset = lseek64(handle->fd, 0, SEEK_CUR); | ||
192 | + chunks[i].zoffset = lseek(handle->fd, 0, SEEK_CUR); | ||
193 | if (chunks[i].zoffset == (off_t)-1) | ||
194 | goto out; | ||
195 | if (read(handle->fd, buf, 4) != 4) | ||
196 | @@ -833,13 +833,13 @@ int tracecmd_load_chunks_info(struct tracecmd_compression *handle, | ||
197 | goto out; | ||
198 | chunks[i].size = tep_read_number(handle->tep, buf, 4); | ||
199 | size += chunks[i].size; | ||
200 | - if (lseek64(handle->fd, chunks[i].zsize, SEEK_CUR) == (off64_t)-1) | ||
201 | + if (lseek(handle->fd, chunks[i].zsize, SEEK_CUR) == (off_t)-1) | ||
202 | goto out; | ||
203 | } | ||
204 | |||
205 | ret = count; | ||
206 | out: | ||
207 | - if (lseek64(handle->fd, offset, SEEK_SET) == (off64_t)-1) | ||
208 | + if (lseek(handle->fd, offset, SEEK_SET) == (off_t)-1) | ||
209 | ret = -1; | ||
210 | |||
211 | if (ret > 0 && chunks_info) | ||
212 | @@ -872,7 +872,7 @@ int tracecmd_uncompress_chunk(struct tracecmd_compression *handle, | ||
213 | if (!handle || !handle->proto || !handle->proto->uncompress_block || !chunk || !data) | ||
214 | return -1; | ||
215 | |||
216 | - if (lseek64(handle->fd, chunk->zoffset + 8, SEEK_SET) == (off_t)-1) | ||
217 | + if (lseek(handle->fd, chunk->zoffset + 8, SEEK_SET) == (off_t)-1) | ||
218 | return -1; | ||
219 | |||
220 | bytes_in = malloc(chunk->zsize); | ||
221 | diff --git a/lib/trace-cmd/trace-input.c b/lib/trace-cmd/trace-input.c | ||
222 | index 594eb74a..9b128403 100644 | ||
223 | --- a/lib/trace-cmd/trace-input.c | ||
224 | +++ b/lib/trace-cmd/trace-input.c | ||
225 | @@ -37,8 +37,8 @@ static int force_read = 0; | ||
226 | |||
227 | struct page_map { | ||
228 | struct list_head list; | ||
229 | - off64_t offset; | ||
230 | - off64_t size; | ||
231 | + off_t offset; | ||
232 | + off_t size; | ||
233 | void *map; | ||
234 | int ref_count; | ||
235 | }; | ||
236 | @@ -54,7 +54,7 @@ struct follow_event { | ||
237 | |||
238 | struct page { | ||
239 | struct list_head list; | ||
240 | - off64_t offset; | ||
241 | + off_t offset; | ||
242 | struct tracecmd_input *handle; | ||
243 | struct page_map *page_map; | ||
244 | void *map; | ||
245 | @@ -541,7 +541,7 @@ static struct file_section *section_open(struct tracecmd_input *handle, int id) | ||
246 | if (!sec) | ||
247 | return NULL; | ||
248 | |||
249 | - if (lseek64(handle->fd, sec->data_offset, SEEK_SET) == (off64_t)-1) | ||
250 | + if (lseek(handle->fd, sec->data_offset, SEEK_SET) == (off_t)-1) | ||
251 | return NULL; | ||
252 | |||
253 | if ((sec->flags & TRACECMD_SEC_FL_COMPRESS) && in_uncompress_block(handle)) | ||
254 | @@ -593,7 +593,7 @@ static int read_header_files(struct tracecmd_input *handle) | ||
255 | |||
256 | if (!HAS_SECTIONS(handle)) | ||
257 | section_add_or_update(handle, TRACECMD_OPTION_HEADER_INFO, 0, 0, | ||
258 | - lseek64(handle->fd, 0, SEEK_CUR)); | ||
259 | + lseek(handle->fd, 0, SEEK_CUR)); | ||
260 | |||
261 | if (do_read_check(handle, buf, 12)) | ||
262 | return -1; | ||
263 | @@ -800,7 +800,7 @@ static int read_ftrace_files(struct tracecmd_input *handle, const char *regex) | ||
264 | |||
265 | if (!HAS_SECTIONS(handle)) | ||
266 | section_add_or_update(handle, TRACECMD_OPTION_FTRACE_EVENTS, 0, 0, | ||
267 | - lseek64(handle->fd, 0, SEEK_CUR)); | ||
268 | + lseek(handle->fd, 0, SEEK_CUR)); | ||
269 | |||
270 | if (regex) { | ||
271 | sreg = &spreg; | ||
272 | @@ -875,7 +875,7 @@ static int read_event_files(struct tracecmd_input *handle, const char *regex) | ||
273 | |||
274 | if (!HAS_SECTIONS(handle)) | ||
275 | section_add_or_update(handle, TRACECMD_OPTION_EVENT_FORMATS, 0, 0, | ||
276 | - lseek64(handle->fd, 0, SEEK_CUR)); | ||
277 | + lseek(handle->fd, 0, SEEK_CUR)); | ||
278 | |||
279 | if (regex) { | ||
280 | sreg = &spreg; | ||
281 | @@ -962,7 +962,7 @@ static int read_proc_kallsyms(struct tracecmd_input *handle) | ||
282 | return 0; | ||
283 | if (!HAS_SECTIONS(handle)) | ||
284 | section_add_or_update(handle, TRACECMD_OPTION_KALLSYMS, 0, 0, | ||
285 | - lseek64(handle->fd, 0, SEEK_CUR)); | ||
286 | + lseek(handle->fd, 0, SEEK_CUR)); | ||
287 | |||
288 | if (read4(handle, &size) < 0) | ||
289 | return -1; | ||
290 | @@ -999,7 +999,7 @@ static int read_ftrace_printk(struct tracecmd_input *handle) | ||
291 | |||
292 | if (!HAS_SECTIONS(handle)) | ||
293 | section_add_or_update(handle, TRACECMD_OPTION_PRINTK, 0, 0, | ||
294 | - lseek64(handle->fd, 0, SEEK_CUR)); | ||
295 | + lseek(handle->fd, 0, SEEK_CUR)); | ||
296 | |||
297 | if (read4(handle, &size) < 0) | ||
298 | return -1; | ||
299 | @@ -1173,7 +1173,7 @@ static int handle_section(struct tracecmd_input *handle, struct file_section *se | ||
300 | unsigned long long size; | ||
301 | int ret; | ||
302 | |||
303 | - if (lseek64(handle->fd, section->section_offset, SEEK_SET) == (off_t)-1) | ||
304 | + if (lseek(handle->fd, section->section_offset, SEEK_SET) == (off_t)-1) | ||
305 | return -1; | ||
306 | if (read_section_header(handle, &id, &flags, &size, NULL)) | ||
307 | return -1; | ||
308 | @@ -1181,7 +1181,7 @@ static int handle_section(struct tracecmd_input *handle, struct file_section *se | ||
309 | if (id != section->id) | ||
310 | return -1; | ||
311 | |||
312 | - section->data_offset = lseek64(handle->fd, 0, SEEK_CUR); | ||
313 | + section->data_offset = lseek(handle->fd, 0, SEEK_CUR); | ||
314 | if ((section->flags & TRACECMD_SEC_FL_COMPRESS) && in_uncompress_block(handle)) | ||
315 | return -1; | ||
316 | |||
317 | @@ -1225,7 +1225,7 @@ static int read_headers(struct tracecmd_input *handle, const char *regex) | ||
318 | if (!handle->options_start) | ||
319 | return -1; | ||
320 | |||
321 | - if (lseek64(handle->fd, handle->options_start, SEEK_SET) == (off64_t)-1) { | ||
322 | + if (lseek(handle->fd, handle->options_start, SEEK_SET) == (off_t)-1) { | ||
323 | tracecmd_warning("Filed to goto options offset %lld", handle->options_start); | ||
324 | return -1; | ||
325 | } | ||
326 | @@ -1269,11 +1269,11 @@ static unsigned long long calc_page_offset(struct tracecmd_input *handle, | ||
327 | return offset & ~(handle->page_size - 1); | ||
328 | } | ||
329 | |||
330 | -static int read_page(struct tracecmd_input *handle, off64_t offset, | ||
331 | +static int read_page(struct tracecmd_input *handle, off_t offset, | ||
332 | int cpu, void *map) | ||
333 | { | ||
334 | - off64_t save_seek; | ||
335 | - off64_t ret; | ||
336 | + off_t save_seek; | ||
337 | + off_t ret; | ||
338 | |||
339 | if (handle->use_pipe) { | ||
340 | ret = read(handle->cpu_data[cpu].pipe_fd, map, handle->page_size); | ||
341 | @@ -1291,9 +1291,9 @@ static int read_page(struct tracecmd_input *handle, off64_t offset, | ||
342 | } | ||
343 | |||
344 | /* other parts of the code may expect the pointer to not move */ | ||
345 | - save_seek = lseek64(handle->fd, 0, SEEK_CUR); | ||
346 | + save_seek = lseek(handle->fd, 0, SEEK_CUR); | ||
347 | |||
348 | - ret = lseek64(handle->fd, offset, SEEK_SET); | ||
349 | + ret = lseek(handle->fd, offset, SEEK_SET); | ||
350 | if (ret < 0) | ||
351 | return -1; | ||
352 | ret = read(handle->fd, map, handle->page_size); | ||
353 | @@ -1301,7 +1301,7 @@ static int read_page(struct tracecmd_input *handle, off64_t offset, | ||
354 | return -1; | ||
355 | |||
356 | /* reset the file pointer back */ | ||
357 | - lseek64(handle->fd, save_seek, SEEK_SET); | ||
358 | + lseek(handle->fd, save_seek, SEEK_SET); | ||
359 | |||
360 | return 0; | ||
361 | } | ||
362 | @@ -1348,7 +1348,7 @@ static int chunk_cmp(const void *A, const void *B) | ||
363 | return 1; | ||
364 | } | ||
365 | |||
366 | -static struct tracecmd_compress_chunk *get_zchunk(struct cpu_data *cpu, off64_t offset) | ||
367 | +static struct tracecmd_compress_chunk *get_zchunk(struct cpu_data *cpu, off_t offset) | ||
368 | { | ||
369 | struct cpu_zdata *cpuz = &cpu->compress; | ||
370 | struct tracecmd_compress_chunk *chunk; | ||
371 | @@ -1398,7 +1398,7 @@ found: | ||
372 | free(cache); | ||
373 | } | ||
374 | |||
375 | -static void *read_zpage(struct tracecmd_input *handle, int cpu, off64_t offset) | ||
376 | +static void *read_zpage(struct tracecmd_input *handle, int cpu, off_t offset) | ||
377 | { | ||
378 | struct cpu_data *cpu_data = &handle->cpu_data[cpu]; | ||
379 | struct tracecmd_compress_chunk *chunk; | ||
380 | @@ -1448,12 +1448,12 @@ error: | ||
381 | } | ||
382 | |||
383 | static void *allocate_page_map(struct tracecmd_input *handle, | ||
384 | - struct page *page, int cpu, off64_t offset) | ||
385 | + struct page *page, int cpu, off_t offset) | ||
386 | { | ||
387 | struct cpu_data *cpu_data = &handle->cpu_data[cpu]; | ||
388 | struct page_map *page_map; | ||
389 | - off64_t map_size; | ||
390 | - off64_t map_offset; | ||
391 | + off_t map_size; | ||
392 | + off_t map_offset; | ||
393 | void *map; | ||
394 | int ret; | ||
395 | int fd; | ||
396 | @@ -1544,7 +1544,7 @@ static void *allocate_page_map(struct tracecmd_input *handle, | ||
397 | } | ||
398 | |||
399 | static struct page *allocate_page(struct tracecmd_input *handle, | ||
400 | - int cpu, off64_t offset) | ||
401 | + int cpu, off_t offset) | ||
402 | { | ||
403 | struct cpu_data *cpu_data = &handle->cpu_data[cpu]; | ||
404 | struct page **pages; | ||
405 | @@ -1851,7 +1851,7 @@ static int update_page_info(struct tracecmd_input *handle, int cpu) | ||
406 | * -1 on error | ||
407 | */ | ||
408 | static int get_page(struct tracecmd_input *handle, int cpu, | ||
409 | - off64_t offset) | ||
410 | + off_t offset) | ||
411 | { | ||
412 | /* Don't map if the page is already where we want */ | ||
413 | if (handle->cpu_data[cpu].offset == offset && | ||
414 | @@ -1895,7 +1895,7 @@ static int get_page(struct tracecmd_input *handle, int cpu, | ||
415 | |||
416 | static int get_next_page(struct tracecmd_input *handle, int cpu) | ||
417 | { | ||
418 | - off64_t offset; | ||
419 | + off_t offset; | ||
420 | |||
421 | if (!handle->cpu_data[cpu].page && !handle->use_pipe) | ||
422 | return 0; | ||
423 | @@ -2122,7 +2122,7 @@ struct tep_record * | ||
424 | tracecmd_read_cpu_last(struct tracecmd_input *handle, int cpu) | ||
425 | { | ||
426 | struct tep_record *record = NULL; | ||
427 | - off64_t offset, page_offset; | ||
428 | + off_t offset, page_offset; | ||
429 | |||
430 | offset = handle->cpu_data[cpu].file_offset + | ||
431 | handle->cpu_data[cpu].file_size; | ||
432 | @@ -2183,7 +2183,7 @@ tracecmd_set_cpu_to_timestamp(struct tracecmd_input *handle, int cpu, | ||
433 | unsigned long long ts) | ||
434 | { | ||
435 | struct cpu_data *cpu_data = &handle->cpu_data[cpu]; | ||
436 | - off64_t start, end, next; | ||
437 | + off_t start, end, next; | ||
438 | |||
439 | if (cpu < 0 || cpu >= handle->cpus) { | ||
440 | errno = -EINVAL; | ||
441 | @@ -3064,11 +3064,11 @@ static int init_cpu_zfile(struct tracecmd_input *handle, int cpu) | ||
442 | { | ||
443 | struct cpu_data *cpu_data; | ||
444 | unsigned long long size; | ||
445 | - off64_t offset; | ||
446 | + off_t offset; | ||
447 | |||
448 | cpu_data = &handle->cpu_data[cpu]; | ||
449 | - offset = lseek64(handle->fd, 0, SEEK_CUR); | ||
450 | - if (lseek64(handle->fd, cpu_data->file_offset, SEEK_SET) == (off_t)-1) | ||
451 | + offset = lseek(handle->fd, 0, SEEK_CUR); | ||
452 | + if (lseek(handle->fd, cpu_data->file_offset, SEEK_SET) == (off_t)-1) | ||
453 | return -1; | ||
454 | |||
455 | strcpy(cpu_data->compress.file, COMPR_TEMP_FILE); | ||
456 | @@ -3079,7 +3079,7 @@ static int init_cpu_zfile(struct tracecmd_input *handle, int cpu) | ||
457 | if (tracecmd_uncompress_copy_to(handle->compress, cpu_data->compress.fd, NULL, &size)) | ||
458 | return -1; | ||
459 | |||
460 | - if (lseek64(handle->fd, offset, SEEK_SET) == (off_t)-1) | ||
461 | + if (lseek(handle->fd, offset, SEEK_SET) == (off_t)-1) | ||
462 | return -1; | ||
463 | |||
464 | cpu_data->file_offset = handle->next_offset; | ||
465 | @@ -3098,7 +3098,7 @@ static int init_cpu_zpage(struct tracecmd_input *handle, int cpu) | ||
466 | int count; | ||
467 | int i; | ||
468 | |||
469 | - if (lseek64(handle->fd, cpu_data->file_offset, SEEK_SET) == (off_t)-1) | ||
470 | + if (lseek(handle->fd, cpu_data->file_offset, SEEK_SET) == (off_t)-1) | ||
471 | return -1; | ||
472 | |||
473 | count = tracecmd_load_chunks_info(handle->compress, &cpu_data->compress.chunks); | ||
474 | @@ -3576,7 +3576,7 @@ static int handle_option_done(struct tracecmd_input *handle, char *buf, int size | ||
475 | if (size < 8) | ||
476 | return -1; | ||
477 | |||
478 | - offset = lseek64(handle->fd, 0, SEEK_CUR); | ||
479 | + offset = lseek(handle->fd, 0, SEEK_CUR); | ||
480 | if (offset >= size) | ||
481 | handle->options_last_offset = offset - size; | ||
482 | |||
483 | @@ -3584,7 +3584,7 @@ static int handle_option_done(struct tracecmd_input *handle, char *buf, int size | ||
484 | if (!offset) | ||
485 | return 0; | ||
486 | |||
487 | - if (lseek64(handle->fd, offset, SEEK_SET) == (off_t)-1) | ||
488 | + if (lseek(handle->fd, offset, SEEK_SET) == (off_t)-1) | ||
489 | return -1; | ||
490 | |||
491 | return handle_options(handle); | ||
492 | @@ -3741,7 +3741,7 @@ static int handle_options(struct tracecmd_input *handle) | ||
493 | int ret; | ||
494 | |||
495 | if (!HAS_SECTIONS(handle)) { | ||
496 | - handle->options_start = lseek64(handle->fd, 0, SEEK_CUR); | ||
497 | + handle->options_start = lseek(handle->fd, 0, SEEK_CUR); | ||
498 | } else { | ||
499 | if (read_section_header(handle, &id, &flags, NULL, NULL)) | ||
500 | return -1; | ||
501 | @@ -4102,7 +4102,7 @@ int init_latency_data(struct tracecmd_input *handle) | ||
502 | if (ret) | ||
503 | return -1; | ||
504 | |||
505 | - lseek64(handle->latz.fd, 0, SEEK_SET); | ||
506 | + lseek(handle->latz.fd, 0, SEEK_SET); | ||
507 | } | ||
508 | |||
509 | return 0; | ||
510 | @@ -4118,7 +4118,7 @@ static int init_buffer_cpu_data(struct tracecmd_input *handle, struct input_buff | ||
511 | if (handle->cpu_data) | ||
512 | return -1; | ||
513 | |||
514 | - if (lseek64(handle->fd, buffer->offset, SEEK_SET) == (off_t)-1) | ||
515 | + if (lseek(handle->fd, buffer->offset, SEEK_SET) == (off_t)-1) | ||
516 | return -1; | ||
517 | if (read_section_header(handle, &id, &flags, NULL, NULL)) | ||
518 | return -1; | ||
519 | @@ -4246,7 +4246,7 @@ static int read_and_parse_cmdlines(struct tracecmd_input *handle) | ||
520 | |||
521 | if (!HAS_SECTIONS(handle)) | ||
522 | section_add_or_update(handle, TRACECMD_OPTION_CMDLINES, 0, 0, | ||
523 | - lseek64(handle->fd, 0, SEEK_CUR)); | ||
524 | + lseek(handle->fd, 0, SEEK_CUR)); | ||
525 | |||
526 | |||
527 | if (read_data_and_size(handle, &cmdlines, &size) < 0) | ||
528 | @@ -4554,9 +4554,9 @@ static int read_metadata_strings(struct tracecmd_input *handle) | ||
529 | unsigned short id; | ||
530 | unsigned int csize, rsize; | ||
531 | unsigned long long size; | ||
532 | - off64_t offset; | ||
533 | + off_t offset; | ||
534 | |||
535 | - offset = lseek64(handle->fd, 0, SEEK_CUR); | ||
536 | + offset = lseek(handle->fd, 0, SEEK_CUR); | ||
537 | do { | ||
538 | if (read_section_header(handle, &id, &flags, &size, NULL)) | ||
539 | break; | ||
540 | @@ -4575,12 +4575,12 @@ static int read_metadata_strings(struct tracecmd_input *handle) | ||
541 | if (flags & TRACECMD_SEC_FL_COMPRESS) | ||
542 | in_uncompress_reset(handle); | ||
543 | } else { | ||
544 | - if (lseek64(handle->fd, size, SEEK_CUR) == (off_t)-1) | ||
545 | + if (lseek(handle->fd, size, SEEK_CUR) == (off_t)-1) | ||
546 | break; | ||
547 | } | ||
548 | } while (1); | ||
549 | |||
550 | - if (lseek64(handle->fd, offset, SEEK_SET) == (off_t)-1) | ||
551 | + if (lseek(handle->fd, offset, SEEK_SET) == (off_t)-1) | ||
552 | return -1; | ||
553 | |||
554 | return found ? 0 : -1; | ||
555 | @@ -4683,9 +4683,9 @@ struct tracecmd_input *tracecmd_alloc_fd(int fd, int flags) | ||
556 | handle->page_size = page_size; | ||
557 | handle->next_offset = page_size; | ||
558 | |||
559 | - offset = lseek64(handle->fd, 0, SEEK_CUR); | ||
560 | - handle->total_file_size = lseek64(handle->fd, 0, SEEK_END); | ||
561 | - lseek64(handle->fd, offset, SEEK_SET); | ||
562 | + offset = lseek(handle->fd, 0, SEEK_CUR); | ||
563 | + handle->total_file_size = lseek(handle->fd, 0, SEEK_END); | ||
564 | + lseek(handle->fd, offset, SEEK_SET); | ||
565 | |||
566 | if (HAS_COMPRESSION(handle)) { | ||
567 | zname = read_string(handle); | ||
568 | @@ -5533,7 +5533,7 @@ static int copy_options_recursive(struct tracecmd_input *in_handle, | ||
569 | if (!next) | ||
570 | break; | ||
571 | |||
572 | - if (do_lseek(in_handle, next, SEEK_SET) == (off64_t)-1) | ||
573 | + if (do_lseek(in_handle, next, SEEK_SET) == (off_t)-1) | ||
574 | return -1; | ||
575 | |||
576 | if (read_section_header(in_handle, &id, &flags, NULL, NULL)) | ||
577 | @@ -5648,7 +5648,7 @@ int tracecmd_copy_options(struct tracecmd_input *in_handle, | ||
578 | if (!in_handle->options_start) | ||
579 | return 0; | ||
580 | |||
581 | - if (lseek64(in_handle->fd, in_handle->options_start, SEEK_SET) == (off64_t)-1) | ||
582 | + if (lseek(in_handle->fd, in_handle->options_start, SEEK_SET) == (off_t)-1) | ||
583 | return -1; | ||
584 | |||
585 | if (copy_options(in_handle, out_handle) < 0) | ||
586 | @@ -5980,10 +5980,10 @@ tracecmd_buffer_instance_handle(struct tracecmd_input *handle, int indx) | ||
587 | new_handle->pid_maps = NULL; | ||
588 | if (!HAS_SECTIONS(handle)) { | ||
589 | /* Save where we currently are */ | ||
590 | - offset = lseek64(handle->fd, 0, SEEK_CUR); | ||
591 | + offset = lseek(handle->fd, 0, SEEK_CUR); | ||
592 | |||
593 | - ret = lseek64(handle->fd, buffer->offset, SEEK_SET); | ||
594 | - if (ret == (off64_t)-1) { | ||
595 | + ret = lseek(handle->fd, buffer->offset, SEEK_SET); | ||
596 | + if (ret == (off_t)-1) { | ||
597 | tracecmd_warning("could not seek to buffer %s offset %ld", | ||
598 | buffer->name, buffer->offset); | ||
599 | goto error; | ||
600 | @@ -6001,7 +6001,7 @@ tracecmd_buffer_instance_handle(struct tracecmd_input *handle, int indx) | ||
601 | tracecmd_warning("failed to read sub buffer %s", buffer->name); | ||
602 | goto error; | ||
603 | } | ||
604 | - ret = lseek64(handle->fd, offset, SEEK_SET); | ||
605 | + ret = lseek(handle->fd, offset, SEEK_SET); | ||
606 | if (ret < 0) { | ||
607 | tracecmd_warning("could not seek to back to offset %ld", offset); | ||
608 | goto error; | ||
609 | @@ -6171,13 +6171,13 @@ const char *tracecmd_get_version(struct tracecmd_input *handle) | ||
610 | * | ||
611 | * Provides a method to extract the cpu file size saved in @handle. | ||
612 | * | ||
613 | - * Returns the cpu file size saved in trace.dat file or (off64_t)-1 for | ||
614 | + * Returns the cpu file size saved in trace.dat file or (off_t)-1 for | ||
615 | * invalid cpu index. | ||
616 | */ | ||
617 | -off64_t tracecmd_get_cpu_file_size(struct tracecmd_input *handle, int cpu) | ||
618 | +off_t tracecmd_get_cpu_file_size(struct tracecmd_input *handle, int cpu) | ||
619 | { | ||
620 | if (cpu < 0 || cpu >= handle->cpus) | ||
621 | - return (off64_t)-1; | ||
622 | + return (off_t)-1; | ||
623 | return handle->cpu_data[cpu].file_size; | ||
624 | } | ||
625 | |||
626 | diff --git a/lib/trace-cmd/trace-msg.c b/lib/trace-cmd/trace-msg.c | ||
627 | index 0b2de710..3a555c36 100644 | ||
628 | --- a/lib/trace-cmd/trace-msg.c | ||
629 | +++ b/lib/trace-cmd/trace-msg.c | ||
630 | @@ -183,26 +183,26 @@ static int __msg_write(int fd, struct tracecmd_msg *msg, bool network) | ||
631 | return __do_write_check(fd, msg->buf, data_size); | ||
632 | } | ||
633 | |||
634 | -__hidden off64_t msg_lseek(struct tracecmd_msg_handle *msg_handle, off64_t offset, int whence) | ||
635 | +__hidden off_t msg_lseek(struct tracecmd_msg_handle *msg_handle, off_t offset, int whence) | ||
636 | { | ||
637 | - off64_t cache_offset = msg_handle->cache_start_offset; | ||
638 | - off64_t ret; | ||
639 | + off_t cache_offset = msg_handle->cache_start_offset; | ||
640 | + off_t ret; | ||
641 | |||
642 | /* | ||
643 | * lseek works only if the handle is in cache mode, | ||
644 | * cannot seek on a network socket | ||
645 | */ | ||
646 | if (!msg_handle->cache || msg_handle->cfd < 0) | ||
647 | - return (off64_t)-1; | ||
648 | + return (off_t)-1; | ||
649 | |||
650 | if (whence == SEEK_SET) { | ||
651 | if (offset < cache_offset) | ||
652 | - return (off64_t)-1; | ||
653 | + return (off_t)-1; | ||
654 | offset -= cache_offset; | ||
655 | } | ||
656 | |||
657 | - ret = lseek64(msg_handle->cfd, offset, whence); | ||
658 | - if (ret == (off64_t)-1) | ||
659 | + ret = lseek(msg_handle->cfd, offset, whence); | ||
660 | + if (ret == (off_t)-1) | ||
661 | return ret; | ||
662 | |||
663 | return ret + cache_offset; | ||
664 | @@ -639,7 +639,7 @@ static int flush_cache(struct tracecmd_msg_handle *msg_handle) | ||
665 | if (!msg_handle->cache || fd < 0) | ||
666 | return 0; | ||
667 | msg_handle->cache = false; | ||
668 | - if (lseek64(fd, 0, SEEK_SET) == (off64_t)-1) | ||
669 | + if (lseek(fd, 0, SEEK_SET) == (off_t)-1) | ||
670 | return -1; | ||
671 | do { | ||
672 | ret = read(fd, buf, MSG_MAX_DATA_LEN); | ||
673 | @@ -650,8 +650,8 @@ static int flush_cache(struct tracecmd_msg_handle *msg_handle) | ||
674 | break; | ||
675 | } while (ret >= 0); | ||
676 | |||
677 | - msg_handle->cache_start_offset = lseek64(fd, 0, SEEK_CUR); | ||
678 | - if (msg_handle->cache_start_offset == (off64_t)-1) | ||
679 | + msg_handle->cache_start_offset = lseek(fd, 0, SEEK_CUR); | ||
680 | + if (msg_handle->cache_start_offset == (off_t)-1) | ||
681 | return -1; | ||
682 | |||
683 | close(fd); | ||
684 | diff --git a/lib/trace-cmd/trace-output.c b/lib/trace-cmd/trace-output.c | ||
685 | index bdec75d6..37bb3ec0 100644 | ||
686 | --- a/lib/trace-cmd/trace-output.c | ||
687 | +++ b/lib/trace-cmd/trace-output.c | ||
688 | @@ -112,7 +112,7 @@ do_write_check(struct tracecmd_output *handle, const void *data, long long size) | ||
689 | return __do_write_check(handle->fd, data, size); | ||
690 | } | ||
691 | |||
692 | -static inline off64_t do_lseek(struct tracecmd_output *handle, off_t offset, int whence) | ||
693 | +static inline off_t do_lseek(struct tracecmd_output *handle, off_t offset, int whence) | ||
694 | { | ||
695 | if (handle->do_compress) | ||
696 | return tracecmd_compress_lseek(handle->compress, offset, whence); | ||
697 | @@ -120,7 +120,7 @@ static inline off64_t do_lseek(struct tracecmd_output *handle, off_t offset, int | ||
698 | if (handle->msg_handle) | ||
699 | return msg_lseek(handle->msg_handle, offset, whence); | ||
700 | |||
701 | - return lseek64(handle->fd, offset, whence); | ||
702 | + return lseek(handle->fd, offset, whence); | ||
703 | } | ||
704 | |||
705 | static inline int do_preed(struct tracecmd_output *handle, void *dst, int len, off_t offset) | ||
706 | @@ -518,12 +518,12 @@ out_write_section_header(struct tracecmd_output *handle, unsigned short header_i | ||
707 | /* Section ID */ | ||
708 | endian2 = convert_endian_2(handle, header_id); | ||
709 | if (do_write_check(handle, &endian2, 2)) | ||
710 | - return (off64_t)-1; | ||
711 | + return (off_t)-1; | ||
712 | |||
713 | /* Section flags */ | ||
714 | endian2 = convert_endian_2(handle, flags); | ||
715 | if (do_write_check(handle, &endian2, 2)) | ||
716 | - return (off64_t)-1; | ||
717 | + return (off_t)-1; | ||
718 | |||
719 | /* Section description */ | ||
720 | if (description) | ||
721 | @@ -532,13 +532,13 @@ out_write_section_header(struct tracecmd_output *handle, unsigned short header_i | ||
722 | desc = -1; | ||
723 | endian4 = convert_endian_4(handle, desc); | ||
724 | if (do_write_check(handle, &endian4, 4)) | ||
725 | - return (off64_t)-1; | ||
726 | + return (off_t)-1; | ||
727 | |||
728 | offset = do_lseek(handle, 0, SEEK_CUR); | ||
729 | size = 0; | ||
730 | /* Reserve for section size */ | ||
731 | if (do_write_check(handle, &size, 8)) | ||
732 | - return (off64_t)-1; | ||
733 | + return (off_t)-1; | ||
734 | return offset; | ||
735 | } | ||
736 | |||
737 | @@ -559,13 +559,13 @@ __hidden int out_update_section_header(struct tracecmd_output *handle, tsize_t o | ||
738 | if (size < 8) | ||
739 | return -1; | ||
740 | size -= 8; | ||
741 | - if (do_lseek(handle, offset, SEEK_SET) == (off64_t)-1) | ||
742 | + if (do_lseek(handle, offset, SEEK_SET) == (off_t)-1) | ||
743 | return -1; | ||
744 | |||
745 | endian8 = convert_endian_8(handle, size); | ||
746 | if (do_write_check(handle, &endian8, 8)) | ||
747 | return -1; | ||
748 | - if (do_lseek(handle, current, SEEK_SET) == (off64_t)-1) | ||
749 | + if (do_lseek(handle, current, SEEK_SET) == (off_t)-1) | ||
750 | return -1; | ||
751 | return 0; | ||
752 | } | ||
753 | @@ -587,7 +587,7 @@ static int save_string_section(struct tracecmd_output *handle, bool compress) | ||
754 | if (compress) | ||
755 | flags |= TRACECMD_SEC_FL_COMPRESS; | ||
756 | offset = out_write_section_header(handle, TRACECMD_OPTION_STRINGS, "strings", flags, false); | ||
757 | - if (offset == (off64_t)-1) | ||
758 | + if (offset == (off_t)-1) | ||
759 | return -1; | ||
760 | |||
761 | out_compression_start(handle, compress); | ||
762 | @@ -637,7 +637,7 @@ static int read_header_files(struct tracecmd_output *handle, bool compress) | ||
763 | flags |= TRACECMD_SEC_FL_COMPRESS; | ||
764 | offset = out_write_section_header(handle, TRACECMD_OPTION_HEADER_INFO, | ||
765 | "headers", flags, true); | ||
766 | - if (offset == (off64_t)-1) | ||
767 | + if (offset == (off_t)-1) | ||
768 | return -1; | ||
769 | |||
770 | out_compression_start(handle, compress); | ||
771 | @@ -965,7 +965,7 @@ static int read_ftrace_files(struct tracecmd_output *handle, bool compress) | ||
772 | flags |= TRACECMD_SEC_FL_COMPRESS; | ||
773 | offset = out_write_section_header(handle, TRACECMD_OPTION_FTRACE_EVENTS, | ||
774 | "ftrace events", flags, true); | ||
775 | - if (offset == (off64_t)-1) | ||
776 | + if (offset == (off_t)-1) | ||
777 | return -1; | ||
778 | |||
779 | create_event_list_item(handle, &systems, &list); | ||
780 | @@ -1024,7 +1024,7 @@ static int read_event_files(struct tracecmd_output *handle, | ||
781 | flags |= TRACECMD_SEC_FL_COMPRESS; | ||
782 | offset = out_write_section_header(handle, TRACECMD_OPTION_EVENT_FORMATS, | ||
783 | "events format", flags, true); | ||
784 | - if (offset == (off64_t)-1) | ||
785 | + if (offset == (off_t)-1) | ||
786 | return -1; | ||
787 | /* | ||
788 | * If any of the list is the special keyword "all" then | ||
789 | @@ -1138,7 +1138,7 @@ static int read_proc_kallsyms(struct tracecmd_output *handle, bool compress) | ||
790 | flags |= TRACECMD_SEC_FL_COMPRESS; | ||
791 | offset = out_write_section_header(handle, TRACECMD_OPTION_KALLSYMS, | ||
792 | "kallsyms", flags, true); | ||
793 | - if (offset == (off64_t)-1) | ||
794 | + if (offset == (off_t)-1) | ||
795 | return -1; | ||
796 | |||
797 | out_compression_start(handle, compress); | ||
798 | @@ -1202,7 +1202,7 @@ static int read_ftrace_printk(struct tracecmd_output *handle, bool compress) | ||
799 | if (compress) | ||
800 | flags |= TRACECMD_SEC_FL_COMPRESS; | ||
801 | offset = out_write_section_header(handle, TRACECMD_OPTION_PRINTK, "printk", flags, true); | ||
802 | - if (offset == (off64_t)-1) | ||
803 | + if (offset == (off_t)-1) | ||
804 | return -1; | ||
805 | |||
806 | out_compression_start(handle, compress); | ||
807 | @@ -1247,8 +1247,8 @@ static int save_tracing_file_data(struct tracecmd_output *handle, | ||
808 | unsigned long long endian8; | ||
809 | char *file = NULL; | ||
810 | struct stat st; | ||
811 | - off64_t check_size; | ||
812 | - off64_t size; | ||
813 | + off_t check_size; | ||
814 | + off_t size; | ||
815 | int ret = -1; | ||
816 | |||
817 | file = get_tracing_file(handle, filename); | ||
818 | @@ -1842,9 +1842,9 @@ static int write_options_v6(struct tracecmd_output *handle) | ||
819 | return 0; | ||
820 | } | ||
821 | |||
822 | -static int update_options_start(struct tracecmd_output *handle, off64_t offset) | ||
823 | +static int update_options_start(struct tracecmd_output *handle, off_t offset) | ||
824 | { | ||
825 | - if (do_lseek(handle, handle->options_start, SEEK_SET) == (off64_t)-1) | ||
826 | + if (do_lseek(handle, handle->options_start, SEEK_SET) == (off_t)-1) | ||
827 | return -1; | ||
828 | offset = convert_endian_8(handle, offset); | ||
829 | if (do_write_check(handle, &offset, 8)) | ||
830 | @@ -1867,7 +1867,7 @@ static int update_options_start(struct tracecmd_output *handle, off64_t offset) | ||
831 | * | ||
832 | * Returns zero on success and -1 on error. | ||
833 | */ | ||
834 | -int tracecmd_prepare_options(struct tracecmd_output *handle, off64_t offset, int whence) | ||
835 | +int tracecmd_prepare_options(struct tracecmd_output *handle, off_t offset, int whence) | ||
836 | { | ||
837 | tsize_t curr; | ||
838 | int ret; | ||
839 | @@ -1887,7 +1887,7 @@ int tracecmd_prepare_options(struct tracecmd_output *handle, off64_t offset, int | ||
840 | break; | ||
841 | case SEEK_END: | ||
842 | offset = do_lseek(handle, offset, SEEK_END); | ||
843 | - if (offset == (off64_t)-1) | ||
844 | + if (offset == (off_t)-1) | ||
845 | return -1; | ||
846 | break; | ||
847 | } | ||
848 | @@ -2059,7 +2059,7 @@ __hidden void *trace_get_options(struct tracecmd_output *handle, size_t *len) | ||
849 | if (!buf) | ||
850 | goto out; | ||
851 | |||
852 | - if (do_lseek(&out_handle, 0, SEEK_SET) == (off64_t)-1) | ||
853 | + if (do_lseek(&out_handle, 0, SEEK_SET) == (off_t)-1) | ||
854 | goto out; | ||
855 | *len = read(msg_handle.cfd, buf, offset); | ||
856 | if (*len != offset) { | ||
857 | @@ -2270,7 +2270,7 @@ int tracecmd_write_cmdlines(struct tracecmd_output *handle) | ||
858 | flags |= TRACECMD_SEC_FL_COMPRESS; | ||
859 | offset = out_write_section_header(handle, TRACECMD_OPTION_CMDLINES, | ||
860 | "command lines", flags, true); | ||
861 | - if (offset == (off64_t)-1) | ||
862 | + if (offset == (off_t)-1) | ||
863 | return -1; | ||
864 | |||
865 | out_compression_start(handle, compress); | ||
866 | @@ -2519,7 +2519,7 @@ static int update_buffer_cpu_offset_v6(struct tracecmd_output *handle, | ||
867 | current = do_lseek(handle, 0, SEEK_CUR); | ||
868 | |||
869 | /* Go to the option data, where will write the offest */ | ||
870 | - if (do_lseek(handle, b_offset, SEEK_SET) == (off64_t)-1) { | ||
871 | + if (do_lseek(handle, b_offset, SEEK_SET) == (off_t)-1) { | ||
872 | tracecmd_warning("could not seek to %lld", b_offset); | ||
873 | return -1; | ||
874 | } | ||
875 | @@ -2528,7 +2528,7 @@ static int update_buffer_cpu_offset_v6(struct tracecmd_output *handle, | ||
876 | return -1; | ||
877 | |||
878 | /* Go back to end of file */ | ||
879 | - if (do_lseek(handle, current, SEEK_SET) == (off64_t)-1) { | ||
880 | + if (do_lseek(handle, current, SEEK_SET) == (off_t)-1) { | ||
881 | tracecmd_warning("could not seek to %lld", offset); | ||
882 | return -1; | ||
883 | } | ||
884 | @@ -2652,7 +2652,7 @@ __hidden int out_write_cpu_data(struct tracecmd_output *handle, | ||
885 | data_files[i].data_offset &= ~(page_size - 1); | ||
886 | |||
887 | ret = do_lseek(handle, data_files[i].data_offset, SEEK_SET); | ||
888 | - if (ret == (off64_t)-1) | ||
889 | + if (ret == (off_t)-1) | ||
890 | goto out_free; | ||
891 | |||
892 | if (!tracecmd_get_quiet(handle)) | ||
893 | @@ -2660,7 +2660,7 @@ __hidden int out_write_cpu_data(struct tracecmd_output *handle, | ||
894 | i, (unsigned long long)data_files[i].data_offset); | ||
895 | |||
896 | if (data[i].size) { | ||
897 | - if (lseek64(data[i].fd, data[i].offset, SEEK_SET) == (off64_t)-1) | ||
898 | + if (lseek(data[i].fd, data[i].offset, SEEK_SET) == (off_t)-1) | ||
899 | goto out_free; | ||
900 | read_size = out_copy_fd_compress(handle, data[i].fd, | ||
901 | data[i].size, &data_files[i].write_size, | ||
902 | @@ -2678,19 +2678,19 @@ __hidden int out_write_cpu_data(struct tracecmd_output *handle, | ||
903 | |||
904 | if (!HAS_SECTIONS(handle)) { | ||
905 | /* Write the real CPU data offset in the file */ | ||
906 | - if (do_lseek(handle, data_files[i].file_data_offset, SEEK_SET) == (off64_t)-1) | ||
907 | + if (do_lseek(handle, data_files[i].file_data_offset, SEEK_SET) == (off_t)-1) | ||
908 | goto out_free; | ||
909 | endian8 = convert_endian_8(handle, data_files[i].data_offset); | ||
910 | if (do_write_check(handle, &endian8, 8)) | ||
911 | goto out_free; | ||
912 | /* Write the real CPU data size in the file */ | ||
913 | - if (do_lseek(handle, data_files[i].file_write_size, SEEK_SET) == (off64_t)-1) | ||
914 | + if (do_lseek(handle, data_files[i].file_write_size, SEEK_SET) == (off_t)-1) | ||
915 | goto out_free; | ||
916 | endian8 = convert_endian_8(handle, data_files[i].write_size); | ||
917 | if (do_write_check(handle, &endian8, 8)) | ||
918 | goto out_free; | ||
919 | offset = data_files[i].data_offset + data_files[i].write_size; | ||
920 | - if (do_lseek(handle, offset, SEEK_SET) == (off64_t)-1) | ||
921 | + if (do_lseek(handle, offset, SEEK_SET) == (off_t)-1) | ||
922 | goto out_free; | ||
923 | } | ||
924 | if (!tracecmd_get_quiet(handle)) { | ||
925 | @@ -2709,7 +2709,7 @@ __hidden int out_write_cpu_data(struct tracecmd_output *handle, | ||
926 | goto out_free; | ||
927 | |||
928 | free(data_files); | ||
929 | - if (do_lseek(handle, 0, SEEK_END) == (off64_t)-1) | ||
930 | + if (do_lseek(handle, 0, SEEK_END) == (off_t)-1) | ||
931 | return -1; | ||
932 | |||
933 | if (out_update_section_header(handle, offset)) | ||
934 | @@ -2978,7 +2978,7 @@ __hidden int out_save_options_offset(struct tracecmd_output *handle, unsigned lo | ||
935 | return -1; | ||
936 | |||
937 | new = do_lseek(handle, 0, SEEK_CUR); | ||
938 | - if (do_lseek(handle, handle->options_start, SEEK_SET) == (off64_t)-1) | ||
939 | + if (do_lseek(handle, handle->options_start, SEEK_SET) == (off_t)-1) | ||
940 | return -1; | ||
941 | |||
942 | en8 = convert_endian_8(handle, start); | ||
943 | @@ -2986,7 +2986,7 @@ __hidden int out_save_options_offset(struct tracecmd_output *handle, unsigned lo | ||
944 | return -1; | ||
945 | |||
946 | handle->options_start = new; | ||
947 | - if (do_lseek(handle, new, SEEK_SET) == (off64_t)-1) | ||
948 | + if (do_lseek(handle, new, SEEK_SET) == (off_t)-1) | ||
949 | return -1; | ||
950 | } else { | ||
951 | handle->options_start = start; | ||
952 | diff --git a/lib/trace-cmd/trace-recorder.c b/lib/trace-cmd/trace-recorder.c | ||
953 | index f387091f..a5ac8be3 100644 | ||
954 | --- a/lib/trace-cmd/trace-recorder.c | ||
955 | +++ b/lib/trace-cmd/trace-recorder.c | ||
956 | @@ -51,7 +51,7 @@ static int append_file(int size, int dst, int src) | ||
957 | char buf[size]; | ||
958 | int r; | ||
959 | |||
960 | - lseek64(src, 0, SEEK_SET); | ||
961 | + lseek(src, 0, SEEK_SET); | ||
962 | |||
963 | /* If there's an error, then we are pretty much screwed :-p */ | ||
964 | do { | ||
965 | @@ -82,10 +82,10 @@ void tracecmd_free_recorder(struct tracecmd_recorder *recorder) | ||
966 | recorder->fd2, recorder->fd1); | ||
967 | /* Error on copying, then just keep fd1 */ | ||
968 | if (ret) { | ||
969 | - lseek64(recorder->fd1, 0, SEEK_END); | ||
970 | + lseek(recorder->fd1, 0, SEEK_END); | ||
971 | goto close; | ||
972 | } | ||
973 | - lseek64(recorder->fd1, 0, SEEK_SET); | ||
974 | + lseek(recorder->fd1, 0, SEEK_SET); | ||
975 | ftruncate(recorder->fd1, 0); | ||
976 | } | ||
977 | append_file(recorder->page_size, recorder->fd1, recorder->fd2); | ||
978 | @@ -305,7 +305,7 @@ static inline void update_fd(struct tracecmd_recorder *recorder, int size) | ||
979 | fd = recorder->fd1; | ||
980 | |||
981 | /* Zero out the new file we are writing to */ | ||
982 | - lseek64(fd, 0, SEEK_SET); | ||
983 | + lseek(fd, 0, SEEK_SET); | ||
984 | ftruncate(fd, 0); | ||
985 | |||
986 | recorder->fd = fd; | ||
987 | diff --git a/tracecmd/trace-dump.c b/tracecmd/trace-dump.c | ||
988 | index 22e3d871..11c1baf1 100644 | ||
989 | --- a/tracecmd/trace-dump.c | ||
990 | +++ b/tracecmd/trace-dump.c | ||
991 | @@ -101,7 +101,7 @@ static int do_lseek(int fd, int offset, int whence) | ||
992 | if (read_compress) | ||
993 | return tracecmd_compress_lseek(compress, offset, whence); | ||
994 | |||
995 | - return lseek64(fd, offset, whence); | ||
996 | + return lseek(fd, offset, whence); | ||
997 | } | ||
998 | |||
999 | static int read_file_string(int fd, char *dst, int len) | ||
1000 | @@ -446,7 +446,7 @@ static void dump_section_header(int fd, enum dump_items v, unsigned short *flags | ||
1001 | const char *desc; | ||
1002 | int desc_id; | ||
1003 | |||
1004 | - offset = lseek64(fd, 0, SEEK_CUR); | ||
1005 | + offset = lseek(fd, 0, SEEK_CUR); | ||
1006 | if (read_file_number(fd, &id, 2)) | ||
1007 | die("cannot read the section id"); | ||
1008 | |||
1009 | @@ -500,13 +500,13 @@ static void dump_option_buffer(int fd, unsigned short option, int size) | ||
1010 | return; | ||
1011 | } | ||
1012 | |||
1013 | - current = lseek64(fd, 0, SEEK_CUR); | ||
1014 | - if (lseek64(fd, offset, SEEK_SET) == (off_t)-1) | ||
1015 | + current = lseek(fd, 0, SEEK_CUR); | ||
1016 | + if (lseek(fd, offset, SEEK_SET) == (off_t)-1) | ||
1017 | die("cannot goto buffer offset %lld", offset); | ||
1018 | |||
1019 | dump_section_header(fd, FLYRECORD, &flags); | ||
1020 | |||
1021 | - if (lseek64(fd, current, SEEK_SET) == (off_t)-1) | ||
1022 | + if (lseek(fd, current, SEEK_SET) == (off_t)-1) | ||
1023 | die("cannot go back to buffer option"); | ||
1024 | |||
1025 | do_print(OPTIONS|FLYRECORD, "\t\t[Option BUFFER, %d bytes]\n", size); | ||
1026 | @@ -773,7 +773,7 @@ static void dump_sections(int fd, int count) | ||
1027 | unsigned short flags; | ||
1028 | |||
1029 | while (sec) { | ||
1030 | - if (lseek64(fd, sec->offset, SEEK_SET) == (off_t)-1) | ||
1031 | + if (lseek(fd, sec->offset, SEEK_SET) == (off_t)-1) | ||
1032 | die("cannot goto option offset %lld", sec->offset); | ||
1033 | |||
1034 | dump_section_header(fd, sec->verbosity, &flags); | ||
1035 | @@ -826,7 +826,7 @@ static int dump_option_done(int fd, int size) | ||
1036 | if (!offset) | ||
1037 | return 0; | ||
1038 | |||
1039 | - if (lseek64(fd, offset, SEEK_SET) == (off_t)-1) | ||
1040 | + if (lseek(fd, offset, SEEK_SET) == (off_t)-1) | ||
1041 | die("cannot goto next options offset %lld", offset); | ||
1042 | |||
1043 | do_print(OPTIONS, "\n\n"); | ||
1044 | @@ -1006,7 +1006,7 @@ static void dump_therest(int fd) | ||
1045 | else if (strncmp(str, HEAD_FLYRECORD, 10) == 0) | ||
1046 | dump_flyrecord(fd); | ||
1047 | else { | ||
1048 | - lseek64(fd, -10, SEEK_CUR); | ||
1049 | + lseek(fd, -10, SEEK_CUR); | ||
1050 | break; | ||
1051 | } | ||
1052 | } | ||
1053 | @@ -1060,7 +1060,7 @@ static void get_meta_strings(int fd) | ||
1054 | unsigned short fl, id; | ||
1055 | int desc_id; | ||
1056 | |||
1057 | - offset = lseek64(fd, 0, SEEK_CUR); | ||
1058 | + offset = lseek(fd, 0, SEEK_CUR); | ||
1059 | do { | ||
1060 | if (read_file_number(fd, &id, 2)) | ||
1061 | break; | ||
1062 | @@ -1074,7 +1074,7 @@ static void get_meta_strings(int fd) | ||
1063 | if ((fl & TRACECMD_SEC_FL_COMPRESS)) { | ||
1064 | read_file_number(fd, &csize, 4); | ||
1065 | read_file_number(fd, &rsize, 4); | ||
1066 | - lseek64(fd, -8, SEEK_CUR); | ||
1067 | + lseek(fd, -8, SEEK_CUR); | ||
1068 | if (uncompress_block()) | ||
1069 | break; | ||
1070 | } else { | ||
1071 | @@ -1083,12 +1083,12 @@ static void get_meta_strings(int fd) | ||
1072 | read_metadata_strings(fd, rsize); | ||
1073 | uncompress_reset(); | ||
1074 | } else { | ||
1075 | - if (lseek64(fd, size, SEEK_CUR) == (off_t)-1) | ||
1076 | + if (lseek(fd, size, SEEK_CUR) == (off_t)-1) | ||
1077 | break; | ||
1078 | } | ||
1079 | } while (1); | ||
1080 | |||
1081 | - if (lseek64(fd, offset, SEEK_SET) == (off_t)-1) | ||
1082 | + if (lseek(fd, offset, SEEK_SET) == (off_t)-1) | ||
1083 | die("cannot restore the original file location"); | ||
1084 | } | ||
1085 | |||
1086 | @@ -1102,9 +1102,9 @@ static int walk_v7_sections(int fd) | ||
1087 | int desc_id; | ||
1088 | const char *desc; | ||
1089 | |||
1090 | - offset = lseek64(fd, 0, SEEK_CUR); | ||
1091 | + offset = lseek(fd, 0, SEEK_CUR); | ||
1092 | do { | ||
1093 | - soffset = lseek64(fd, 0, SEEK_CUR); | ||
1094 | + soffset = lseek(fd, 0, SEEK_CUR); | ||
1095 | if (read_file_number(fd, &id, 2)) | ||
1096 | break; | ||
1097 | |||
1098 | @@ -1149,11 +1149,11 @@ static int walk_v7_sections(int fd) | ||
1099 | id, soffset, desc, fl, size); | ||
1100 | } | ||
1101 | |||
1102 | - if (lseek64(fd, size, SEEK_CUR) == (off_t)-1) | ||
1103 | + if (lseek(fd, size, SEEK_CUR) == (off_t)-1) | ||
1104 | break; | ||
1105 | } while (1); | ||
1106 | |||
1107 | - if (lseek64(fd, offset, SEEK_SET) == (off_t)-1) | ||
1108 | + if (lseek(fd, offset, SEEK_SET) == (off_t)-1) | ||
1109 | die("cannot restore the original file location"); | ||
1110 | |||
1111 | return count; | ||
1112 | @@ -1170,7 +1170,7 @@ static void dump_v7_file(int fd) | ||
1113 | get_meta_strings(fd); | ||
1114 | sections = walk_v7_sections(fd); | ||
1115 | |||
1116 | - if (lseek64(fd, offset, SEEK_SET) == (off_t)-1) | ||
1117 | + if (lseek(fd, offset, SEEK_SET) == (off_t)-1) | ||
1118 | die("cannot goto options offset %lld", offset); | ||
1119 | |||
1120 | dump_options(fd); | ||
1121 | diff --git a/tracecmd/trace-read.c b/tracecmd/trace-read.c | ||
1122 | index 224a6dde..c094ad6a 100644 | ||
1123 | --- a/tracecmd/trace-read.c | ||
1124 | +++ b/tracecmd/trace-read.c | ||
1125 | @@ -195,7 +195,7 @@ static void print_event(struct trace_seq *s, struct tracecmd_input *handle, | ||
1126 | #define TEST_READ_AT 0 | ||
1127 | #if TEST_READ_AT | ||
1128 | #define DO_TEST | ||
1129 | -static off64_t test_read_at_offset; | ||
1130 | +static off_t test_read_at_offset; | ||
1131 | static int test_read_at_copy = 100; | ||
1132 | static int test_read_at_index; | ||
1133 | static void show_test(struct tracecmd_input *handle) | ||
1134 | -- | ||
1135 | 2.39.0 | ||
1136 | |||
diff --git a/meta-oe/recipes-kernel/trace-cmd/files/0001-trace-cmd-make-it-build-with-musl.patch b/meta-oe/recipes-kernel/trace-cmd/files/0001-trace-cmd-make-it-build-with-musl.patch deleted file mode 100644 index 220991804..000000000 --- a/meta-oe/recipes-kernel/trace-cmd/files/0001-trace-cmd-make-it-build-with-musl.patch +++ /dev/null | |||
@@ -1,132 +0,0 @@ | |||
1 | From b63f13d2df91ede45288653b21e0d30a6b45f2ac Mon Sep 17 00:00:00 2001 | ||
2 | From: Beniamin Sandu <beniaminsandu@gmail.com> | ||
3 | Date: Mon, 30 Nov 2020 18:24:48 +0200 | ||
4 | Subject: [PATCH] trace-cmd: make it build with musl | ||
5 | |||
6 | Signed-off-by: Beniamin Sandu <beniaminsandu@gmail.com> | ||
7 | --- | ||
8 | include/trace-cmd/trace-cmd.h | 1 + | ||
9 | lib/trace-cmd/trace-msg.c | 1 + | ||
10 | lib/trace-cmd/trace-plugin.c | 2 ++ | ||
11 | lib/tracefs/tracefs-events.c | 1 + | ||
12 | tracecmd/trace-agent.c | 1 + | ||
13 | tracecmd/trace-setup-guest.c | 1 + | ||
14 | tracecmd/trace-tsync.c | 15 ++++++++++----- | ||
15 | 7 files changed, 17 insertions(+), 5 deletions(-) | ||
16 | |||
17 | diff --git a/include/trace-cmd/trace-cmd.h b/include/trace-cmd/trace-cmd.h | ||
18 | index f3c95f3..a697905 100644 | ||
19 | --- a/include/trace-cmd/trace-cmd.h | ||
20 | +++ b/include/trace-cmd/trace-cmd.h | ||
21 | @@ -6,6 +6,7 @@ | ||
22 | #ifndef _TRACE_CMD_H | ||
23 | #define _TRACE_CMD_H | ||
24 | |||
25 | +#include <sys/types.h> | ||
26 | #include "traceevent/event-parse.h" | ||
27 | |||
28 | #define TRACECMD_MAGIC { 23, 8, 68 } | ||
29 | diff --git a/lib/trace-cmd/trace-msg.c b/lib/trace-cmd/trace-msg.c | ||
30 | index 4a0bfa9..fc1f2c7 100644 | ||
31 | --- a/lib/trace-cmd/trace-msg.c | ||
32 | +++ b/lib/trace-cmd/trace-msg.c | ||
33 | @@ -21,6 +21,7 @@ | ||
34 | #include <arpa/inet.h> | ||
35 | #include <sys/types.h> | ||
36 | #include <linux/types.h> | ||
37 | +#include <byteswap.h> | ||
38 | |||
39 | #include "trace-write-local.h" | ||
40 | #include "trace-cmd-local.h" | ||
41 | diff --git a/lib/trace-cmd/trace-plugin.c b/lib/trace-cmd/trace-plugin.c | ||
42 | index 92f9edf..c2ef3dc 100644 | ||
43 | --- a/lib/trace-cmd/trace-plugin.c | ||
44 | +++ b/lib/trace-cmd/trace-plugin.c | ||
45 | @@ -8,6 +8,8 @@ | ||
46 | #include <dlfcn.h> | ||
47 | #include <sys/stat.h> | ||
48 | #include <libgen.h> | ||
49 | +#include <limits.h> | ||
50 | + | ||
51 | #include "trace-cmd.h" | ||
52 | #include "trace-local.h" | ||
53 | |||
54 | diff --git a/lib/tracefs/tracefs-events.c b/lib/tracefs/tracefs-events.c | ||
55 | index 8e825f5..a8d8560 100644 | ||
56 | --- a/lib/tracefs/tracefs-events.c | ||
57 | +++ b/lib/tracefs/tracefs-events.c | ||
58 | @@ -13,6 +13,7 @@ | ||
59 | #include <errno.h> | ||
60 | #include <sys/stat.h> | ||
61 | #include <fcntl.h> | ||
62 | +#include <limits.h> | ||
63 | |||
64 | #include "kbuffer.h" | ||
65 | #include "tracefs.h" | ||
66 | diff --git a/tracecmd/trace-agent.c b/tracecmd/trace-agent.c | ||
67 | index b581696..abfefac 100644 | ||
68 | --- a/tracecmd/trace-agent.c | ||
69 | +++ b/tracecmd/trace-agent.c | ||
70 | @@ -20,6 +20,7 @@ | ||
71 | #include <unistd.h> | ||
72 | #include <linux/vm_sockets.h> | ||
73 | #include <pthread.h> | ||
74 | +#include <limits.h> | ||
75 | |||
76 | #include "trace-local.h" | ||
77 | #include "trace-msg.h" | ||
78 | diff --git a/tracecmd/trace-setup-guest.c b/tracecmd/trace-setup-guest.c | ||
79 | index 899848c..99595a1 100644 | ||
80 | --- a/tracecmd/trace-setup-guest.c | ||
81 | +++ b/tracecmd/trace-setup-guest.c | ||
82 | @@ -13,6 +13,7 @@ | ||
83 | #include <string.h> | ||
84 | #include <sys/stat.h> | ||
85 | #include <unistd.h> | ||
86 | +#include <limits.h> | ||
87 | |||
88 | #include "trace-local.h" | ||
89 | #include "trace-msg.h" | ||
90 | diff --git a/tracecmd/trace-tsync.c b/tracecmd/trace-tsync.c | ||
91 | index e639788..b8b5ac3 100644 | ||
92 | --- a/tracecmd/trace-tsync.c | ||
93 | +++ b/tracecmd/trace-tsync.c | ||
94 | @@ -104,13 +104,15 @@ int tracecmd_host_tsync(struct buffer_instance *instance, | ||
95 | |||
96 | pthread_attr_init(&attrib); | ||
97 | pthread_attr_setdetachstate(&attrib, PTHREAD_CREATE_JOINABLE); | ||
98 | - if (!get_first_cpu(&pin_mask, &mask_size)) | ||
99 | - pthread_attr_setaffinity_np(&attrib, mask_size, pin_mask); | ||
100 | |||
101 | ret = pthread_create(&instance->tsync_thread, &attrib, | ||
102 | tsync_host_thread, &instance->tsync); | ||
103 | - if (!ret) | ||
104 | + if (!ret) { | ||
105 | + if (!get_first_cpu(&pin_mask, &mask_size)) | ||
106 | + pthread_setaffinity_np(instance->tsync_thread, mask_size, pin_mask); | ||
107 | instance->tsync_thread_running = true; | ||
108 | + } | ||
109 | + | ||
110 | if (pin_mask) | ||
111 | CPU_FREE(pin_mask); | ||
112 | pthread_attr_destroy(&attrib); | ||
113 | @@ -243,11 +245,14 @@ unsigned int tracecmd_guest_tsync(char *tsync_protos, | ||
114 | pthread_attr_init(&attrib); | ||
115 | tsync->sync_proto = proto; | ||
116 | pthread_attr_setdetachstate(&attrib, PTHREAD_CREATE_JOINABLE); | ||
117 | - if (!get_first_cpu(&pin_mask, &mask_size)) | ||
118 | - pthread_attr_setaffinity_np(&attrib, mask_size, pin_mask); | ||
119 | |||
120 | ret = pthread_create(thr_id, &attrib, tsync_agent_thread, tsync); | ||
121 | |||
122 | + if (!ret) { | ||
123 | + if (!get_first_cpu(&pin_mask, &mask_size)) | ||
124 | + pthread_setaffinity_np(*thr_id, mask_size, pin_mask); | ||
125 | + } | ||
126 | + | ||
127 | if (pin_mask) | ||
128 | CPU_FREE(pin_mask); | ||
129 | pthread_attr_destroy(&attrib); | ||
130 | -- | ||
131 | 2.25.1 | ||
132 | |||
diff --git a/meta-oe/recipes-kernel/trace-cmd/files/0002-replace-off64_t-and-lseek64.patch b/meta-oe/recipes-kernel/trace-cmd/files/0002-replace-off64_t-and-lseek64.patch deleted file mode 100644 index 453a888b5..000000000 --- a/meta-oe/recipes-kernel/trace-cmd/files/0002-replace-off64_t-and-lseek64.patch +++ /dev/null | |||
@@ -1,426 +0,0 @@ | |||
1 | From 6dab4b10be4df906375d0dcfa5bbffc43d3d953a Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Thu, 22 Dec 2022 00:58:26 -0800 | ||
4 | Subject: [PATCH 2/2] replace off64_t and lseek64 | ||
5 | |||
6 | Musl does not define these interfaces unless -D_LARGEFILE64_SOURCE is | ||
7 | defined and that too it is transitional until apps switch to using 64bit | ||
8 | off_t | ||
9 | |||
10 | Upstream-Status: Pending | ||
11 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
12 | --- | ||
13 | lib/trace-cmd/trace-input.c | 54 +++++++++++++++++----------------- | ||
14 | lib/trace-cmd/trace-output.c | 44 +++++++++++++-------------- | ||
15 | lib/trace-cmd/trace-recorder.c | 8 ++--- | ||
16 | tracecmd/trace-dump.c | 6 ++-- | ||
17 | tracecmd/trace-read.c | 2 +- | ||
18 | 5 files changed, 57 insertions(+), 57 deletions(-) | ||
19 | |||
20 | diff --git a/lib/trace-cmd/trace-input.c b/lib/trace-cmd/trace-input.c | ||
21 | index af97883e..c3f91fcd 100644 | ||
22 | --- a/lib/trace-cmd/trace-input.c | ||
23 | +++ b/lib/trace-cmd/trace-input.c | ||
24 | @@ -33,15 +33,15 @@ static int force_read = 0; | ||
25 | |||
26 | struct page_map { | ||
27 | struct list_head list; | ||
28 | - off64_t offset; | ||
29 | - off64_t size; | ||
30 | + off_t offset; | ||
31 | + off_t size; | ||
32 | void *map; | ||
33 | int ref_count; | ||
34 | }; | ||
35 | |||
36 | struct page { | ||
37 | struct list_head list; | ||
38 | - off64_t offset; | ||
39 | + off_t offset; | ||
40 | struct tracecmd_input *handle; | ||
41 | struct page_map *page_map; | ||
42 | void *map; | ||
43 | @@ -385,7 +385,7 @@ static int read_header_files(struct tracecmd_input *handle) | ||
44 | free(header); | ||
45 | |||
46 | handle->ftrace_files_start = | ||
47 | - lseek64(handle->fd, 0, SEEK_CUR); | ||
48 | + lseek(handle->fd, 0, SEEK_CUR); | ||
49 | |||
50 | return 0; | ||
51 | |||
52 | @@ -581,7 +581,7 @@ static int read_ftrace_files(struct tracecmd_input *handle, const char *regex) | ||
53 | } | ||
54 | |||
55 | handle->event_files_start = | ||
56 | - lseek64(handle->fd, 0, SEEK_CUR); | ||
57 | + lseek(handle->fd, 0, SEEK_CUR); | ||
58 | |||
59 | if (sreg) { | ||
60 | regfree(sreg); | ||
61 | @@ -817,11 +817,11 @@ static unsigned long long calc_page_offset(struct tracecmd_input *handle, | ||
62 | return offset & ~(handle->page_size - 1); | ||
63 | } | ||
64 | |||
65 | -static int read_page(struct tracecmd_input *handle, off64_t offset, | ||
66 | +static int read_page(struct tracecmd_input *handle, off_t offset, | ||
67 | int cpu, void *map) | ||
68 | { | ||
69 | - off64_t save_seek; | ||
70 | - off64_t ret; | ||
71 | + off_t save_seek; | ||
72 | + off_t ret; | ||
73 | |||
74 | if (handle->use_pipe) { | ||
75 | ret = read(handle->cpu_data[cpu].pipe_fd, map, handle->page_size); | ||
76 | @@ -839,9 +839,9 @@ static int read_page(struct tracecmd_input *handle, off64_t offset, | ||
77 | } | ||
78 | |||
79 | /* other parts of the code may expect the pointer to not move */ | ||
80 | - save_seek = lseek64(handle->fd, 0, SEEK_CUR); | ||
81 | + save_seek = lseek(handle->fd, 0, SEEK_CUR); | ||
82 | |||
83 | - ret = lseek64(handle->fd, offset, SEEK_SET); | ||
84 | + ret = lseek(handle->fd, offset, SEEK_SET); | ||
85 | if (ret < 0) | ||
86 | return -1; | ||
87 | ret = read(handle->fd, map, handle->page_size); | ||
88 | @@ -849,7 +849,7 @@ static int read_page(struct tracecmd_input *handle, off64_t offset, | ||
89 | return -1; | ||
90 | |||
91 | /* reset the file pointer back */ | ||
92 | - lseek64(handle->fd, save_seek, SEEK_SET); | ||
93 | + lseek(handle->fd, save_seek, SEEK_SET); | ||
94 | |||
95 | return 0; | ||
96 | } | ||
97 | @@ -881,12 +881,12 @@ static void free_page_map(struct page_map *page_map) | ||
98 | } | ||
99 | |||
100 | static void *allocate_page_map(struct tracecmd_input *handle, | ||
101 | - struct page *page, int cpu, off64_t offset) | ||
102 | + struct page *page, int cpu, off_t offset) | ||
103 | { | ||
104 | struct cpu_data *cpu_data = &handle->cpu_data[cpu]; | ||
105 | struct page_map *page_map; | ||
106 | - off64_t map_size; | ||
107 | - off64_t map_offset; | ||
108 | + off_t map_size; | ||
109 | + off_t map_offset; | ||
110 | void *map; | ||
111 | int ret; | ||
112 | |||
113 | @@ -967,7 +967,7 @@ static void *allocate_page_map(struct tracecmd_input *handle, | ||
114 | } | ||
115 | |||
116 | static struct page *allocate_page(struct tracecmd_input *handle, | ||
117 | - int cpu, off64_t offset) | ||
118 | + int cpu, off_t offset) | ||
119 | { | ||
120 | struct cpu_data *cpu_data = &handle->cpu_data[cpu]; | ||
121 | struct page **pages; | ||
122 | @@ -1219,7 +1219,7 @@ static int update_page_info(struct tracecmd_input *handle, int cpu) | ||
123 | * -1 on error | ||
124 | */ | ||
125 | static int get_page(struct tracecmd_input *handle, int cpu, | ||
126 | - off64_t offset) | ||
127 | + off_t offset) | ||
128 | { | ||
129 | /* Don't map if the page is already where we want */ | ||
130 | if (handle->cpu_data[cpu].offset == offset && | ||
131 | @@ -1263,7 +1263,7 @@ static int get_page(struct tracecmd_input *handle, int cpu, | ||
132 | |||
133 | static int get_next_page(struct tracecmd_input *handle, int cpu) | ||
134 | { | ||
135 | - off64_t offset; | ||
136 | + off_t offset; | ||
137 | |||
138 | if (!handle->cpu_data[cpu].page && !handle->use_pipe) | ||
139 | return 0; | ||
140 | @@ -1484,7 +1484,7 @@ struct tep_record * | ||
141 | tracecmd_read_cpu_last(struct tracecmd_input *handle, int cpu) | ||
142 | { | ||
143 | struct tep_record *record = NULL; | ||
144 | - off64_t offset, page_offset; | ||
145 | + off_t offset, page_offset; | ||
146 | |||
147 | offset = handle->cpu_data[cpu].file_offset + | ||
148 | handle->cpu_data[cpu].file_size; | ||
149 | @@ -1545,7 +1545,7 @@ tracecmd_set_cpu_to_timestamp(struct tracecmd_input *handle, int cpu, | ||
150 | unsigned long long ts) | ||
151 | { | ||
152 | struct cpu_data *cpu_data = &handle->cpu_data[cpu]; | ||
153 | - off64_t start, end, next; | ||
154 | + off_t start, end, next; | ||
155 | |||
156 | if (cpu < 0 || cpu >= handle->cpus) { | ||
157 | errno = -EINVAL; | ||
158 | @@ -2965,7 +2965,7 @@ void tracecmd_print_events(struct tracecmd_input *handle, const char *regex) | ||
159 | regex = ".*"; | ||
160 | |||
161 | if (!handle->ftrace_files_start) { | ||
162 | - lseek64(handle->fd, handle->header_files_start, SEEK_SET); | ||
163 | + lseek(handle->fd, handle->header_files_start, SEEK_SET); | ||
164 | read_header_files(handle); | ||
165 | } | ||
166 | ret = read_ftrace_files(handle, regex); | ||
167 | @@ -3120,13 +3120,13 @@ struct tracecmd_input *tracecmd_alloc_fd(int fd) | ||
168 | handle->page_size = page_size; | ||
169 | |||
170 | handle->header_files_start = | ||
171 | - lseek64(handle->fd, 0, SEEK_CUR); | ||
172 | + lseek(handle->fd, 0, SEEK_CUR); | ||
173 | |||
174 | handle->total_file_size = | ||
175 | - lseek64(handle->fd, 0, SEEK_END); | ||
176 | + lseek(handle->fd, 0, SEEK_END); | ||
177 | |||
178 | handle->header_files_start = | ||
179 | - lseek64(handle->fd, handle->header_files_start, SEEK_SET); | ||
180 | + lseek(handle->fd, handle->header_files_start, SEEK_SET); | ||
181 | |||
182 | return handle; | ||
183 | |||
184 | @@ -3419,7 +3419,7 @@ static int copy_header_files(struct tracecmd_input *handle, int fd) | ||
185 | { | ||
186 | unsigned long long size; | ||
187 | |||
188 | - lseek64(handle->fd, handle->header_files_start, SEEK_SET); | ||
189 | + lseek(handle->fd, handle->header_files_start, SEEK_SET); | ||
190 | |||
191 | /* "header_page" */ | ||
192 | if (read_copy_data(handle, 12, fd) < 0) | ||
193 | @@ -3713,9 +3713,9 @@ tracecmd_buffer_instance_handle(struct tracecmd_input *handle, int indx) | ||
194 | new_handle->pid_maps = NULL; | ||
195 | |||
196 | /* Save where we currently are */ | ||
197 | - offset = lseek64(handle->fd, 0, SEEK_CUR); | ||
198 | + offset = lseek(handle->fd, 0, SEEK_CUR); | ||
199 | |||
200 | - ret = lseek64(handle->fd, buffer->offset, SEEK_SET); | ||
201 | + ret = lseek(handle->fd, buffer->offset, SEEK_SET); | ||
202 | if (ret < 0) { | ||
203 | warning("could not seek to buffer %s offset %ld\n", | ||
204 | buffer->name, buffer->offset); | ||
205 | @@ -3730,7 +3730,7 @@ tracecmd_buffer_instance_handle(struct tracecmd_input *handle, int indx) | ||
206 | goto error; | ||
207 | } | ||
208 | |||
209 | - ret = lseek64(handle->fd, offset, SEEK_SET); | ||
210 | + ret = lseek(handle->fd, offset, SEEK_SET); | ||
211 | if (ret < 0) { | ||
212 | warning("could not seek to back to offset %ld\n", offset); | ||
213 | goto error; | ||
214 | diff --git a/lib/trace-cmd/trace-output.c b/lib/trace-cmd/trace-output.c | ||
215 | index 4a9a857d..0f5acd2f 100644 | ||
216 | --- a/lib/trace-cmd/trace-output.c | ||
217 | +++ b/lib/trace-cmd/trace-output.c | ||
218 | @@ -800,8 +800,8 @@ static int save_tracing_file_data(struct tracecmd_output *handle, | ||
219 | unsigned long long endian8; | ||
220 | char *file = NULL; | ||
221 | struct stat st; | ||
222 | - off64_t check_size; | ||
223 | - off64_t size; | ||
224 | + off_t check_size; | ||
225 | + off_t size; | ||
226 | int ret = -1; | ||
227 | |||
228 | file = get_tracing_file(handle, filename); | ||
229 | @@ -1069,7 +1069,7 @@ int tracecmd_write_options(struct tracecmd_output *handle) | ||
230 | return -1; | ||
231 | |||
232 | /* Save the data location in case it needs to be updated */ | ||
233 | - options->offset = lseek64(handle->fd, 0, SEEK_CUR); | ||
234 | + options->offset = lseek(handle->fd, 0, SEEK_CUR); | ||
235 | |||
236 | if (do_write_check(handle, options->data, | ||
237 | options->size)) | ||
238 | @@ -1099,9 +1099,9 @@ int tracecmd_append_options(struct tracecmd_output *handle) | ||
239 | if (handle->options_written) | ||
240 | return 0; | ||
241 | |||
242 | - if (lseek64(handle->fd, 0, SEEK_END) == (off_t)-1) | ||
243 | + if (lseek(handle->fd, 0, SEEK_END) == (off_t)-1) | ||
244 | return -1; | ||
245 | - offset = lseek64(handle->fd, -2, SEEK_CUR); | ||
246 | + offset = lseek(handle->fd, -2, SEEK_CUR); | ||
247 | if (offset == (off_t)-1) | ||
248 | return -1; | ||
249 | |||
250 | @@ -1119,7 +1119,7 @@ int tracecmd_append_options(struct tracecmd_output *handle) | ||
251 | return -1; | ||
252 | |||
253 | /* Save the data location in case it needs to be updated */ | ||
254 | - options->offset = lseek64(handle->fd, 0, SEEK_CUR); | ||
255 | + options->offset = lseek(handle->fd, 0, SEEK_CUR); | ||
256 | |||
257 | if (do_write_check(handle, options->data, | ||
258 | options->size)) | ||
259 | @@ -1156,10 +1156,10 @@ int tracecmd_update_option(struct tracecmd_output *handle, | ||
260 | } | ||
261 | |||
262 | /* Save current offset */ | ||
263 | - offset = lseek64(handle->fd, 0, SEEK_CUR); | ||
264 | + offset = lseek(handle->fd, 0, SEEK_CUR); | ||
265 | |||
266 | - ret = lseek64(handle->fd, option->offset, SEEK_SET); | ||
267 | - if (ret == (off64_t)-1) { | ||
268 | + ret = lseek(handle->fd, option->offset, SEEK_SET); | ||
269 | + if (ret == (off_t)-1) { | ||
270 | warning("could not seek to %lld\n", option->offset); | ||
271 | return -1; | ||
272 | } | ||
273 | @@ -1167,8 +1167,8 @@ int tracecmd_update_option(struct tracecmd_output *handle, | ||
274 | if (do_write_check(handle, data, size)) | ||
275 | return -1; | ||
276 | |||
277 | - ret = lseek64(handle->fd, offset, SEEK_SET); | ||
278 | - if (ret == (off64_t)-1) { | ||
279 | + ret = lseek(handle->fd, offset, SEEK_SET); | ||
280 | + if (ret == (off_t)-1) { | ||
281 | warning("could not seek to %lld\n", offset); | ||
282 | return -1; | ||
283 | } | ||
284 | @@ -1243,11 +1243,11 @@ out_free: | ||
285 | int tracecmd_write_cpu_data(struct tracecmd_output *handle, | ||
286 | int cpus, char * const *cpu_data_files) | ||
287 | { | ||
288 | - off64_t *offsets = NULL; | ||
289 | + off_t *offsets = NULL; | ||
290 | unsigned long long *sizes = NULL; | ||
291 | - off64_t offset; | ||
292 | + off_t offset; | ||
293 | unsigned long long endian8; | ||
294 | - off64_t check_size; | ||
295 | + off_t check_size; | ||
296 | char *file; | ||
297 | struct stat st; | ||
298 | int ret; | ||
299 | @@ -1263,7 +1263,7 @@ int tracecmd_write_cpu_data(struct tracecmd_output *handle, | ||
300 | if (!sizes) | ||
301 | goto out_free; | ||
302 | |||
303 | - offset = lseek64(handle->fd, 0, SEEK_CUR); | ||
304 | + offset = lseek(handle->fd, 0, SEEK_CUR); | ||
305 | |||
306 | /* hold any extra data for data */ | ||
307 | offset += cpus * (16); | ||
308 | @@ -1318,8 +1318,8 @@ int tracecmd_write_cpu_data(struct tracecmd_output *handle, | ||
309 | if (!tracecmd_get_quiet(handle)) | ||
310 | fprintf(stderr, "CPU%d data recorded at offset=0x%llx\n", | ||
311 | i, (unsigned long long) offsets[i]); | ||
312 | - offset = lseek64(handle->fd, offsets[i], SEEK_SET); | ||
313 | - if (offset == (off64_t)-1) { | ||
314 | + offset = lseek(handle->fd, offsets[i], SEEK_SET); | ||
315 | + if (offset == (off_t)-1) { | ||
316 | warning("could not seek to %lld\n", offsets[i]); | ||
317 | goto out_free; | ||
318 | } | ||
319 | @@ -1369,11 +1369,11 @@ int tracecmd_append_buffer_cpu_data(struct tracecmd_output *handle, | ||
320 | tsize_t offset; | ||
321 | stsize_t ret; | ||
322 | |||
323 | - offset = lseek64(handle->fd, 0, SEEK_CUR); | ||
324 | + offset = lseek(handle->fd, 0, SEEK_CUR); | ||
325 | |||
326 | /* Go to the option data, where will write the offest */ | ||
327 | - ret = lseek64(handle->fd, option->offset, SEEK_SET); | ||
328 | - if (ret == (off64_t)-1) { | ||
329 | + ret = lseek(handle->fd, option->offset, SEEK_SET); | ||
330 | + if (ret == (off_t)-1) { | ||
331 | warning("could not seek to %lld\n", option->offset); | ||
332 | return -1; | ||
333 | } | ||
334 | @@ -1382,8 +1382,8 @@ int tracecmd_append_buffer_cpu_data(struct tracecmd_output *handle, | ||
335 | return -1; | ||
336 | |||
337 | /* Go back to end of file */ | ||
338 | - ret = lseek64(handle->fd, offset, SEEK_SET); | ||
339 | - if (ret == (off64_t)-1) { | ||
340 | + ret = lseek(handle->fd, offset, SEEK_SET); | ||
341 | + if (ret == (off_t)-1) { | ||
342 | warning("could not seek to %lld\n", offset); | ||
343 | return -1; | ||
344 | } | ||
345 | diff --git a/lib/trace-cmd/trace-recorder.c b/lib/trace-cmd/trace-recorder.c | ||
346 | index 2a6e2b67..d83320d9 100644 | ||
347 | --- a/lib/trace-cmd/trace-recorder.c | ||
348 | +++ b/lib/trace-cmd/trace-recorder.c | ||
349 | @@ -53,7 +53,7 @@ static int append_file(int size, int dst, int src) | ||
350 | char buf[size]; | ||
351 | int r; | ||
352 | |||
353 | - lseek64(src, 0, SEEK_SET); | ||
354 | + lseek(src, 0, SEEK_SET); | ||
355 | |||
356 | /* If there's an error, then we are pretty much screwed :-p */ | ||
357 | do { | ||
358 | @@ -84,10 +84,10 @@ void tracecmd_free_recorder(struct tracecmd_recorder *recorder) | ||
359 | recorder->fd2, recorder->fd1); | ||
360 | /* Error on copying, then just keep fd1 */ | ||
361 | if (ret) { | ||
362 | - lseek64(recorder->fd1, 0, SEEK_END); | ||
363 | + lseek(recorder->fd1, 0, SEEK_END); | ||
364 | goto close; | ||
365 | } | ||
366 | - lseek64(recorder->fd1, 0, SEEK_SET); | ||
367 | + lseek(recorder->fd1, 0, SEEK_SET); | ||
368 | ftruncate(recorder->fd1, 0); | ||
369 | } | ||
370 | append_file(recorder->page_size, recorder->fd1, recorder->fd2); | ||
371 | @@ -371,7 +371,7 @@ static inline void update_fd(struct tracecmd_recorder *recorder, int size) | ||
372 | fd = recorder->fd1; | ||
373 | |||
374 | /* Zero out the new file we are writing to */ | ||
375 | - lseek64(fd, 0, SEEK_SET); | ||
376 | + lseek(fd, 0, SEEK_SET); | ||
377 | ftruncate(fd, 0); | ||
378 | |||
379 | recorder->fd = fd; | ||
380 | diff --git a/tracecmd/trace-dump.c b/tracecmd/trace-dump.c | ||
381 | index 5642f12a..0a54bf42 100644 | ||
382 | --- a/tracecmd/trace-dump.c | ||
383 | +++ b/tracecmd/trace-dump.c | ||
384 | @@ -487,7 +487,7 @@ static void dump_options(int fd) | ||
385 | |||
386 | count++; | ||
387 | if (!DUMP_CHECK(OPTIONS)) { | ||
388 | - lseek64(fd, size, SEEK_CUR); | ||
389 | + lseek(fd, size, SEEK_CUR); | ||
390 | continue; | ||
391 | } | ||
392 | switch (option) { | ||
393 | @@ -533,7 +533,7 @@ static void dump_options(int fd) | ||
394 | default: | ||
395 | do_print(OPTIONS, " %d %d\t[Unknown option, size - skipping]\n", | ||
396 | option, size); | ||
397 | - lseek64(fd, size, SEEK_CUR); | ||
398 | + lseek(fd, size, SEEK_CUR); | ||
399 | break; | ||
400 | } | ||
401 | } | ||
402 | @@ -579,7 +579,7 @@ static void dump_therest(int fd) | ||
403 | else if (strncmp(str, HEAD_FLYRECORD, 10) == 0) | ||
404 | dump_flyrecord(fd); | ||
405 | else { | ||
406 | - lseek64(fd, -10, SEEK_CUR); | ||
407 | + lseek(fd, -10, SEEK_CUR); | ||
408 | break; | ||
409 | } | ||
410 | } | ||
411 | diff --git a/tracecmd/trace-read.c b/tracecmd/trace-read.c | ||
412 | index e1811074..181a69df 100644 | ||
413 | --- a/tracecmd/trace-read.c | ||
414 | +++ b/tracecmd/trace-read.c | ||
415 | @@ -187,7 +187,7 @@ static void print_event(struct trace_seq *s, struct tracecmd_input *handle, | ||
416 | #define TEST_READ_AT 0 | ||
417 | #if TEST_READ_AT | ||
418 | #define DO_TEST | ||
419 | -static off64_t test_read_at_offset; | ||
420 | +static off_t test_read_at_offset; | ||
421 | static int test_read_at_copy = 100; | ||
422 | static int test_read_at_index; | ||
423 | static void show_test(struct tracecmd_input *handle) | ||
424 | -- | ||
425 | 2.39.0 | ||
426 | |||
diff --git a/meta-oe/recipes-kernel/trace-cmd/trace-cmd_2.9.1.bb b/meta-oe/recipes-kernel/trace-cmd/trace-cmd_2.9.1.bb deleted file mode 100644 index 51e46533d..000000000 --- a/meta-oe/recipes-kernel/trace-cmd/trace-cmd_2.9.1.bb +++ /dev/null | |||
@@ -1,32 +0,0 @@ | |||
1 | SUMMARY = "User-space front-end command-line tool for ftrace" | ||
2 | |||
3 | LICENSE = "GPL-2.0-only & LGPL-2.1-only" | ||
4 | LIC_FILES_CHKSUM = "file://COPYING;md5=873f48a813bded3de6ebc54e6880c4ac" | ||
5 | |||
6 | SRC_URI = "git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/trace-cmd.git;branch=master \ | ||
7 | file://0001-trace-cmd-make-it-build-with-musl.patch \ | ||
8 | file://0002-replace-off64_t-and-lseek64.patch \ | ||
9 | " | ||
10 | |||
11 | SRCREV = "530b1a0caef39466e16bbd49de5afef89656f03f" | ||
12 | |||
13 | S = "${WORKDIR}/git" | ||
14 | |||
15 | DEPENDS += "libtraceevent libtracefs zstd xmlto-native asciidoc-native" | ||
16 | |||
17 | inherit pkgconfig | ||
18 | |||
19 | TARGET_CC_ARCH += "${LDFLAGS}" | ||
20 | |||
21 | do_compile() { | ||
22 | oe_runmake libdir_relative=${BASELIB} libs | ||
23 | oe_runmake libdir_relative=${BASELIB} all | ||
24 | } | ||
25 | |||
26 | do_install() { | ||
27 | oe_runmake libdir_relative=${BASELIB} etcdir=${sysconfdir} DESTDIR=${D} install install_libs | ||
28 | mkdir -p ${D}${libdir}/traceevent/plugins/${BPN} | ||
29 | mv ${D}/${libdir}/traceevent/plugins/*.so ${D}${libdir}/traceevent/plugins/${BPN}/ | ||
30 | } | ||
31 | |||
32 | FILES:${PN} += "${libdir}/traceevent ${libdir}/traceevent/plugins ${libdir}/tracefs" | ||
diff --git a/meta-oe/recipes-kernel/trace-cmd/trace-cmd_3.1.5.bb b/meta-oe/recipes-kernel/trace-cmd/trace-cmd_3.1.5.bb new file mode 100644 index 000000000..50d73df03 --- /dev/null +++ b/meta-oe/recipes-kernel/trace-cmd/trace-cmd_3.1.5.bb | |||
@@ -0,0 +1,31 @@ | |||
1 | SUMMARY = "User-space front-end command-line tool for ftrace" | ||
2 | |||
3 | LICENSE = "GPL-2.0-only & LGPL-2.1-only" | ||
4 | LIC_FILES_CHKSUM = " \ | ||
5 | file://LICENSES/GPL-2.0;md5=e6a75371ba4d16749254a51215d13f97 \ | ||
6 | file://LICENSES/LGPL-2.1;md5=b370887980db5dd40659b50909238dbd \ | ||
7 | " | ||
8 | |||
9 | SRC_URI = "git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/trace-cmd.git;branch=master \ | ||
10 | file://0001-Replace-LFS64-interfaces-off64_t-and-lseek64.patch \ | ||
11 | file://0001-Do-not-emit-useless-rpath.patch" | ||
12 | SRCREV = "18233e4c32857cb7ddd4960beeec8360ed834fc5" | ||
13 | |||
14 | S = "${WORKDIR}/git" | ||
15 | |||
16 | DEPENDS += "libtraceevent libtracefs zstd xmlto-native asciidoc-native swig-native bison-native flex-native" | ||
17 | |||
18 | inherit pkgconfig bash-completion | ||
19 | |||
20 | TARGET_CC_ARCH += "${LDFLAGS}" | ||
21 | |||
22 | do_compile() { | ||
23 | oe_runmake libdir_relative=${BASELIB} libs | ||
24 | oe_runmake libdir_relative=${BASELIB} all | ||
25 | } | ||
26 | |||
27 | do_install() { | ||
28 | oe_runmake libdir_relative=${BASELIB} etcdir=${sysconfdir} pkgconfig_dir=${libdir}/pkgconfig DESTDIR=${D} install install_libs | ||
29 | # Because makefile uses cp instead of install we need to change owner of files | ||
30 | chown -R root:root ${D}${libdir} | ||
31 | } | ||