mirror of
git://git.openembedded.org/meta-openembedded
synced 2026-01-01 13:58:06 +00:00
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>
This commit is contained in:
parent
b713e454c1
commit
e2116edf7b
|
|
@ -0,0 +1,34 @@
|
|||
From 90fbc3423b5ccdbd54b5851c32b9f92c6658d634 Mon Sep 17 00:00:00 2001
|
||||
From: Khem Raj <raj.khem@gmail.com>
|
||||
Date: Fri, 6 Jan 2023 17:30:24 -0800
|
||||
Subject: [PATCH] Do not emit useless rpath
|
||||
|
||||
rpath is pointing to standard libdir which is un-used and yocto build QA
|
||||
flag it, there is no need to set rpaths when building in this
|
||||
environment
|
||||
|
||||
Fixes
|
||||
do_package_qa: QA Issue: trace-cmd: /usr/bin/trace-cmd contains probably-redundant RPATH /usr/lib [useless-rpaths]
|
||||
|
||||
Upstream-Status: Inappropriate [OE-Specific]
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
---
|
||||
scripts/utils.mk | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/scripts/utils.mk b/scripts/utils.mk
|
||||
index 3fc2d74f..309a8599 100644
|
||||
--- a/scripts/utils.mk
|
||||
+++ b/scripts/utils.mk
|
||||
@@ -64,7 +64,7 @@ do_compile = \
|
||||
|
||||
do_app_build = \
|
||||
($(print_app_build) \
|
||||
- $(CC) $^ -rdynamic -Wl,-rpath=$(libdir) -o $@ $(LDFLAGS) $(CONFIG_LIBS) $(LIBS))
|
||||
+ $(CC) $^ -rdynamic -o $@ $(LDFLAGS) $(CONFIG_LIBS) $(LIBS))
|
||||
|
||||
do_build_static_lib = \
|
||||
($(print_static_lib_build) \
|
||||
--
|
||||
2.39.0
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,132 +0,0 @@
|
|||
From b63f13d2df91ede45288653b21e0d30a6b45f2ac Mon Sep 17 00:00:00 2001
|
||||
From: Beniamin Sandu <beniaminsandu@gmail.com>
|
||||
Date: Mon, 30 Nov 2020 18:24:48 +0200
|
||||
Subject: [PATCH] trace-cmd: make it build with musl
|
||||
|
||||
Signed-off-by: Beniamin Sandu <beniaminsandu@gmail.com>
|
||||
---
|
||||
include/trace-cmd/trace-cmd.h | 1 +
|
||||
lib/trace-cmd/trace-msg.c | 1 +
|
||||
lib/trace-cmd/trace-plugin.c | 2 ++
|
||||
lib/tracefs/tracefs-events.c | 1 +
|
||||
tracecmd/trace-agent.c | 1 +
|
||||
tracecmd/trace-setup-guest.c | 1 +
|
||||
tracecmd/trace-tsync.c | 15 ++++++++++-----
|
||||
7 files changed, 17 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/include/trace-cmd/trace-cmd.h b/include/trace-cmd/trace-cmd.h
|
||||
index f3c95f3..a697905 100644
|
||||
--- a/include/trace-cmd/trace-cmd.h
|
||||
+++ b/include/trace-cmd/trace-cmd.h
|
||||
@@ -6,6 +6,7 @@
|
||||
#ifndef _TRACE_CMD_H
|
||||
#define _TRACE_CMD_H
|
||||
|
||||
+#include <sys/types.h>
|
||||
#include "traceevent/event-parse.h"
|
||||
|
||||
#define TRACECMD_MAGIC { 23, 8, 68 }
|
||||
diff --git a/lib/trace-cmd/trace-msg.c b/lib/trace-cmd/trace-msg.c
|
||||
index 4a0bfa9..fc1f2c7 100644
|
||||
--- a/lib/trace-cmd/trace-msg.c
|
||||
+++ b/lib/trace-cmd/trace-msg.c
|
||||
@@ -21,6 +21,7 @@
|
||||
#include <arpa/inet.h>
|
||||
#include <sys/types.h>
|
||||
#include <linux/types.h>
|
||||
+#include <byteswap.h>
|
||||
|
||||
#include "trace-write-local.h"
|
||||
#include "trace-cmd-local.h"
|
||||
diff --git a/lib/trace-cmd/trace-plugin.c b/lib/trace-cmd/trace-plugin.c
|
||||
index 92f9edf..c2ef3dc 100644
|
||||
--- a/lib/trace-cmd/trace-plugin.c
|
||||
+++ b/lib/trace-cmd/trace-plugin.c
|
||||
@@ -8,6 +8,8 @@
|
||||
#include <dlfcn.h>
|
||||
#include <sys/stat.h>
|
||||
#include <libgen.h>
|
||||
+#include <limits.h>
|
||||
+
|
||||
#include "trace-cmd.h"
|
||||
#include "trace-local.h"
|
||||
|
||||
diff --git a/lib/tracefs/tracefs-events.c b/lib/tracefs/tracefs-events.c
|
||||
index 8e825f5..a8d8560 100644
|
||||
--- a/lib/tracefs/tracefs-events.c
|
||||
+++ b/lib/tracefs/tracefs-events.c
|
||||
@@ -13,6 +13,7 @@
|
||||
#include <errno.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
+#include <limits.h>
|
||||
|
||||
#include "kbuffer.h"
|
||||
#include "tracefs.h"
|
||||
diff --git a/tracecmd/trace-agent.c b/tracecmd/trace-agent.c
|
||||
index b581696..abfefac 100644
|
||||
--- a/tracecmd/trace-agent.c
|
||||
+++ b/tracecmd/trace-agent.c
|
||||
@@ -20,6 +20,7 @@
|
||||
#include <unistd.h>
|
||||
#include <linux/vm_sockets.h>
|
||||
#include <pthread.h>
|
||||
+#include <limits.h>
|
||||
|
||||
#include "trace-local.h"
|
||||
#include "trace-msg.h"
|
||||
diff --git a/tracecmd/trace-setup-guest.c b/tracecmd/trace-setup-guest.c
|
||||
index 899848c..99595a1 100644
|
||||
--- a/tracecmd/trace-setup-guest.c
|
||||
+++ b/tracecmd/trace-setup-guest.c
|
||||
@@ -13,6 +13,7 @@
|
||||
#include <string.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
+#include <limits.h>
|
||||
|
||||
#include "trace-local.h"
|
||||
#include "trace-msg.h"
|
||||
diff --git a/tracecmd/trace-tsync.c b/tracecmd/trace-tsync.c
|
||||
index e639788..b8b5ac3 100644
|
||||
--- a/tracecmd/trace-tsync.c
|
||||
+++ b/tracecmd/trace-tsync.c
|
||||
@@ -104,13 +104,15 @@ int tracecmd_host_tsync(struct buffer_instance *instance,
|
||||
|
||||
pthread_attr_init(&attrib);
|
||||
pthread_attr_setdetachstate(&attrib, PTHREAD_CREATE_JOINABLE);
|
||||
- if (!get_first_cpu(&pin_mask, &mask_size))
|
||||
- pthread_attr_setaffinity_np(&attrib, mask_size, pin_mask);
|
||||
|
||||
ret = pthread_create(&instance->tsync_thread, &attrib,
|
||||
tsync_host_thread, &instance->tsync);
|
||||
- if (!ret)
|
||||
+ if (!ret) {
|
||||
+ if (!get_first_cpu(&pin_mask, &mask_size))
|
||||
+ pthread_setaffinity_np(instance->tsync_thread, mask_size, pin_mask);
|
||||
instance->tsync_thread_running = true;
|
||||
+ }
|
||||
+
|
||||
if (pin_mask)
|
||||
CPU_FREE(pin_mask);
|
||||
pthread_attr_destroy(&attrib);
|
||||
@@ -243,11 +245,14 @@ unsigned int tracecmd_guest_tsync(char *tsync_protos,
|
||||
pthread_attr_init(&attrib);
|
||||
tsync->sync_proto = proto;
|
||||
pthread_attr_setdetachstate(&attrib, PTHREAD_CREATE_JOINABLE);
|
||||
- if (!get_first_cpu(&pin_mask, &mask_size))
|
||||
- pthread_attr_setaffinity_np(&attrib, mask_size, pin_mask);
|
||||
|
||||
ret = pthread_create(thr_id, &attrib, tsync_agent_thread, tsync);
|
||||
|
||||
+ if (!ret) {
|
||||
+ if (!get_first_cpu(&pin_mask, &mask_size))
|
||||
+ pthread_setaffinity_np(*thr_id, mask_size, pin_mask);
|
||||
+ }
|
||||
+
|
||||
if (pin_mask)
|
||||
CPU_FREE(pin_mask);
|
||||
pthread_attr_destroy(&attrib);
|
||||
--
|
||||
2.25.1
|
||||
|
||||
|
|
@ -1,426 +0,0 @@
|
|||
From 6dab4b10be4df906375d0dcfa5bbffc43d3d953a Mon Sep 17 00:00:00 2001
|
||||
From: Khem Raj <raj.khem@gmail.com>
|
||||
Date: Thu, 22 Dec 2022 00:58:26 -0800
|
||||
Subject: [PATCH 2/2] replace off64_t and lseek64
|
||||
|
||||
Musl does not define these interfaces unless -D_LARGEFILE64_SOURCE is
|
||||
defined and that too it is transitional until apps switch to using 64bit
|
||||
off_t
|
||||
|
||||
Upstream-Status: Pending
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
---
|
||||
lib/trace-cmd/trace-input.c | 54 +++++++++++++++++-----------------
|
||||
lib/trace-cmd/trace-output.c | 44 +++++++++++++--------------
|
||||
lib/trace-cmd/trace-recorder.c | 8 ++---
|
||||
tracecmd/trace-dump.c | 6 ++--
|
||||
tracecmd/trace-read.c | 2 +-
|
||||
5 files changed, 57 insertions(+), 57 deletions(-)
|
||||
|
||||
diff --git a/lib/trace-cmd/trace-input.c b/lib/trace-cmd/trace-input.c
|
||||
index af97883e..c3f91fcd 100644
|
||||
--- a/lib/trace-cmd/trace-input.c
|
||||
+++ b/lib/trace-cmd/trace-input.c
|
||||
@@ -33,15 +33,15 @@ static int force_read = 0;
|
||||
|
||||
struct page_map {
|
||||
struct list_head list;
|
||||
- off64_t offset;
|
||||
- off64_t size;
|
||||
+ off_t offset;
|
||||
+ off_t size;
|
||||
void *map;
|
||||
int ref_count;
|
||||
};
|
||||
|
||||
struct page {
|
||||
struct list_head list;
|
||||
- off64_t offset;
|
||||
+ off_t offset;
|
||||
struct tracecmd_input *handle;
|
||||
struct page_map *page_map;
|
||||
void *map;
|
||||
@@ -385,7 +385,7 @@ static int read_header_files(struct tracecmd_input *handle)
|
||||
free(header);
|
||||
|
||||
handle->ftrace_files_start =
|
||||
- lseek64(handle->fd, 0, SEEK_CUR);
|
||||
+ lseek(handle->fd, 0, SEEK_CUR);
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -581,7 +581,7 @@ static int read_ftrace_files(struct tracecmd_input *handle, const char *regex)
|
||||
}
|
||||
|
||||
handle->event_files_start =
|
||||
- lseek64(handle->fd, 0, SEEK_CUR);
|
||||
+ lseek(handle->fd, 0, SEEK_CUR);
|
||||
|
||||
if (sreg) {
|
||||
regfree(sreg);
|
||||
@@ -817,11 +817,11 @@ static unsigned long long calc_page_offset(struct tracecmd_input *handle,
|
||||
return offset & ~(handle->page_size - 1);
|
||||
}
|
||||
|
||||
-static int read_page(struct tracecmd_input *handle, off64_t offset,
|
||||
+static int read_page(struct tracecmd_input *handle, off_t offset,
|
||||
int cpu, void *map)
|
||||
{
|
||||
- off64_t save_seek;
|
||||
- off64_t ret;
|
||||
+ off_t save_seek;
|
||||
+ off_t ret;
|
||||
|
||||
if (handle->use_pipe) {
|
||||
ret = read(handle->cpu_data[cpu].pipe_fd, map, handle->page_size);
|
||||
@@ -839,9 +839,9 @@ static int read_page(struct tracecmd_input *handle, off64_t offset,
|
||||
}
|
||||
|
||||
/* other parts of the code may expect the pointer to not move */
|
||||
- save_seek = lseek64(handle->fd, 0, SEEK_CUR);
|
||||
+ save_seek = lseek(handle->fd, 0, SEEK_CUR);
|
||||
|
||||
- ret = lseek64(handle->fd, offset, SEEK_SET);
|
||||
+ ret = lseek(handle->fd, offset, SEEK_SET);
|
||||
if (ret < 0)
|
||||
return -1;
|
||||
ret = read(handle->fd, map, handle->page_size);
|
||||
@@ -849,7 +849,7 @@ static int read_page(struct tracecmd_input *handle, off64_t offset,
|
||||
return -1;
|
||||
|
||||
/* reset the file pointer back */
|
||||
- lseek64(handle->fd, save_seek, SEEK_SET);
|
||||
+ lseek(handle->fd, save_seek, SEEK_SET);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -881,12 +881,12 @@ static void free_page_map(struct page_map *page_map)
|
||||
}
|
||||
|
||||
static void *allocate_page_map(struct tracecmd_input *handle,
|
||||
- struct page *page, int cpu, off64_t offset)
|
||||
+ struct page *page, int cpu, off_t offset)
|
||||
{
|
||||
struct cpu_data *cpu_data = &handle->cpu_data[cpu];
|
||||
struct page_map *page_map;
|
||||
- off64_t map_size;
|
||||
- off64_t map_offset;
|
||||
+ off_t map_size;
|
||||
+ off_t map_offset;
|
||||
void *map;
|
||||
int ret;
|
||||
|
||||
@@ -967,7 +967,7 @@ static void *allocate_page_map(struct tracecmd_input *handle,
|
||||
}
|
||||
|
||||
static struct page *allocate_page(struct tracecmd_input *handle,
|
||||
- int cpu, off64_t offset)
|
||||
+ int cpu, off_t offset)
|
||||
{
|
||||
struct cpu_data *cpu_data = &handle->cpu_data[cpu];
|
||||
struct page **pages;
|
||||
@@ -1219,7 +1219,7 @@ static int update_page_info(struct tracecmd_input *handle, int cpu)
|
||||
* -1 on error
|
||||
*/
|
||||
static int get_page(struct tracecmd_input *handle, int cpu,
|
||||
- off64_t offset)
|
||||
+ off_t offset)
|
||||
{
|
||||
/* Don't map if the page is already where we want */
|
||||
if (handle->cpu_data[cpu].offset == offset &&
|
||||
@@ -1263,7 +1263,7 @@ static int get_page(struct tracecmd_input *handle, int cpu,
|
||||
|
||||
static int get_next_page(struct tracecmd_input *handle, int cpu)
|
||||
{
|
||||
- off64_t offset;
|
||||
+ off_t offset;
|
||||
|
||||
if (!handle->cpu_data[cpu].page && !handle->use_pipe)
|
||||
return 0;
|
||||
@@ -1484,7 +1484,7 @@ struct tep_record *
|
||||
tracecmd_read_cpu_last(struct tracecmd_input *handle, int cpu)
|
||||
{
|
||||
struct tep_record *record = NULL;
|
||||
- off64_t offset, page_offset;
|
||||
+ off_t offset, page_offset;
|
||||
|
||||
offset = handle->cpu_data[cpu].file_offset +
|
||||
handle->cpu_data[cpu].file_size;
|
||||
@@ -1545,7 +1545,7 @@ tracecmd_set_cpu_to_timestamp(struct tracecmd_input *handle, int cpu,
|
||||
unsigned long long ts)
|
||||
{
|
||||
struct cpu_data *cpu_data = &handle->cpu_data[cpu];
|
||||
- off64_t start, end, next;
|
||||
+ off_t start, end, next;
|
||||
|
||||
if (cpu < 0 || cpu >= handle->cpus) {
|
||||
errno = -EINVAL;
|
||||
@@ -2965,7 +2965,7 @@ void tracecmd_print_events(struct tracecmd_input *handle, const char *regex)
|
||||
regex = ".*";
|
||||
|
||||
if (!handle->ftrace_files_start) {
|
||||
- lseek64(handle->fd, handle->header_files_start, SEEK_SET);
|
||||
+ lseek(handle->fd, handle->header_files_start, SEEK_SET);
|
||||
read_header_files(handle);
|
||||
}
|
||||
ret = read_ftrace_files(handle, regex);
|
||||
@@ -3120,13 +3120,13 @@ struct tracecmd_input *tracecmd_alloc_fd(int fd)
|
||||
handle->page_size = page_size;
|
||||
|
||||
handle->header_files_start =
|
||||
- lseek64(handle->fd, 0, SEEK_CUR);
|
||||
+ lseek(handle->fd, 0, SEEK_CUR);
|
||||
|
||||
handle->total_file_size =
|
||||
- lseek64(handle->fd, 0, SEEK_END);
|
||||
+ lseek(handle->fd, 0, SEEK_END);
|
||||
|
||||
handle->header_files_start =
|
||||
- lseek64(handle->fd, handle->header_files_start, SEEK_SET);
|
||||
+ lseek(handle->fd, handle->header_files_start, SEEK_SET);
|
||||
|
||||
return handle;
|
||||
|
||||
@@ -3419,7 +3419,7 @@ static int copy_header_files(struct tracecmd_input *handle, int fd)
|
||||
{
|
||||
unsigned long long size;
|
||||
|
||||
- lseek64(handle->fd, handle->header_files_start, SEEK_SET);
|
||||
+ lseek(handle->fd, handle->header_files_start, SEEK_SET);
|
||||
|
||||
/* "header_page" */
|
||||
if (read_copy_data(handle, 12, fd) < 0)
|
||||
@@ -3713,9 +3713,9 @@ tracecmd_buffer_instance_handle(struct tracecmd_input *handle, int indx)
|
||||
new_handle->pid_maps = NULL;
|
||||
|
||||
/* Save where we currently are */
|
||||
- offset = lseek64(handle->fd, 0, SEEK_CUR);
|
||||
+ offset = lseek(handle->fd, 0, SEEK_CUR);
|
||||
|
||||
- ret = lseek64(handle->fd, buffer->offset, SEEK_SET);
|
||||
+ ret = lseek(handle->fd, buffer->offset, SEEK_SET);
|
||||
if (ret < 0) {
|
||||
warning("could not seek to buffer %s offset %ld\n",
|
||||
buffer->name, buffer->offset);
|
||||
@@ -3730,7 +3730,7 @@ tracecmd_buffer_instance_handle(struct tracecmd_input *handle, int indx)
|
||||
goto error;
|
||||
}
|
||||
|
||||
- ret = lseek64(handle->fd, offset, SEEK_SET);
|
||||
+ ret = lseek(handle->fd, offset, SEEK_SET);
|
||||
if (ret < 0) {
|
||||
warning("could not seek to back to offset %ld\n", offset);
|
||||
goto error;
|
||||
diff --git a/lib/trace-cmd/trace-output.c b/lib/trace-cmd/trace-output.c
|
||||
index 4a9a857d..0f5acd2f 100644
|
||||
--- a/lib/trace-cmd/trace-output.c
|
||||
+++ b/lib/trace-cmd/trace-output.c
|
||||
@@ -800,8 +800,8 @@ static int save_tracing_file_data(struct tracecmd_output *handle,
|
||||
unsigned long long endian8;
|
||||
char *file = NULL;
|
||||
struct stat st;
|
||||
- off64_t check_size;
|
||||
- off64_t size;
|
||||
+ off_t check_size;
|
||||
+ off_t size;
|
||||
int ret = -1;
|
||||
|
||||
file = get_tracing_file(handle, filename);
|
||||
@@ -1069,7 +1069,7 @@ int tracecmd_write_options(struct tracecmd_output *handle)
|
||||
return -1;
|
||||
|
||||
/* Save the data location in case it needs to be updated */
|
||||
- options->offset = lseek64(handle->fd, 0, SEEK_CUR);
|
||||
+ options->offset = lseek(handle->fd, 0, SEEK_CUR);
|
||||
|
||||
if (do_write_check(handle, options->data,
|
||||
options->size))
|
||||
@@ -1099,9 +1099,9 @@ int tracecmd_append_options(struct tracecmd_output *handle)
|
||||
if (handle->options_written)
|
||||
return 0;
|
||||
|
||||
- if (lseek64(handle->fd, 0, SEEK_END) == (off_t)-1)
|
||||
+ if (lseek(handle->fd, 0, SEEK_END) == (off_t)-1)
|
||||
return -1;
|
||||
- offset = lseek64(handle->fd, -2, SEEK_CUR);
|
||||
+ offset = lseek(handle->fd, -2, SEEK_CUR);
|
||||
if (offset == (off_t)-1)
|
||||
return -1;
|
||||
|
||||
@@ -1119,7 +1119,7 @@ int tracecmd_append_options(struct tracecmd_output *handle)
|
||||
return -1;
|
||||
|
||||
/* Save the data location in case it needs to be updated */
|
||||
- options->offset = lseek64(handle->fd, 0, SEEK_CUR);
|
||||
+ options->offset = lseek(handle->fd, 0, SEEK_CUR);
|
||||
|
||||
if (do_write_check(handle, options->data,
|
||||
options->size))
|
||||
@@ -1156,10 +1156,10 @@ int tracecmd_update_option(struct tracecmd_output *handle,
|
||||
}
|
||||
|
||||
/* Save current offset */
|
||||
- offset = lseek64(handle->fd, 0, SEEK_CUR);
|
||||
+ offset = lseek(handle->fd, 0, SEEK_CUR);
|
||||
|
||||
- ret = lseek64(handle->fd, option->offset, SEEK_SET);
|
||||
- if (ret == (off64_t)-1) {
|
||||
+ ret = lseek(handle->fd, option->offset, SEEK_SET);
|
||||
+ if (ret == (off_t)-1) {
|
||||
warning("could not seek to %lld\n", option->offset);
|
||||
return -1;
|
||||
}
|
||||
@@ -1167,8 +1167,8 @@ int tracecmd_update_option(struct tracecmd_output *handle,
|
||||
if (do_write_check(handle, data, size))
|
||||
return -1;
|
||||
|
||||
- ret = lseek64(handle->fd, offset, SEEK_SET);
|
||||
- if (ret == (off64_t)-1) {
|
||||
+ ret = lseek(handle->fd, offset, SEEK_SET);
|
||||
+ if (ret == (off_t)-1) {
|
||||
warning("could not seek to %lld\n", offset);
|
||||
return -1;
|
||||
}
|
||||
@@ -1243,11 +1243,11 @@ out_free:
|
||||
int tracecmd_write_cpu_data(struct tracecmd_output *handle,
|
||||
int cpus, char * const *cpu_data_files)
|
||||
{
|
||||
- off64_t *offsets = NULL;
|
||||
+ off_t *offsets = NULL;
|
||||
unsigned long long *sizes = NULL;
|
||||
- off64_t offset;
|
||||
+ off_t offset;
|
||||
unsigned long long endian8;
|
||||
- off64_t check_size;
|
||||
+ off_t check_size;
|
||||
char *file;
|
||||
struct stat st;
|
||||
int ret;
|
||||
@@ -1263,7 +1263,7 @@ int tracecmd_write_cpu_data(struct tracecmd_output *handle,
|
||||
if (!sizes)
|
||||
goto out_free;
|
||||
|
||||
- offset = lseek64(handle->fd, 0, SEEK_CUR);
|
||||
+ offset = lseek(handle->fd, 0, SEEK_CUR);
|
||||
|
||||
/* hold any extra data for data */
|
||||
offset += cpus * (16);
|
||||
@@ -1318,8 +1318,8 @@ int tracecmd_write_cpu_data(struct tracecmd_output *handle,
|
||||
if (!tracecmd_get_quiet(handle))
|
||||
fprintf(stderr, "CPU%d data recorded at offset=0x%llx\n",
|
||||
i, (unsigned long long) offsets[i]);
|
||||
- offset = lseek64(handle->fd, offsets[i], SEEK_SET);
|
||||
- if (offset == (off64_t)-1) {
|
||||
+ offset = lseek(handle->fd, offsets[i], SEEK_SET);
|
||||
+ if (offset == (off_t)-1) {
|
||||
warning("could not seek to %lld\n", offsets[i]);
|
||||
goto out_free;
|
||||
}
|
||||
@@ -1369,11 +1369,11 @@ int tracecmd_append_buffer_cpu_data(struct tracecmd_output *handle,
|
||||
tsize_t offset;
|
||||
stsize_t ret;
|
||||
|
||||
- offset = lseek64(handle->fd, 0, SEEK_CUR);
|
||||
+ offset = lseek(handle->fd, 0, SEEK_CUR);
|
||||
|
||||
/* Go to the option data, where will write the offest */
|
||||
- ret = lseek64(handle->fd, option->offset, SEEK_SET);
|
||||
- if (ret == (off64_t)-1) {
|
||||
+ ret = lseek(handle->fd, option->offset, SEEK_SET);
|
||||
+ if (ret == (off_t)-1) {
|
||||
warning("could not seek to %lld\n", option->offset);
|
||||
return -1;
|
||||
}
|
||||
@@ -1382,8 +1382,8 @@ int tracecmd_append_buffer_cpu_data(struct tracecmd_output *handle,
|
||||
return -1;
|
||||
|
||||
/* Go back to end of file */
|
||||
- ret = lseek64(handle->fd, offset, SEEK_SET);
|
||||
- if (ret == (off64_t)-1) {
|
||||
+ ret = lseek(handle->fd, offset, SEEK_SET);
|
||||
+ if (ret == (off_t)-1) {
|
||||
warning("could not seek to %lld\n", offset);
|
||||
return -1;
|
||||
}
|
||||
diff --git a/lib/trace-cmd/trace-recorder.c b/lib/trace-cmd/trace-recorder.c
|
||||
index 2a6e2b67..d83320d9 100644
|
||||
--- a/lib/trace-cmd/trace-recorder.c
|
||||
+++ b/lib/trace-cmd/trace-recorder.c
|
||||
@@ -53,7 +53,7 @@ static int append_file(int size, int dst, int src)
|
||||
char buf[size];
|
||||
int r;
|
||||
|
||||
- lseek64(src, 0, SEEK_SET);
|
||||
+ lseek(src, 0, SEEK_SET);
|
||||
|
||||
/* If there's an error, then we are pretty much screwed :-p */
|
||||
do {
|
||||
@@ -84,10 +84,10 @@ void tracecmd_free_recorder(struct tracecmd_recorder *recorder)
|
||||
recorder->fd2, recorder->fd1);
|
||||
/* Error on copying, then just keep fd1 */
|
||||
if (ret) {
|
||||
- lseek64(recorder->fd1, 0, SEEK_END);
|
||||
+ lseek(recorder->fd1, 0, SEEK_END);
|
||||
goto close;
|
||||
}
|
||||
- lseek64(recorder->fd1, 0, SEEK_SET);
|
||||
+ lseek(recorder->fd1, 0, SEEK_SET);
|
||||
ftruncate(recorder->fd1, 0);
|
||||
}
|
||||
append_file(recorder->page_size, recorder->fd1, recorder->fd2);
|
||||
@@ -371,7 +371,7 @@ static inline void update_fd(struct tracecmd_recorder *recorder, int size)
|
||||
fd = recorder->fd1;
|
||||
|
||||
/* Zero out the new file we are writing to */
|
||||
- lseek64(fd, 0, SEEK_SET);
|
||||
+ lseek(fd, 0, SEEK_SET);
|
||||
ftruncate(fd, 0);
|
||||
|
||||
recorder->fd = fd;
|
||||
diff --git a/tracecmd/trace-dump.c b/tracecmd/trace-dump.c
|
||||
index 5642f12a..0a54bf42 100644
|
||||
--- a/tracecmd/trace-dump.c
|
||||
+++ b/tracecmd/trace-dump.c
|
||||
@@ -487,7 +487,7 @@ static void dump_options(int fd)
|
||||
|
||||
count++;
|
||||
if (!DUMP_CHECK(OPTIONS)) {
|
||||
- lseek64(fd, size, SEEK_CUR);
|
||||
+ lseek(fd, size, SEEK_CUR);
|
||||
continue;
|
||||
}
|
||||
switch (option) {
|
||||
@@ -533,7 +533,7 @@ static void dump_options(int fd)
|
||||
default:
|
||||
do_print(OPTIONS, " %d %d\t[Unknown option, size - skipping]\n",
|
||||
option, size);
|
||||
- lseek64(fd, size, SEEK_CUR);
|
||||
+ lseek(fd, size, SEEK_CUR);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -579,7 +579,7 @@ static void dump_therest(int fd)
|
||||
else if (strncmp(str, HEAD_FLYRECORD, 10) == 0)
|
||||
dump_flyrecord(fd);
|
||||
else {
|
||||
- lseek64(fd, -10, SEEK_CUR);
|
||||
+ lseek(fd, -10, SEEK_CUR);
|
||||
break;
|
||||
}
|
||||
}
|
||||
diff --git a/tracecmd/trace-read.c b/tracecmd/trace-read.c
|
||||
index e1811074..181a69df 100644
|
||||
--- a/tracecmd/trace-read.c
|
||||
+++ b/tracecmd/trace-read.c
|
||||
@@ -187,7 +187,7 @@ static void print_event(struct trace_seq *s, struct tracecmd_input *handle,
|
||||
#define TEST_READ_AT 0
|
||||
#if TEST_READ_AT
|
||||
#define DO_TEST
|
||||
-static off64_t test_read_at_offset;
|
||||
+static off_t test_read_at_offset;
|
||||
static int test_read_at_copy = 100;
|
||||
static int test_read_at_index;
|
||||
static void show_test(struct tracecmd_input *handle)
|
||||
--
|
||||
2.39.0
|
||||
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
SUMMARY = "User-space front-end command-line tool for ftrace"
|
||||
|
||||
LICENSE = "GPL-2.0-only & LGPL-2.1-only"
|
||||
LIC_FILES_CHKSUM = "file://COPYING;md5=873f48a813bded3de6ebc54e6880c4ac"
|
||||
|
||||
SRC_URI = "git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/trace-cmd.git;branch=master \
|
||||
file://0001-trace-cmd-make-it-build-with-musl.patch \
|
||||
file://0002-replace-off64_t-and-lseek64.patch \
|
||||
"
|
||||
|
||||
SRCREV = "530b1a0caef39466e16bbd49de5afef89656f03f"
|
||||
|
||||
S = "${WORKDIR}/git"
|
||||
|
||||
DEPENDS += "libtraceevent libtracefs zstd xmlto-native asciidoc-native"
|
||||
|
||||
inherit pkgconfig
|
||||
|
||||
TARGET_CC_ARCH += "${LDFLAGS}"
|
||||
|
||||
do_compile() {
|
||||
oe_runmake libdir_relative=${BASELIB} libs
|
||||
oe_runmake libdir_relative=${BASELIB} all
|
||||
}
|
||||
|
||||
do_install() {
|
||||
oe_runmake libdir_relative=${BASELIB} etcdir=${sysconfdir} DESTDIR=${D} install install_libs
|
||||
mkdir -p ${D}${libdir}/traceevent/plugins/${BPN}
|
||||
mv ${D}/${libdir}/traceevent/plugins/*.so ${D}${libdir}/traceevent/plugins/${BPN}/
|
||||
}
|
||||
|
||||
FILES:${PN} += "${libdir}/traceevent ${libdir}/traceevent/plugins ${libdir}/tracefs"
|
||||
31
meta-oe/recipes-kernel/trace-cmd/trace-cmd_3.1.5.bb
Normal file
31
meta-oe/recipes-kernel/trace-cmd/trace-cmd_3.1.5.bb
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
SUMMARY = "User-space front-end command-line tool for ftrace"
|
||||
|
||||
LICENSE = "GPL-2.0-only & LGPL-2.1-only"
|
||||
LIC_FILES_CHKSUM = " \
|
||||
file://LICENSES/GPL-2.0;md5=e6a75371ba4d16749254a51215d13f97 \
|
||||
file://LICENSES/LGPL-2.1;md5=b370887980db5dd40659b50909238dbd \
|
||||
"
|
||||
|
||||
SRC_URI = "git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/trace-cmd.git;branch=master \
|
||||
file://0001-Replace-LFS64-interfaces-off64_t-and-lseek64.patch \
|
||||
file://0001-Do-not-emit-useless-rpath.patch"
|
||||
SRCREV = "18233e4c32857cb7ddd4960beeec8360ed834fc5"
|
||||
|
||||
S = "${WORKDIR}/git"
|
||||
|
||||
DEPENDS += "libtraceevent libtracefs zstd xmlto-native asciidoc-native swig-native bison-native flex-native"
|
||||
|
||||
inherit pkgconfig bash-completion
|
||||
|
||||
TARGET_CC_ARCH += "${LDFLAGS}"
|
||||
|
||||
do_compile() {
|
||||
oe_runmake libdir_relative=${BASELIB} libs
|
||||
oe_runmake libdir_relative=${BASELIB} all
|
||||
}
|
||||
|
||||
do_install() {
|
||||
oe_runmake libdir_relative=${BASELIB} etcdir=${sysconfdir} pkgconfig_dir=${libdir}/pkgconfig DESTDIR=${D} install install_libs
|
||||
# Because makefile uses cp instead of install we need to change owner of files
|
||||
chown -R root:root ${D}${libdir}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user