Commit 472c5f73 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull tracing tools updates from Steven Rostedt:

 - Set distinctive value for failed tests

   When running "make check" that performs tests on rtla the failure is
   checked by examining the output. Instead have the tool return an
   error status if it exceeds the threadhold.

 - Define __NR_sched_setattr for LoongArch

   Define __NR_sched_setattr to allow this to build for LoongArch.

 - Define _GNU_SOURCE for timerlat_bpf.c

   Due to modifications of struct sched_attr in utils.h when _GNU_SOURCE
   is not defined, this can cause errors for timerlat_bpf_init() and
   breakage in BPF sample collection mode.

* tag 'trace-tools-v6.16' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace:
  rtla: Define _GNU_SOURCE in timerlat_bpf.c
  rtla: Define __NR_sched_setattr for LoongArch
  rtla: Set distinctive exit value for failed tests
parents e0797d3b 8020361d
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -766,8 +766,8 @@ int osnoise_hist_main(int argc, char *argv[])
	struct osnoise_params *params;
	struct osnoise_tool *record = NULL;
	struct osnoise_tool *tool = NULL;
	enum result return_value = ERROR;
	struct trace_instance *trace;
	int return_value = 1;
	int retval;

	params = osnoise_hist_parse_args(argc, argv);
@@ -889,12 +889,13 @@ int osnoise_hist_main(int argc, char *argv[])

	osnoise_print_stats(params, tool);

	return_value = 0;
	return_value = PASSED;

	if (osnoise_trace_is_off(tool, record)) {
		printf("rtla osnoise hit stop tracing\n");
		save_trace_to_file(record ? record->trace.inst : NULL,
				   params->trace_output);
		return_value = FAILED;
	}

out_hist:
+3 −2
Original line number Diff line number Diff line
@@ -594,8 +594,8 @@ int osnoise_top_main(int argc, char **argv)
	struct osnoise_params *params;
	struct osnoise_tool *record = NULL;
	struct osnoise_tool *tool = NULL;
	enum result return_value = ERROR;
	struct trace_instance *trace;
	int return_value = 1;
	int retval;

	params = osnoise_top_parse_args(argc, argv);
@@ -715,12 +715,13 @@ int osnoise_top_main(int argc, char **argv)

	osnoise_print_stats(params, tool);

	return_value = 0;
	return_value = PASSED;

	if (osnoise_trace_is_off(tool, record)) {
		printf("osnoise hit stop tracing\n");
		save_trace_to_file(record ? record->trace.inst : NULL,
				   params->trace_output);
		return_value = FAILED;
	}

out_top:
+1 −0
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0
#ifdef HAVE_BPF_SKEL
#define _GNU_SOURCE
#include "timerlat.h"
#include "timerlat_bpf.h"
#include "timerlat.skel.h"
+3 −2
Original line number Diff line number Diff line
@@ -1141,11 +1141,11 @@ int timerlat_hist_main(int argc, char *argv[])
	struct timerlat_params *params;
	struct osnoise_tool *record = NULL;
	struct timerlat_u_params params_u;
	enum result return_value = ERROR;
	struct osnoise_tool *tool = NULL;
	struct osnoise_tool *aa = NULL;
	struct trace_instance *trace;
	int dma_latency_fd = -1;
	int return_value = 1;
	pthread_t timerlat_u;
	int retval;
	int nr_cpus, i;
@@ -1378,7 +1378,7 @@ int timerlat_hist_main(int argc, char *argv[])

	timerlat_print_stats(params, tool);

	return_value = 0;
	return_value = PASSED;

	if (osnoise_trace_is_off(tool, record) && !stop_tracing) {
		printf("rtla timerlat hit stop tracing\n");
@@ -1388,6 +1388,7 @@ int timerlat_hist_main(int argc, char *argv[])

		save_trace_to_file(record ? record->trace.inst : NULL,
				   params->trace_output);
		return_value = FAILED;
	}

out_hist:
+3 −2
Original line number Diff line number Diff line
@@ -985,12 +985,12 @@ int timerlat_top_main(int argc, char *argv[])
	struct timerlat_params *params;
	struct osnoise_tool *record = NULL;
	struct timerlat_u_params params_u;
	enum result return_value = ERROR;
	struct osnoise_tool *top = NULL;
	struct osnoise_tool *aa = NULL;
	struct trace_instance *trace;
	int dma_latency_fd = -1;
	pthread_t timerlat_u;
	int return_value = 1;
	char *max_lat;
	int retval;
	int nr_cpus, i;
@@ -1197,7 +1197,7 @@ int timerlat_top_main(int argc, char *argv[])

	timerlat_print_stats(params, top);

	return_value = 0;
	return_value = PASSED;

	if (osnoise_trace_is_off(top, record) && !stop_tracing) {
		printf("rtla timerlat hit stop tracing\n");
@@ -1207,6 +1207,7 @@ int timerlat_top_main(int argc, char *argv[])

		save_trace_to_file(record ? record->trace.inst : NULL,
				   params->trace_output);
		return_value = FAILED;
	} else if (params->aa_only) {
		/*
		 * If the trace did not stop with --aa-only, at least print the
Loading