Skip to content

Commit 32f6c5d

Browse files
committed
Merge tag 'trace-v5.17-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace
Pull tracing fixes from Steven Rostedt: - Fixes to the RTLA tooling - A fix to a tp_printk overriding tp_printk_stop_on_boot on the command line * tag 'trace-v5.17-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: tracing: Fix tp_printk option related with tp_printk_stop_on_boot MAINTAINERS: Add RTLA entry rtla: Fix segmentation fault when failing to enable -t rtla/trace: Error message fixup rtla/utils: Fix session duration parsing rtla: Follow kernel version
2 parents f1baf68 + 3203ce3 commit 32f6c5d

File tree

10 files changed

+36
-23
lines changed

10 files changed

+36
-23
lines changed

MAINTAINERS

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19595,6 +19595,14 @@ F: Documentation/trace/timerlat-tracer.rst
1959519595
F: Documentation/trace/hwlat_detector.rst
1959619596
F: arch/*/kernel/trace.c
1959719597

19598+
Real-time Linux Analysis (RTLA) tools
19599+
M: Daniel Bristot de Oliveira <[email protected]>
19600+
M: Steven Rostedt <[email protected]>
19601+
19602+
S: Maintained
19603+
F: Documentation/tools/rtla/
19604+
F: tools/tracing/rtla/
19605+
1959819606
TRADITIONAL CHINESE DOCUMENTATION
1959919607
M: Hu Haowen <[email protected]>
1960019608

kernel/trace/trace.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,10 @@ __setup("trace_clock=", set_trace_boot_clock);
252252

253253
static int __init set_tracepoint_printk(char *str)
254254
{
255+
/* Ignore the "tp_printk_stop_on_boot" param */
256+
if (*str == '_')
257+
return 0;
258+
255259
if ((strcmp(str, "=0") != 0 && strcmp(str, "=off") != 0))
256260
tracepoint_printk = 1;
257261
return 1;

tools/tracing/rtla/Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
NAME := rtla
2-
VERSION := 0.5
2+
# Follow the kernel version
3+
VERSION := $(shell cat VERSION 2> /dev/null || make -sC ../../.. kernelversion)
34

45
# From libtracefs:
56
# Makefiles suck: This macro sets a default value of $(2) for the
@@ -85,6 +86,7 @@ clean: doc_clean
8586

