Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'trace-v5.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace

Pull tracing fixes from Steven Rostedt:
"Functional fixes:

- Fix big endian conversion for arm64 in recordmcount processing

- Fix timestamp corruption in ring buffer on discarding events

- Fix memory leak in __create_synth_event()

- Skip selftests if tracing is disabled as it will cause them to
fail.

Non-functional fixes:

- Fix help text in Kconfig

- Remove duplicate prototype for trace_empty()

- Fix stale comment about the trace_event_call flags.

Self test update:

- Add more information to the validation output of when a corrupt
timestamp is found in the ring buffer, and also trigger a warning
to make sure that tests catch it"

* tag 'trace-v5.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
tracing: Fix comment about the trace_event_call flags
tracing: Skip selftests if tracing is disabled
tracing: Fix memory leak in __create_synth_event()
ring-buffer: Add a little more information and a WARN when time stamp going backwards is detected
ring-buffer: Force before_stamp and write_stamp to be different on discard
tracing: Fix help text of TRACEPOINT_BENCHMARK in Kconfig
tracing: Remove duplicate declaration from trace.h
ftrace: Have recordmcount use w8 to read relp->r_info in arm64_is_fake_mcount

+31 -16
+2 -9
include/linux/trace_events.h
··· 349 349 struct event_filter *filter; 350 350 void *mod; 351 351 void *data; 352 - /* 353 - * bit 0: filter_active 354 - * bit 1: allow trace by non root (cap any) 355 - * bit 2: failed to apply filter 356 - * bit 3: trace internal event (do not enable) 357 - * bit 4: Event was enabled by module 358 - * bit 5: use call filter rather than file filter 359 - * bit 6: Event is a tracepoint 360 - */ 352 + 353 + /* See the TRACE_EVENT_FL_* flags above */ 361 354 int flags; /* static flags of different events */ 362 355 363 356 #ifdef CONFIG_PERF_EVENTS
+1 -1
kernel/trace/Kconfig
··· 694 694 help 695 695 This option creates the tracepoint "benchmark:benchmark_event". 696 696 When the tracepoint is enabled, it kicks off a kernel thread that 697 - goes into an infinite loop (calling cond_sched() to let other tasks 697 + goes into an infinite loop (calling cond_resched() to let other tasks 698 698 run), and calls the tracepoint. Each iteration will record the time 699 699 it took to write to the tracepoint and the next iteration that 700 700 data will be passed to the tracepoint itself. That is, the tracepoint
+18 -3
kernel/trace/ring_buffer.c
··· 2815 2815 return 0; 2816 2816 2817 2817 /* 2818 + * It's possible that the event time delta is zero 2819 + * (has the same time stamp as the previous event) 2820 + * in which case write_stamp and before_stamp could 2821 + * be the same. In such a case, force before_stamp 2822 + * to be different than write_stamp. It doesn't 2823 + * matter what it is, as long as its different. 2824 + */ 2825 + if (!delta) 2826 + rb_time_set(&cpu_buffer->before_stamp, 0); 2827 + 2828 + /* 2818 2829 * If an event were to come in now, it would see that the 2819 2830 * write_stamp and the before_stamp are different, and assume 2820 2831 * that this event just added itself before updating ··· 3318 3307 goto out; 3319 3308 } 3320 3309 atomic_inc(&cpu_buffer->record_disabled); 3321 - pr_warn("[CPU: %d]TIME DOES NOT MATCH expected:%lld actual:%lld delta:%lld after:%lld\n", 3322 - cpu_buffer->cpu, 3323 - ts + info->delta, info->ts, info->delta, info->after); 3310 + /* There's some cases in boot up that this can happen */ 3311 + WARN_ON_ONCE(system_state != SYSTEM_BOOTING); 3312 + pr_warn("[CPU: %d]TIME DOES NOT MATCH expected:%lld actual:%lld delta:%lld before:%lld after:%lld%s\n", 3313 + cpu_buffer->cpu, 3314 + ts + info->delta, info->ts, info->delta, 3315 + info->before, info->after, 3316 + full ? " (full)" : ""); 3324 3317 dump_buffer_page(bpage, info, tail); 3325 3318 atomic_dec(&ts_dump); 3326 3319 /* Do not re-enable checking */
+6
kernel/trace/trace.c
··· 1929 1929 if (!selftests_can_run) 1930 1930 return save_selftest(type); 1931 1931 1932 + if (!tracing_is_on()) { 1933 + pr_warn("Selftest for tracer %s skipped due to tracing disabled\n", 1934 + type->name); 1935 + return 0; 1936 + } 1937 + 1932 1938 /* 1933 1939 * Run a selftest on this tracer. 1934 1940 * Here we reset the trace buffer, and set the current
-1
kernel/trace/trace.h
··· 605 605 void trace_latency_header(struct seq_file *m); 606 606 void trace_default_header(struct seq_file *m); 607 607 void print_trace_header(struct seq_file *m, struct trace_iterator *iter); 608 - int trace_empty(struct trace_iterator *iter); 609 608 610 609 void trace_graph_return(struct ftrace_graph_ret *trace); 611 610 int trace_graph_entry(struct ftrace_graph_ent *trace);
+3 -1
kernel/trace/trace_events_synth.c
··· 1225 1225 goto err; 1226 1226 } 1227 1227 1228 - if (!argc) 1228 + if (!argc) { 1229 + argv_free(argv); 1229 1230 continue; 1231 + } 1230 1232 1231 1233 n_fields_this_loop = 0; 1232 1234 consumed = 0;
+1 -1
scripts/recordmcount.c
··· 438 438 439 439 static int arm64_is_fake_mcount(Elf64_Rel const *rp) 440 440 { 441 - return ELF64_R_TYPE(w(rp->r_info)) != R_AARCH64_CALL26; 441 + return ELF64_R_TYPE(w8(rp->r_info)) != R_AARCH64_CALL26; 442 442 } 443 443 444 444 /* 64-bit EM_MIPS has weird ELF64_Rela.r_info.