From: Linus Torvalds Date: Wed, 26 Oct 2011 15:03:38 +0000 (+0200) Subject: Merge branch 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git... X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=7115e3fcf45514db7525a05365b10454ff7f345e;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.git Merge branch 'perf-core-for-linus' of git://git./linux/kernel/git/tip/tip * 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (121 commits) perf symbols: Increase symbol KSYM_NAME_LEN size perf hists browser: Refuse 'a' hotkey on non symbolic views perf ui browser: Use libslang to read keys perf tools: Fix tracing info recording perf hists browser: Elide DSO column when it is set to just one DSO, ditto for threads perf hists: Don't consider filtered entries when calculating column widths perf hists: Don't decay total_period for filtered entries perf hists browser: Honour symbol_conf.show_{nr_samples,total_period} perf hists browser: Do not exit on tab key with single event perf annotate browser: Don't change selection line when returning from callq perf tools: handle endianness of feature bitmap perf tools: Add prelink suggestion to dso update message perf script: Fix unknown feature comment perf hists browser: Apply the dso and thread filters when merging new batches perf hists: Move the dso and thread filters from hist_browser perf ui browser: Honour the xterm colors perf top tui: Give color hints just on the percentage, like on --stdio perf ui browser: Make the colors configurable and change the defaults perf tui: Remove unneeded call to newtCls on startup perf hists: Don't format the percentage on hist_entry__snprintf ... Fix up conflicts in arch/x86/kernel/kprobes.c manually. Ingo's tree did the insane "add volatile to const array", which just doesn't make sense ("volatile const"?). But we could remove the const *and* make the array volatile to make doubly sure that gcc doesn't optimize it away.. Also fix up kernel/trace/ring_buffer.c non-data-conflicts manually: the reader_lock has been turned into a raw lock by the core locking merge, and there was a new user of it introduced in this perf core merge. Make sure that new use also uses the raw accessor functions. --- 7115e3fcf45514db7525a05365b10454ff7f345e diff --cc arch/x86/kernel/kprobes.c index 794bc95134c,c0ed3d9c3b2..7da647d8b64 --- a/arch/x86/kernel/kprobes.c +++ b/arch/x86/kernel/kprobes.c @@@ -75,10 -75,10 +75,11 @@@ DEFINE_PER_CPU(struct kprobe_ctlblk, kp /* * Undefined/reserved opcodes, conditional jump, Opcode Extension * Groups, and some special opcodes can not boost. - * This is non-const to keep gcc from statically optimizing it out, as - * This is volatile to keep gcc from statically optimizing it out, as -- * variable_test_bit makes gcc think only *(unsigned long*) is used. ++ * This is non-const and volatile to keep gcc from statically ++ * optimizing it out, as variable_test_bit makes gcc think only ++ * *(unsigned long*) is used. */ - static u32 twobyte_is_boostable[256 / 32] = { -static volatile const u32 twobyte_is_boostable[256 / 32] = { ++static volatile u32 twobyte_is_boostable[256 / 32] = { /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */ /* ---------------------------------------------- */ W(0x00, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0) | /* 00 */ diff --cc kernel/trace/ring_buffer.c index f2f821acc59,acf6b68dc4a..f5b7b5c1195 --- a/kernel/trace/ring_buffer.c +++ b/kernel/trace/ring_buffer.c @@@ -2660,6 -2673,58 +2673,58 @@@ rb_num_of_entries(struct ring_buffer_pe (local_read(&cpu_buffer->overrun) + cpu_buffer->read); } + /** + * ring_buffer_oldest_event_ts - get the oldest event timestamp from the buffer + * @buffer: The ring buffer + * @cpu: The per CPU buffer to read from. + */ + unsigned long ring_buffer_oldest_event_ts(struct ring_buffer *buffer, int cpu) + { + unsigned long flags; + struct ring_buffer_per_cpu *cpu_buffer; + struct buffer_page *bpage; + unsigned long ret; + + if (!cpumask_test_cpu(cpu, buffer->cpumask)) + return 0; + + cpu_buffer = buffer->buffers[cpu]; - spin_lock_irqsave(&cpu_buffer->reader_lock, flags); ++ raw_spin_lock_irqsave(&cpu_buffer->reader_lock, flags); + /* + * if the tail is on reader_page, oldest time stamp is on the reader + * page + */ + if (cpu_buffer->tail_page == cpu_buffer->reader_page) + bpage = cpu_buffer->reader_page; + else + bpage = rb_set_head_page(cpu_buffer); + ret = bpage->page->time_stamp; - spin_unlock_irqrestore(&cpu_buffer->reader_lock, flags); ++ raw_spin_unlock_irqrestore(&cpu_buffer->reader_lock, flags); + + return ret; + } + EXPORT_SYMBOL_GPL(ring_buffer_oldest_event_ts); + + /** + * ring_buffer_bytes_cpu - get the number of bytes consumed in a cpu buffer + * @buffer: The ring buffer + * @cpu: The per CPU buffer to read from. + */ + unsigned long ring_buffer_bytes_cpu(struct ring_buffer *buffer, int cpu) + { + struct ring_buffer_per_cpu *cpu_buffer; + unsigned long ret; + + if (!cpumask_test_cpu(cpu, buffer->cpumask)) + return 0; + + cpu_buffer = buffer->buffers[cpu]; + ret = local_read(&cpu_buffer->entries_bytes) - cpu_buffer->read_bytes; + + return ret; + } + EXPORT_SYMBOL_GPL(ring_buffer_bytes_cpu); + /** * ring_buffer_entries_cpu - get the number of entries in a cpu buffer * @buffer: The ring buffer