Commit 7e90b5c2 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'trace-tools-v6.8-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace

Pull tracing tooling fixes from Steven Rostedt:
 "RTLA:

   - rtla tools are exiting with a positive value when usage() is
     called. Make them return 0 if the usage was called via -h/--help

   - the -P priority sets the sched priority for rtla workload. When the
     SCHED_OTHER scheduler is selected, it sets the rt_priority instead
     of the nice parameter. Setting the nice value is the correct thing,
     so fix it

   - rtla is failing to compile with clang due to unsupported options
     from gcc. Adjusting the compiler/linker options makes clang work
     properly

   - Remove the sched_getattr() unused function on utils.c

   - Fixes for variable initialization and size, reported by clang

  Verification:

   - rv is failing to compile with clang due to unsupported options from
     gcc. Adjusting the compiler/linker options makes clang work
     properly

   - Fix an uninitialized variable on in_kernel.c reported by clang"

* tag 'trace-tools-v6.8-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace:
  tools/rtla: Exit with EXIT_SUCCESS when help is invoked
  tools/rtla: Replace setting prio with nice for SCHED_OTHER
  tools/rv: Fix curr_reactor uninitialized variable
  tools/rv: Fix Makefile compiler options for clang
  tools/rtla: Remove unused sched_getattr() function
  tools/rtla: Fix clang warning about mount_point var size
  tools/rtla: Fix uninitialized bucket/data->bucket_size warning
  tools/rtla: Fix Makefile compiler options for clang