8687
tarball: clean
8788
rm -rf $(NAME)-$(VERSION) && mkdir $(NAME)-$(VERSION)
89+
echo $(VERSION) > $(NAME)-$(VERSION)/VERSION
8890
cp -r $(DIRS) $(FILES) $(NAME)-$(VERSION)
8991
mkdir $(NAME)-$(VERSION)/Documentation/
9092
cp -rp $(SRCTREE)/../../../Documentation/tools/rtla/* $(NAME)-$(VERSION)/Documentation/

tools/tracing/rtla/src/osnoise.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -750,6 +750,9 @@ void osnoise_put_context(struct osnoise_context *context)
750750
*/
751751
void osnoise_destroy_tool(struct osnoise_tool *top)
752752
{
753+
if (!top)
754+
return;
755+
753756
trace_instance_destroy(&top->trace);
754757

755758
if (top->context)

tools/tracing/rtla/src/osnoise_hist.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -701,9 +701,9 @@ osnoise_hist_set_signals(struct osnoise_hist_params *params)
701701
int osnoise_hist_main(int argc, char *argv[])
702702
{
703703
struct osnoise_hist_params *params;
704+
struct osnoise_tool *record = NULL;
705+
struct osnoise_tool *tool = NULL;
704706
struct trace_instance *trace;
705-
struct osnoise_tool *record;
706-
struct osnoise_tool *tool;
707707
int return_value = 1;
708708
int retval;
709709

@@ -792,9 +792,8 @@ int osnoise_hist_main(int argc, char *argv[])
792792
out_hist:
793793
osnoise_free_histogram(tool->data);
794794
out_destroy:
795+
osnoise_destroy_tool(record);
795796
osnoise_destroy_tool(tool);
796-
if (params->trace_output)
797-
osnoise_destroy_tool(record);
798797
free(params);
799798
out_exit:
800799
exit(return_value);

tools/tracing/rtla/src/osnoise_top.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -483,9 +483,9 @@ static void osnoise_top_set_signals(struct osnoise_top_params *params)
483483
int osnoise_top_main(int argc, char **argv)
484484
{
485485
struct osnoise_top_params *params;
486+
struct osnoise_tool *record = NULL;
487+
struct osnoise_tool *tool = NULL;
486488
struct trace_instance *trace;
487-
struct osnoise_tool *record;
488-
struct osnoise_tool *tool;
489489
int return_value = 1;
490490
int retval;
491491

@@ -571,9 +571,8 @@ int osnoise_top_main(int argc, char **argv)
571571

572572
out_top:
573573
osnoise_free_top(tool->data);
574+
osnoise_destroy_tool(record);
574575
osnoise_destroy_tool(tool);
575-
if (params->trace_output)
576-
osnoise_destroy_tool(record);
577576
out_exit:
578577
exit(return_value);
579578
}

tools/tracing/rtla/src/timerlat_hist.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -729,9 +729,9 @@ timerlat_hist_set_signals(struct timerlat_hist_params *params)
729729
int timerlat_hist_main(int argc, char *argv[])
730730
{
731731
struct timerlat_hist_params *params;
732+
struct osnoise_tool *record = NULL;
733+
struct osnoise_tool *tool = NULL;
732734
struct trace_instance *trace;
733-
struct osnoise_tool *record;
734-
struct osnoise_tool *tool;
735735
int return_value = 1;
736736
int retval;
737737

@@ -813,9 +813,8 @@ int timerlat_hist_main(int argc, char *argv[])
813813

814814
out_hist:
815815
timerlat_free_histogram(tool->data);
816+
osnoise_destroy_tool(record);
816817
osnoise_destroy_tool(tool);
817-
if (params->trace_output)
818-
osnoise_destroy_tool(record);
819818
free(params);
820819
out_exit:
821820
exit(return_value);

tools/tracing/rtla/src/timerlat_top.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -521,9 +521,9 @@ timerlat_top_set_signals(struct timerlat_top_params *params)
521521
int timerlat_top_main(int argc, char *argv[])
522522
{
523523
struct timerlat_top_params *params;
524+
struct osnoise_tool *record = NULL;
525+
struct osnoise_tool *top = NULL;
524526
struct trace_instance *trace;
525-
struct osnoise_tool *record;
526-
struct osnoise_tool *top;
527527
int return_value = 1;
528528
int retval;
529529

@@ -609,9 +609,8 @@ int timerlat_top_main(int argc, char *argv[])
609609

610610
out_top:
611611
timerlat_free_top(top->data);
612+
osnoise_destroy_tool(record);
612613
osnoise_destroy_tool(top);
613-
if (params->trace_output)
614-
osnoise_destroy_tool(record);
615614
free(params);
616615
out_exit:
617616
exit(return_value);

tools/tracing/rtla/src/trace.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@ int enable_tracer_by_name(struct tracefs_instance *inst, const char *tracer_name
2020

2121
tracer = TRACEFS_TRACER_CUSTOM;
2222

23-
debug_msg("enabling %s tracer\n", tracer_name);
23+
debug_msg("Enabling %s tracer\n", tracer_name);
2424

2525
retval = tracefs_tracer_set(inst, tracer, tracer_name);
2626
if (retval < 0) {
2727
if (errno == ENODEV)
28-
err_msg("tracer %s not found!\n", tracer_name);
28+
err_msg("Tracer %s not found!\n", tracer_name);
2929

30-
err_msg("failed to enable the tracer %s\n", tracer_name);
30+
err_msg("Failed to enable the %s tracer\n", tracer_name);
3131
return -1;
3232
}
3333

@@ -44,7 +44,7 @@ void disable_tracer(struct tracefs_instance *inst)
4444

4545
retval = tracefs_tracer_set(inst, t);
4646
if (retval < 0)
47-
err_msg("oops, error disabling tracer\n");
47+
err_msg("Oops, error disabling tracer\n");
4848
}
4949

5050
/*

tools/tracing/rtla/src/utils.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,11 @@ void get_duration(time_t start_time, char *output, int output_size)
7777
time_t duration;
7878

7979
duration = difftime(now, start_time);
80-
tm_info = localtime(&duration);
80+
tm_info = gmtime(&duration);
8181

8282
snprintf(output, output_size, "%3d %02d:%02d:%02d",
8383
tm_info->tm_yday,
84-
tm_info->tm_hour - 1,
84+
tm_info->tm_hour,
8585
tm_info->tm_min,
8686
tm_info->tm_sec);
8787
}

0 commit comments

Comments
 (0)