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-v6.5-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace

Pull tracing fixes from Steven Rostedt:

- Fix to /sys/kernel/tracing/per_cpu/cpu*/stats read and entries.

If a resize shrinks the buffer it clears the read count to notify
readers that they need to reset. But the read count is also used for
accounting and this causes the numbers to be off. Instead, create a
separate variable to use to notify readers to reset.

- Fix the ref counts of the "soft disable" mode. The wrong value was
used for testing if soft disable mode should be enabled or disable,
but instead, just change the logic to do the enable and disable in
place when the SOFT_MODE is set or cleared.

- Several kernel-doc fixes

- Removal of unused external declarations

* tag 'trace-v6.5-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace:
tracing: Fix warning in trace_buffered_event_disable()
ftrace: Remove unused extern declarations
tracing: Fix kernel-doc warnings in trace_seq.c
tracing: Fix kernel-doc warnings in trace_events_trigger.c
tracing/synthetic: Fix kernel-doc warnings in trace_events_synth.c
ring-buffer: Fix kernel-doc warnings in ring_buffer.c
ring-buffer: Fix wrong stat of cpu_buffer->read

+21 -26
-4
include/linux/ftrace.h
··· 684 684 ftrace_set_early_filter(struct ftrace_ops *ops, char *buf, int enable); 685 685 686 686 /* defined in arch */ 687 - extern int ftrace_ip_converted(unsigned long ip); 688 687 extern int ftrace_dyn_arch_init(void); 689 688 extern void ftrace_replace_code(int enable); 690 689 extern int ftrace_update_ftrace_func(ftrace_func_t func); ··· 857 858 return -EINVAL; 858 859 } 859 860 #endif 860 - 861 - /* May be defined in arch */ 862 - extern int ftrace_arch_read_dyn_info(char *buf, int size); 863 861 864 862 extern int skip_trace(unsigned long ip); 865 863 extern void ftrace_module_init(struct module *mod);
+13 -12
kernel/trace/ring_buffer.c
··· 523 523 rb_time_t before_stamp; 524 524 u64 event_stamp[MAX_NEST]; 525 525 u64 read_stamp; 526 + /* pages removed since last reset */ 527 + unsigned long pages_removed; 526 528 /* ring buffer pages to update, > 0 to add, < 0 to remove */ 527 529 long nr_pages_to_update; 528 530 struct list_head new_pages; /* new pages to add */ ··· 561 559 struct buffer_page *head_page; 562 560 struct buffer_page *cache_reader_page; 563 561 unsigned long cache_read; 562 + unsigned long cache_pages_removed; 564 563 u64 read_stamp; 565 564 u64 page_stamp; 566 565 struct ring_buffer_event *event; ··· 950 947 /** 951 948 * ring_buffer_wake_waiters - wake up any waiters on this ring buffer 952 949 * @buffer: The ring buffer to wake waiters on 950 + * @cpu: The CPU buffer to wake waiters on 953 951 * 954 952 * In the case of a file that represents a ring buffer is closing, 955 953 * it is prudent to wake up any waiters that are on this. ··· 1961 1957 to_remove = rb_list_head(to_remove)->next; 1962 1958 head_bit |= (unsigned long)to_remove & RB_PAGE_HEAD; 1963 1959 } 1960 + /* Read iterators need to reset themselves when some pages removed */ 1961 + cpu_buffer->pages_removed += nr_removed; 1964 1962 1965 1963 next_page = rb_list_head(to_remove)->next; 1966 1964 ··· 1983 1977 if (head_bit) 1984 1978 cpu_buffer->head_page = list_entry(next_page, 1985 1979 struct buffer_page, list); 1986 - 1987 - /* 1988 - * change read pointer to make sure any read iterators reset 1989 - * themselves 1990 - */ 1991 - cpu_buffer->read = 0; 1992 1980 1993 1981 /* pages are removed, resume tracing and then free the pages */ 1994 1982 atomic_dec(&cpu_buffer->record_disabled); ··· 3376 3376 /** 3377 3377 * ring_buffer_unlock_commit - commit a reserved 3378 3378 * @buffer: The buffer to commit to 3379 - * @event: The event pointer to commit. 3380 3379 * 3381 3380 * This commits the data to the ring buffer, and releases any locks held. 3382 3381 * ··· 4394 4395 4395 4396 iter->cache_reader_page = iter->head_page; 4396 4397 iter->cache_read = cpu_buffer->read; 4398 + iter->cache_pages_removed = cpu_buffer->pages_removed; 4397 4399 4398 4400 if (iter->head) { 4399 4401 iter->read_stamp = cpu_buffer->read_stamp; ··· 4849 4849 buffer = cpu_buffer->buffer; 4850 4850 4851 4851 /* 4852 - * Check if someone performed a consuming read to 4853 - * the buffer. A consuming read invalidates the iterator 4854 - * and we need to reset the iterator in this case. 4852 + * Check if someone performed a consuming read to the buffer 4853 + * or removed some pages from the buffer. In these cases, 4854 + * iterator was invalidated and we need to reset it. 4855 4855 */ 4856 4856 if (unlikely(iter->cache_read != cpu_buffer->read || 4857 - iter->cache_reader_page != cpu_buffer->reader_page)) 4857 + iter->cache_reader_page != cpu_buffer->reader_page || 4858 + iter->cache_pages_removed != cpu_buffer->pages_removed)) 4858 4859 rb_iter_reset(iter); 4859 4860 4860 4861 again: ··· 5299 5298 cpu_buffer->last_overrun = 0; 5300 5299 5301 5300 rb_head_page_activate(cpu_buffer); 5301 + cpu_buffer->pages_removed = 0; 5302 5302 } 5303 5303 5304 5304 /* Must have disabled the cpu buffer then done a synchronize_rcu */ ··· 5358 5356 /** 5359 5357 * ring_buffer_reset_online_cpus - reset a ring buffer per CPU buffer 5360 5358 * @buffer: The ring buffer to reset a per cpu buffer of 5361 - * @cpu: The CPU buffer to be reset 5362 5359 */ 5363 5360 void ring_buffer_reset_online_cpus(struct trace_buffer *buffer) 5364 5361 {
+4 -10
kernel/trace/trace_events.c
··· 611 611 { 612 612 struct trace_event_call *call = file->event_call; 613 613 struct trace_array *tr = file->tr; 614 - unsigned long file_flags = file->flags; 615 614 int ret = 0; 616 615 int disable; 617 616 ··· 634 635 break; 635 636 disable = file->flags & EVENT_FILE_FL_SOFT_DISABLED; 636 637 clear_bit(EVENT_FILE_FL_SOFT_MODE_BIT, &file->flags); 638 + /* Disable use of trace_buffered_event */ 639 + trace_buffered_event_disable(); 637 640 } else 638 641 disable = !(file->flags & EVENT_FILE_FL_SOFT_MODE); 639 642 ··· 674 673 if (atomic_inc_return(&file->sm_ref) > 1) 675 674 break; 676 675 set_bit(EVENT_FILE_FL_SOFT_MODE_BIT, &file->flags); 676 + /* Enable use of trace_buffered_event */ 677 + trace_buffered_event_enable(); 677 678 } 678 679 679 680 if (!(file->flags & EVENT_FILE_FL_ENABLED)) { ··· 713 710 set_bit(EVENT_FILE_FL_WAS_ENABLED_BIT, &file->flags); 714 711 } 715 712 break; 716 - } 717 - 718 - /* Enable or disable use of trace_buffered_event */ 719 - if ((file_flags & EVENT_FILE_FL_SOFT_DISABLED) != 720 - (file->flags & EVENT_FILE_FL_SOFT_DISABLED)) { 721 - if (file->flags & EVENT_FILE_FL_SOFT_DISABLED) 722 - trace_buffered_event_enable(); 723 - else 724 - trace_buffered_event_disable(); 725 713 } 726 714 727 715 return ret;
+1
kernel/trace/trace_events_synth.c
··· 1230 1230 * synth_event_gen_cmd_array_start - Start synthetic event command from an array 1231 1231 * @cmd: A pointer to the dynevent_cmd struct representing the new event 1232 1232 * @name: The name of the synthetic event 1233 + * @mod: The module creating the event, NULL if not created from a module 1233 1234 * @fields: An array of type/name field descriptions 1234 1235 * @n_fields: The number of field descriptions contained in the fields array 1235 1236 *
+2
kernel/trace/trace_events_trigger.c
··· 31 31 /** 32 32 * event_triggers_call - Call triggers associated with a trace event 33 33 * @file: The trace_event_file associated with the event 34 + * @buffer: The ring buffer that the event is being written to 34 35 * @rec: The trace entry for the event, NULL for unconditional invocation 36 + * @event: The event meta data in the ring buffer 35 37 * 36 38 * For each trigger associated with an event, invoke the trigger 37 39 * function registered with the associated trigger command. If rec is
+1
kernel/trace/trace_seq.c
··· 131 131 * trace_seq_vprintf - sequence printing of trace information 132 132 * @s: trace sequence descriptor 133 133 * @fmt: printf format string 134 + * @args: Arguments for the format string 134 135 * 135 136 * The tracer may use either sequence operations or its own 136 137 * copy to user routines. To simplify formatting of a trace