parents c664e16b b5f31936
...@@ -28,10 +28,15 @@ FOPTS := -flto=auto -ffat-lto-objects -fexceptions -fstack-protector-strong \ ...@@ -28,10 +28,15 @@ FOPTS := -flto=auto -ffat-lto-objects -fexceptions -fstack-protector-strong \
-fasynchronous-unwind-tables -fstack-clash-protection -fasynchronous-unwind-tables -fstack-clash-protection
WOPTS := -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -Wno-maybe-uninitialized WOPTS := -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -Wno-maybe-uninitialized
ifeq ($(CC),clang)
FOPTS := $(filter-out -ffat-lto-objects, $(FOPTS))
WOPTS := $(filter-out -Wno-maybe-uninitialized, $(WOPTS))
endif
TRACEFS_HEADERS := $$($(PKG_CONFIG) --cflags libtracefs) TRACEFS_HEADERS := $$($(PKG_CONFIG) --cflags libtracefs)
CFLAGS := -O -g -DVERSION=\"$(VERSION)\" $(FOPTS) $(MOPTS) $(WOPTS) $(TRACEFS_HEADERS) $(EXTRA_CFLAGS) CFLAGS := -O -g -DVERSION=\"$(VERSION)\" $(FOPTS) $(MOPTS) $(WOPTS) $(TRACEFS_HEADERS) $(EXTRA_CFLAGS)
LDFLAGS := -ggdb $(EXTRA_LDFLAGS) LDFLAGS := -flto=auto -ggdb $(EXTRA_LDFLAGS)
LIBS := $$($(PKG_CONFIG) --libs libtracefs) LIBS := $$($(PKG_CONFIG) --libs libtracefs)
SRC := $(wildcard src/*.c) SRC := $(wildcard src/*.c)
......
...@@ -135,8 +135,7 @@ static void osnoise_hist_update_multiple(struct osnoise_tool *tool, int cpu, ...@@ -135,8 +135,7 @@ static void osnoise_hist_update_multiple(struct osnoise_tool *tool, int cpu,
if (params->output_divisor) if (params->output_divisor)
duration = duration / params->output_divisor; duration = duration / params->output_divisor;
if (data->bucket_size) bucket = duration / data->bucket_size;
bucket = duration / data->bucket_size;
total_duration = duration * count; total_duration = duration * count;
...@@ -480,7 +479,11 @@ static void osnoise_hist_usage(char *usage) ...@@ -480,7 +479,11 @@ static void osnoise_hist_usage(char *usage)
for (i = 0; msg[i]; i++) for (i = 0; msg[i]; i++)
fprintf(stderr, "%s\n", msg[i]); fprintf(stderr, "%s\n", msg[i]);
exit(1);
if (usage)
exit(EXIT_FAILURE);
exit(EXIT_SUCCESS);
} }
/* /*
......
...@@ -331,7 +331,11 @@ static void osnoise_top_usage(struct osnoise_top_params *params, char *usage) ...@@ -331,7 +331,11 @@ static void osnoise_top_usage(struct osnoise_top_params *params, char *usage)
for (i = 0; msg[i]; i++) for (i = 0; msg[i]; i++)
fprintf(stderr, "%s\n", msg[i]); fprintf(stderr, "%s\n", msg[i]);
exit(1);
if (usage)
exit(EXIT_FAILURE);
exit(EXIT_SUCCESS);
} }
/* /*
......
...@@ -178,8 +178,7 @@ timerlat_hist_update(struct osnoise_tool *tool, int cpu, ...@@ -178,8 +178,7 @@ timerlat_hist_update(struct osnoise_tool *tool, int cpu,
if (params->output_divisor) if (params->output_divisor)
latency = latency / params->output_divisor; latency = latency / params->output_divisor;
if (data->bucket_size) bucket = latency / data->bucket_size;
bucket = latency / data->bucket_size;
if (!context) { if (!context) {
hist = data->hist[cpu].irq; hist = data->hist[cpu].irq;
...@@ -546,7 +545,11 @@ static void timerlat_hist_usage(char *usage) ...@@ -546,7 +545,11 @@ static void timerlat_hist_usage(char *usage)
for (i = 0; msg[i]; i++) for (i = 0; msg[i]; i++)
fprintf(stderr, "%s\n", msg[i]); fprintf(stderr, "%s\n", msg[i]);
exit(1);
if (usage)
exit(EXIT_FAILURE);
exit(EXIT_SUCCESS);
} }
/* /*
......
...@@ -375,7 +375,11 @@ static void timerlat_top_usage(char *usage) ...@@ -375,7 +375,11 @@ static void timerlat_top_usage(char *usage)
for (i = 0; msg[i]; i++) for (i = 0; msg[i]; i++)
fprintf(stderr, "%s\n", msg[i]); fprintf(stderr, "%s\n", msg[i]);
exit(1);
if (usage)
exit(EXIT_FAILURE);
exit(EXIT_SUCCESS);
} }
/* /*
......
...@@ -238,12 +238,6 @@ static inline int sched_setattr(pid_t pid, const struct sched_attr *attr, ...@@ -238,12 +238,6 @@ static inline int sched_setattr(pid_t pid, const struct sched_attr *attr,
return syscall(__NR_sched_setattr, pid, attr, flags); return syscall(__NR_sched_setattr, pid, attr, flags);
} }
static inline int sched_getattr(pid_t pid, struct sched_attr *attr,
unsigned int size, unsigned int flags)
{
return syscall(__NR_sched_getattr, pid, attr, size, flags);
}
int __set_sched_attr(int pid, struct sched_attr *attr) int __set_sched_attr(int pid, struct sched_attr *attr)
{ {
int flags = 0; int flags = 0;
...@@ -479,13 +473,13 @@ int parse_prio(char *arg, struct sched_attr *sched_param) ...@@ -479,13 +473,13 @@ int parse_prio(char *arg, struct sched_attr *sched_param)
if (prio == INVALID_VAL) if (prio == INVALID_VAL)
return -1; return -1;
if (prio < sched_get_priority_min(SCHED_OTHER)) if (prio < MIN_NICE)
return -1; return -1;
if (prio > sched_get_priority_max(SCHED_OTHER)) if (prio > MAX_NICE)
return -1; return -1;
sched_param->sched_policy = SCHED_OTHER; sched_param->sched_policy = SCHED_OTHER;
sched_param->sched_priority = prio; sched_param->sched_nice = prio;
break; break;
default: default:
return -1; return -1;
...@@ -536,7 +530,7 @@ int set_cpu_dma_latency(int32_t latency) ...@@ -536,7 +530,7 @@ int set_cpu_dma_latency(int32_t latency)
*/ */
static const int find_mount(const char *fs, char *mp, int sizeof_mp) static const int find_mount(const char *fs, char *mp, int sizeof_mp)
{ {
char mount_point[MAX_PATH]; char mount_point[MAX_PATH+1];
char type[100]; char type[100];
int found = 0; int found = 0;
FILE *fp; FILE *fp;
......
...@@ -9,6 +9,8 @@ ...@@ -9,6 +9,8 @@
*/ */
#define BUFF_U64_STR_SIZE 24 #define BUFF_U64_STR_SIZE 24
#define MAX_PATH 1024 #define MAX_PATH 1024
#define MAX_NICE 20
#define MIN_NICE -19
#define container_of(ptr, type, member)({ \ #define container_of(ptr, type, member)({ \
const typeof(((type *)0)->member) *__mptr = (ptr); \ const typeof(((type *)0)->member) *__mptr = (ptr); \
......
...@@ -28,10 +28,15 @@ FOPTS := -flto=auto -ffat-lto-objects -fexceptions -fstack-protector-strong \ ...@@ -28,10 +28,15 @@ FOPTS := -flto=auto -ffat-lto-objects -fexceptions -fstack-protector-strong \
-fasynchronous-unwind-tables -fstack-clash-protection -fasynchronous-unwind-tables -fstack-clash-protection
WOPTS := -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -Wno-maybe-uninitialized WOPTS := -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -Wno-maybe-uninitialized
ifeq ($(CC),clang)
FOPTS := $(filter-out -ffat-lto-objects, $(FOPTS))
WOPTS := $(filter-out -Wno-maybe-uninitialized, $(WOPTS))
endif
TRACEFS_HEADERS := $$($(PKG_CONFIG) --cflags libtracefs) TRACEFS_HEADERS := $$($(PKG_CONFIG) --cflags libtracefs)
CFLAGS := -O -g -DVERSION=\"$(VERSION)\" $(FOPTS) $(MOPTS) $(WOPTS) $(TRACEFS_HEADERS) $(EXTRA_CFLAGS) -I include CFLAGS := -O -g -DVERSION=\"$(VERSION)\" $(FOPTS) $(MOPTS) $(WOPTS) $(TRACEFS_HEADERS) $(EXTRA_CFLAGS) -I include
LDFLAGS := -ggdb $(EXTRA_LDFLAGS) LDFLAGS := -flto=auto -ggdb $(EXTRA_LDFLAGS)
LIBS := $$($(PKG_CONFIG) --libs libtracefs) LIBS := $$($(PKG_CONFIG) --libs libtracefs)
SRC := $(wildcard src/*.c) SRC := $(wildcard src/*.c)
......
...@@ -210,9 +210,9 @@ static char *ikm_read_reactor(char *monitor_name) ...@@ -210,9 +210,9 @@ static char *ikm_read_reactor(char *monitor_name)
static char *ikm_get_current_reactor(char *monitor_name) static char *ikm_get_current_reactor(char *monitor_name)
{ {
char *reactors = ikm_read_reactor(monitor_name); char *reactors = ikm_read_reactor(monitor_name);
char *curr_reactor = NULL;
char *start; char *start;
char *end; char *end;
char *curr_reactor;
if (!reactors) if (!reactors)
return NULL; return NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment